I’m getting a 2nd hard disk caddy for my work laptop that fits in the MulltiBay slot where the useless DVD-ROM drive goes, so that I can dual boot Linux on it (I’ve got a 160Gb 2.5″/9.5mm SATA drive hanging around). That of course presents the problem of how do we install an OS without a DVD drive?

Even a netinst is out of the question without a CD to boot from, and I don’t have a spare USB key that’s big enough to hold the 3.3Gb ISO image etc.

So PXE boot is the answer. I’ve just tested booting on the laptop and it worked fine – I did a complete install using VirtualBox too, so here’s my tutorial – commands to be run as root:

  1. install the TFTP/DHCP servers:
yum install tftp-server dhcp syslinux
  1. Setup DHCP and point it to the TFTP server IP:
cat > /etc/dhcpd.conf
allow booting;
allow bootp;
ddns-update-style interim;
ignore client-updates;

subnet netmask {
	  option routers;
	  option domain-name "localdomain";
	  option domain-name-servers;
	  option subnet-mask;
	  option broadcast-address;
	  range dynamic-bootp;
	  filename "pxelinux.0";
  1. Setup NFS to export the mounted ISO image:
mount -o loop Fedora-12-x86_64-DVD.iso /mnt/iso
cat >> /etc/exports
  1. Copy the PXE boot vmlinuz/initrd.img files into place and setup TFTP:
mkdir -p /tftpboot/pxelinux.cfg
cp /usr/lib/syslinux/pxelinux.0 /tftpboot/
cp /mnt/iso/images/pxeboot/* /tftpboot/

cat > /tftpboot/pxelinux.cfg/default
DEFAULT pxeboot
LABEL pxeboot
      KERNEL vmlinuz
      APPEND initrd=initrd.img

Also change /etc/xinetd.d/tftp to point to /tftpboot instead of somewhere in /usr/lib:

server_args = -s /tftpboot
  1. Start the services:
chkconfig tftp on
/etc/init.d/xinetd restart
/etc/init.d/dhcpd start
/etc/init.d/nfs restart

Then boot the PC (you might need to change the BIOS to ‘boot from Network' or enable PXE) and select NFS install, pointing it to the /mnt/iso directory on, then it will just fire up the GUI installer as usual. The install seems quicker over NFS than from the DVD too.