Installing Scientific Linux on an External Hard Drive

This documents my experiences in installing Scientific Linux CERN 3 on an external USB hard drive, so that I could run Linux by booting from the hard drive without affecting the internal Windows XP disk at all.


Before attempting this installation make sure you are familiar with the requirements of Scientific Linux from CERN.

The supported method requires the creation of a boot CD (or floppies!) with the rest of the installation being carried out over the Net. However, for distant users where Net time-outs might be a problem, CD or DVD images are available, but not supported. These can be downloaded from the repository -- see the instructions in README.iso.

Make sure that the target machine can boot from both CD/DVD (or floppies if you are going that route...) and USB as well as the internal hard drive. I found it most convenient to set my Dell Inspiron 5150 boot order to
i) DVD
ii) USB
iii) HDD,
so that the USB takes precedence over the hard-drive and the DVD has highest priority for installation (I can still over-ride this order by hitting F12 during a reboot).


The key to installing onto the USB drive is to boot from the installation media and then type expert at the first prompt. This is undocumented, but allows the installation process to modify the external drive.

At the prompt for a Driver Disk, select NO, then continue by selecting the appropriate keyboard and installation media. Skip the Media Test, it takes a long while, although for peace of mind you might want to run it the first time you run through the installation procedure.

When you get to the disk partitioning process, select manual (Disk Druid) partitioning. Make sure you ignore the original hard disk at all times (altough Disk Druid will only alter Linux partitions). You will need to make a /boot partition, a / partition, and at least one /swap partition (swap partitions are 2 GB maximum, if you want more swap space than this you will need to create more partitions). If you want to share data with Windows you will need to make a vfat partition, although this can be an extended partition. Note that the /boot and /partitions must be primary partitions, or you won't be able to find them when modifying the initrd images later! If you haven't worked with Linux partitions before, seek the help of a local expert.

I ended up with these disk partitions:
although I later changed the free area to a vfat partition, and then again to a ntfs partition when I found that NTBACKUP can only write 4 GB save-sets to FAT32 partitions.

At this point you get to do the actual disk partitioning and formatting. When the installer asks where to install the boot-loader, select "advanced boot loader options" as you need to load grub into the Master Boot Record (MBR) of the external disk. This is done by changing the disk order in the advanced screen, which then allows you to select the external disk MBR.

Now you get to configure network, etc., and then can choose which packages to install.

When this is all finished, again boot the install media and type linux rescue. Don't start the network, skip the probe for installation, and go to the optional shell. Issue the following commands:
mount /dev/sda3 /mnt/source (This chooses your / partition, use the appropriate partition label.)
mount /dev/sda1 /mnt/source/boot (Use the partition for your /boot partition.)
chroot /mnt/source
mkinitrd --with-usb --preload ehci-hcd --preload usb-storage \
--preload scsi_mod --preload sd_mod /boot/initrd_usbsmp.img \

where /boot/initrd_usbsmp.img is the new boot ram-disk image you are creating, and 2.4.21-20.EL.cernsmp is the kernel version. You may have two kernel versions, one with SMP and one without, if you have a Hyperthreading processor; make ram-disks for both.
nano /boot/grub/grub.conf -- Use the editor to change the ram-disk image for eack kernel in the config file to the ones you have just created.

Note that each time you do a kernel upgrade you will need to repeat the above steps for each kernel, but it will be easier as you can access the /boot partition from an earlier kernel without the need of a rescue disk.

Make sure you run the firstboot initialisations after rebooting from the disk for the first time, and then perform the updates. If you have an nVidia graphics card, install the driver for it; CERN claimed it is only necessary for 3D graphics, but my card wouldn't work at all for X until I used the driver. Similarly, my external USB mouse did not work until I updated the kernel. I still can't use the SMP kernel as it hangs -- apparently support for my motherboard didn't arrive until about kernel update 2.4.24, but RedHat Enterprise and Scientific Linux are stuck on 2.4.21. / 31-Jan-2005.