« A few good minions... | Main | MySQL Query Browser Blues »

Installing Fedora 9, the hard way

Friday afternoon I decided to start the migration process to my new workstation. I'm moving away from Windows XP and on to Linux--an operating system near and dear to my heart. Knowing that the folks over at JaWS (or ADCS?) keep an up-to-date Fedora repository, I decided to do a network-based install rather than burning the 48 CDs or single DVD it would take. Little did I know that this would set me on an interesting journey.

Turns out that we didn't have anything that would burn Fedora-9-x86_64-netinst.iso. Both Roxio and cdrecord (on Windows and Linux) refused to burn the image and we didn't have any MacBooks in the office that burned DVDs at the moment. The SHA1 sums matched, so that was rather curious. In any event, I had a portable hard drive I keep in my pack for random occasions like this and started on getting the installation image onto the HDD.

Luckily the BIOS on the new computer supported booting from a hard drive attached via USB. I devised what I thought was a novel plan to mount the ISO image, copy its contents to the hard drive, and boot to it using SYSLINUX (specifically EXTLINUX). According to Google, this is a fairly common process--although generally done with a USB flash drive. The steps I took are listed below for posterity.

1) Attach the hard drive to an existing Linux machine, create an ext2/3 partition, format it, and ensure it's bootable. There are similar ways of doing this on a ext2/3 or FAT partition without disrupting whatever was already on your drive.

# fdisk /dev/sdX
... delete partitions, create a new partition (n), make it bootable (a), change it to Linux (t 83), write to disk (w) ...
# mkfs.ext3 /dev/sdX1

2) Mount the ISO and the hard drive.

# mkdir /mnt/{iso,sdX1}
# mount -o loop Fedora-9-x86_64-netinst.iso /mnt/iso
# mount /dev/sdX1 /mnt/sdX1

3) Copy the ISO files to the hard drive, renaming and removing files as necessary.

# cp -a /mnt/iso/isolinux /mnt/sdX1/extlinux
# cp -a /mnt/iso/images /mnt/sdX1/images
... Note: .conf, not .cfg ...
# mv /mnt/sdX1/extlinux/isolinux.cfg /mnt/sdX1/extlinux/extlinux.conf
# rm /mnt/sdX1/extlinux/isolinux.bin

4) Install EXTLINUX and the SYSLINUX master boot record.

Note (April 18, 2009): More recent versions of extlinux require the use of the install flag (--install or -i) in the command below. If you don't have extlinux installed on a Fedora machine, run yum install syslinux.

# extlinux /mnt/sdX1/extlinux
# cat /usr/lib/syslinux/mbr.bin > /dev/sdX

5) Unmount the ISO and the device and remove our working directories.

# umount /mnt/sdX1
# umount /mnt/iso
# rmdir /mnt/{iso,sdX1}

6) Connect the hard drive to the target computer and boot away.

Thankfully, it was a success. The network installer worked perfectly and I have a fresh install of Fedora 9 to break in this week. The moral of the story is that SYSLINUX is even cooler than it was when I first played around with it years ago.