Installing Linux on External USB HDD

Installing Linux on External USB HDD

Recognising the USB HDD drive

If your BIOS does not recognise the USB drive, you are out of luck. If your BIOS does recognise it, the next step is that Redhat Install program should recognise the USB hard disk. If it does, you skip the following.

If Redhad installation program does not recognise the USB drive, you will not see the USB drive listed in Disk Druid when you setup your partitions, etc. In that case you will need some “jugaad”.

I got my hands on a typical USB Flash drive that works with Linux and other OS with any special drivers. Most of them are useful.

  • Plug it in, start your computer and insert RHEL CD 1
  • Go into BIOS setup and choose to boot off the CD
  • On the prompt, type
    boot: linux expert
  • Follow the steps. As you proceed, you will see that a message pops up saying that usb-storage driver has been loaded. Proceed to the point where the first GUI screen with Welcome message comes up
  • Instead of clicking on ‘Next’ do ‘Ctrl+Alt+F2’ and you will come to a shell
  • If you do
    # ls -l /dev

    you should see sda, sda1, etc devices also. These are your USB partitions

  • Now remove the USB Flash Drive and insert your USB hard disk in the same slot
  • You can use ‘parted’ program to create partitions. See this page for details on the usage of ‘parted’. Use device /dev/sda. I will assume that you will set /dev/sda1 as ext3 file system and as the boot partition
  • Do ‘Ctrl+Alt+F7’ and you will come back to Linux installation. Continue the installation

Booting from the USB HDD drive

  • When you will try to boot from the USB hdd, the boot-up may not proceed properly and the system can hang or crash. This is not unusual
  • Plug it in, start your computer and insert RHEL CD 1
  • Go into BIOS setup and choose to boot off the CD
  • On the prompt, type
    boot: linux expert
  • Follow the steps. As you proceed, you will see that a message pops up saying that usb-storage driver has been loaded. Proceed to the point where the first GUI screen with Welcome message comes up
  • Instead of clicking on ‘Next’ do ‘Ctrl+Alt+F2’ and you will come to a shell
  • If you do
    # ls -l /dev

    you should see sda, sda1, etc devices also. These are your USB partitions

  • Now remove the USB Flash Drive and insert your USB hard disk in the same slot
  • Now you can mount the USB hdd partitions by typing,
    # cd /tmp/ramfs
    # mkdir usbhdd
    # mount -t ext3 /dev/sda1 /tmp/ramfs/usbhdd
    # chroot /tmp/ramfs/usbhdd
    # uname -r
    2.6.9-34.EL
    # mkinitrd --preload=ehci-hcd --preload=usb-storage --preload=scsi_mod --preload=sd_mod \
      /boot/initrd-2.6.9-34.EL.img 2.6.9-34.EL
  • Make necessary changes in /boot/grub/grub.conf to use the above img file
  • Reboot, go into BIOS setup and choose to boot off the USB drive



Dinker Charak

Dinker has over a decade of experience in building products across diverse domains as Industrial Automation, Home Automations, Operating Systems, High Energy Particle Physics, Embedded Systems, Online Video Advertising, Messaging, K-12 education and Private Banking. He also founded Gungroo Software. His books #ProMa, Absolute and None & The Murmurs of the Dawn are available on Amazon.
Close Menu