This will serve as a guide to booting Ubuntu (XBMCbuntu in my case) from an iSCSI drive.
The boot process for my XBMCbuntu machine follows these steps:
- The BIOS is configured to PXE boot.
- The PXE boot process launches iPXE (formerly gPXE).
- iPXE connects to the iSCSI drive and launches GRUB which is installed on the remote iSCSI disk.
- GRUB launches a custom initramfs that has been compiled with the iSCSI module.
- GRUB passes the iSCSI connection information to the kernel via command line options.
- The kernel informs initramfs to initiate a connection to the iSCSI disk.
- The kernel boots using the iSCSI disk as its root file system..
This is the resulting storage information screen in XBMCbuntu. For all intents and purposes, the OS thinks it has a local 20GB disk when in reality the disk is on a different machine and the system has been booted over the network.
- PXE or Pre-boot eXecution Environment is a method of booting computers via a network interface without any local hard drive. In simpler terms, the network card gets the files it needs to boot from a file server on the network rather than from a hard drive inside the computer.
- iPXE (formerly gPXE) is PXE on steroids; it allows booting from additional network protocols such as iSCSI.
- iSCSI is a protocol for accessing disks (virtual or physical) over a network at the block level. This is very different from other protocols such as SAMBA or NAS which do not provide block level access to shared disks.
- iSCSI initator is the diskless, client computer. It initiates the connection to the iSCSI target.
- iSCSI target is the server which shares the iSCSI disk on the network.
- Lastly, XBMCbuntu Eden is a flavor of ubuntu designed to be a media center, and incidentally will be the Ubuntu flavor that I will be installing on my client.
It is assumed that you already have a machine running Ubuntu that will act as the iSCSI target aka the server.
- Part 1: Setup the Ubuntu iSCSI target (server) – In Part 1 we will setup a virtual disk drive that will be shared to the network over the iSCSI protocol.
- Part 2: Initiate an iSCSI Connection – In Part 2 we will move to the client computer and initiate a connection to the iSCSI disk we created in Part 1.
- Part 3: Install & Configure Ubuntu to boot from an iSCSI disk – In Part 3 we install the OS, build a new initramfs and configure GRUB to support booting from a remote iSCSI disk.
- Part 4: Install & Configure iPXE – In Part 4 we setup an (optional) PXE server and setup iPXE to connect to and boot the iSCSI disk.
- Part 5: Configuring dnsmasq to chainload PXE, iPXE and GRUB – connecting the dots to boot the diskless client system.
4 thoughts on “PXE Booting Ubuntu from an iSCSI drive”
I have some outdated notes from the previous XBMC Live version you might find useful:
Feel free to use whatever.
Oh no, there’s no part 5! When do you anticipate adding it?
I’ve been searching everywhere for instructions on how to do this and I’ve been following all the other steps – really well explained and easy to follow. But there is no part 5 🙁
Part 5 is up!
[…] Boot with iPXE, press ctrl+b when prompted, type dhcp, then type sanboot iscsi:<IP_of_target>::::iqn. <path_to_target> and watch it boot the OS! You could automate the whole boot process by chainloading iPXE through PXE via dnsmasq like this […]