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 192.168.0.0 netmask 255.255.255.0 {
	  option routers 192.168.0.1;
	  option domain-name "localdomain";
	  option domain-name-servers 192.168.0.1;
	  option subnet-mask 255.255.255.0;
	  option broadcast-address 192.168.0.255;
	  range dynamic-bootp 192.168.0.200 192.168.0.201;
	  next-server 192.168.0.3;
	  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
/mnt/iso 192.168.0.0/24(ro)
  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
TIMEOUT 50
LABEL pxeboot
      KERNEL vmlinuz
      APPEND initrd=initrd.img
ONERROR LOCALBOOT 0

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 192.168.0.3, then it will just fire up the GUI installer as usual. The install seems quicker over NFS than from the DVD too.