Legacy network boot Preboot eXecution Environment

March 28, 2017

Story

Legacy network boot Preboot eXecution Environment
By Pxe 213 37 84 214 - Own work, CC BY-SA 4.0

Preboot eXecution Environment (PXE) is a protocol that boots computers without using a hard drive or an operating system. PXE boot runs over a network...

Preboot eXecution Environment (PXE) is a protocol that boots computers without using a hard drive or an operating system. PXE boot runs over a network of computers and may or may not include internet access. It is almost exclusively used in systems that are connected to a central server and uses subsequent computers to run virtual operating systems.

Firmware is the piece of software that acts as an interface between the hardware (motherboard) and the operating system (OS). The difference between Unified Extensible Firmware Interface (UEFI) boot and legacy boot is the process that the firmware uses to find the boot target.

Legacy boot is the boot process used by basic input/output system (BIOS) firmware. BIOS was the first popular firmware for desktop PC introduced in 1975 by IBM for its Control Program for Microcomputers (CP/M) OS. Even though it is still widely present, computers have evolved tremendously and BIOS is unable to provide advanced features of modern hardware. The firmware maintains a list of installed storage devices that may be bootable (floppy disk drives, hard disk drives, optical disk drives, tape drives, etc.) and enumerates them in a configurable order of priority. Once the power-on self-test (POST) procedure has completed, the firmware loads the first sector of each of the storage targets into memory and scans it for a valid master boot record (MBR). If a valid MBR is found, the firmware passes execution to the boot loader code found in the MBR, which allows the user to select a partition to boot from. If one is not found, it proceeds to the next device in the boot order. If no MBR is found at all, the user is presented with the famous, “Please insert system disk yadda yadda yadda,” message.

UEFI boot is the successor to BIOS. UEFI uses the globally unique identifier (GUID) partition table (GPT) whereas BIOS uses the master boot record (MBR) partitioning scheme. GPT and MBR are both formats specifying physical partitioning information on the hard disk. The firmware maintains a list of valid boot volumes called EFI Service Partitions. During the POST procedure, UEFI firmware scans the bootable storage devices that are connected to the system for a valid GPT. Unlike a MBR, a GPT does not contain a boot loader. The firmware itself scans the GPTs to find an EFI Service Partition to boot from. If no EFI bootable partition is found, the firmware can fall back on the Legacy Boot method. If both UEFI boot and Legacy boot fail, the user is presented with the famous, “Please insert system disk yadda yadda yadda,” message.

Below is the primary difference between both boot processes:

  1. Max partition size in MBR is ~2 TB, whereas in UEFI it is ~9 ZB
  2. MBR can have, at max, 4 primary partitions, whereas GPT can have 128.
  3. MBR can store only one bootloader, whereas GPT has a separate dedicated EFI system partition (ESP) for storing multiple bootloaders. This is very helpful if you have two or more operating systems which require different bootloaders.
  4. UEFI offers secure boot, which can prevent boot-time viruses from loading.

Why legacy PXE?

In modern data centers, PXE is one of the most frequent choicesfor OS booting, installation, and deployment. Some of the advantages of legacy PXE are:

  • PXE boot can be run over a network and does not require local hard drives or an operating system. However, if a hard drive is attached to the client computer, PXE boot will have access to it as long as computer boots from the network first.
  • Likewise, an OS may be accessed through PXE boot if the OS exists on the client computer and the server commands PXE boot to do so.
  • PXE boot can be deployed without Internet access if the client computer is connected to a central server through a local area network (LAN).
  • It is a flexible, modular and efficient boot process.
  • The client machine or workstation does not require a storage device or OS.
  • Network extension and the addition of new client computers is made easier because PXE is vendor-independent.
  • Maintenance is simplified because most tasks are performed remotely.
  • Centralized data storage provides information security.
  • PXE is very fast and very useful. We installed thousands of machines here with a PXE boot, using Debian’s FAI, Kickstart, and a modified BSD installer. It’s one of the easiest ways to install machines, especially when you need automated installations.

Why legacy boot?

UEFI is a fine extension to the legacy PXE boot, but not all OSs support UEFI boot firmware. This is where legacy boot firmware becomes a core requirement to OS booting.

  • Windows versions such as Windows XP and Windows Server 2003 SP2 do not support UEFI boot.
  • Ubuntu, a dominant Linux distribution, started supporting UEFI only from Ubuntu-11.10. Any earlier version than that requires legacy boot firmware.
  • UEFI is commonly deployed as a 64-bit firmware. Booting 32-bit OS on a 64-bit UEFI firmware is very difficult. In such a case, legacy boot system, i.e. BIOS, is necessary.

With the legacy PXE implementation, deployment of all sorts of OSs is possible, as listed below:

  • Ubuntu 10.04 32-bit
  • Ubuntu 14.04 32/64-bit
  • Windows Server 2003 SP2, Server 2012 and Server 2016
  • Windows 7, 8.1, 10 64-bit Operating systems

We also tested booting of a very basic OS like FreeDOS (a derivative of MS-DOS) using Legacy PXE firmware.

We deployed Ubuntu 14.04 64-bit image on around five different computers having PXE SDK with help of same PXE server setup.

Kewal Agola is an Engineer at Volansys Technologies.

Kewal Agola, Volansys Technologies
Categories
Software & OS