I decided to get a dedicated server for my project and passion of the moment (more on that later, maybe). As a result, I wanted to set up a CentOS installation so that I could work out all the bugs before uploading. Unfortunately, it turns out that getting CentOS working on a USB drive is not as easy as, say, Ubuntu or Slax, and it took some googling before I got it to work.
Installing CentOS To An External USB Drive
- When you boot CentOS and get to the initial screen, type “linux expert”. This will enable you to format/partition your external USB drive.
- When you reboot, reboot to the CentOS CD AGAIN and type “linux rescue”. This (should) mount your USB drive.
- Navigate to the /boot directory of your USB drive and rebuild the initrd for USB support with:
mkinitrd --with-usb --preload=ehci-hcd --preload=usb-storage --preload=scsi_mod --preload=sd_mod ./usbinitrd-X.X.XX-X.XXXX_LLL X.X.XX-X.XXXX_LLL. The right X.X.XX-X.XXXX_LLL codes can be seen under /lib/modules, just choose the appropriate one.
- Change your grub configuration to point to your new USB initrd.
Voila! CentOS goodness on an external USB drive.
mkdir /mnt/usb; mount /dev/sda1 /mnt/usb, substituting the appropriate device for /dev/sda1. See this forum thread for more details Simon’s guide to USB booting is the canonical guide for RH