Install Ubuntu on external USB Hard Disk

I have a company notebook with encrypted HDD. I cannot change anything and, as usual,is a windows xp2 system. The only way I can boot linux easily is running a USB pen installation. I use SLAX, it works pretty well, configurable, fast. The issue with USB pen is that is not a complete installation, it runs in memory and not all the distribution can be run from there. Plus all the limit of running an OS from a small memory.

While is possible to install a minimal version of ubuntu on a USB Pen, this is not recommended. First of all the Flash drive are not build to work with continuous read and write access, as required for a full installation of Ubuntu or any other distribution.

The best way is to install your Linux distribution on a 2.5″ USB HDD, it is cheap, fast, reliable and it is like to run your distribution from your PC HDD. How to do that is a less than 1 hour job, easy even for novice. I suggest to prepare the partition before to start any installation, though Ubuntu installer gives the opportunity to do it during the installation. I recommend to create at least 3 partition: one for the root, one for the swap and the third for some free space to share with windows.

Let’s start.

Prerequisite: In this guide I suppose that you have at least the knowledge on how to partition a hard disk, run a live linux distribution and in general how to use a Linux at basic. It is better to use a desktop where you can disconnect all the IDE or SATA drive.

1) Prepare your HDD. You can use the live CD of Ubuntu Edgy. Boot, connect the USB HDD, run gparted. Don’t forget to un-mount the HDD before doing change to the partition table.

2) On a 80GB HDD, I suggest 15GB ext3 for the Ubuntu system, 1GB for the swap file and the rest for a FAT32 partition.

3) Disconnect all your fixed HDD and boot the CD with the installation. Just leave connected the USB HDD.

4) During the Ubuntu installation, the system will ask for automatic or manual partitioning. Choose manual and put the mount point of the 15GB to the “/” (root). I suggest to use the alternate CD of Ubuntu that enable a text installation. Graphic installation is slower and a bit tricky during the partitioning phase.

5 ) Move on with the installation to the end.

6) Reboot from the Live CD and connect the USB HDD

7) You have to modify the menu.lst of Grub to reflect your notebook configuration. So, go on /boot/grub directory on the mounted external HDD (for instance /media/usbdisk/boot/grub/menu.lst) and, in case of my X41 change sda1 with sdb1.

8 ) Usually you have to modify also fstab in the external HDD installation to reflect the name of the mout point in your notebook. For Ubuntu edgy is not required any change because the drive in fstab are listed in a different way (I don’t know the details) and it works right as it is.

9) Now you are ready to boot your new OS from the external HDD. After booting, usually you will get a login prompt. This is because the Xorg configuration won’t match the new hardware in case, for instance, you have prepared the external HDD on a different computer. Dont’t panic!

10) Reconfigure the Xorg. On Ubuntu is pretty easy just execute:

user@host:~$sudo dpkg-reconfigure -phigh xserver-xorg

reply to all the questions, just use default if you don’t know. This is the most complicated step for some distribution. Be prepared, maybe read the xorg.conf generated when you run the live CD version before doing any change.

That’s it. Not really for newbie but reasonable simple for “less experienced” like me.

Just drop a comment if you need help. I will be happy to help you.

11 Responses to Install Ubuntu on external USB Hard Disk

  1. Dufferz says:

    Hi there, This is a very good guide. When my laptop actually decides its going to boot up ( soon, I’ll bet.. =_=) I will try it out. 🙂

  2. Milkyway says:

    Hi there, your thorough guide makes me wonder, How can I use it for installing Ubuntu OS in my laptops that running on Windows Vista?
    Send me an E-mail for my comment please?…

  3. Nikhil says:

    i installed ubuntu on my usb harddisk without reading anything, now when i boot without attatching usb drive it shows error 21 in some grub, i was trying ubuntu for the first time, can u please sort me out. i am wondering if i need to install ubuntu again and this time unmount fixed drives first and then rest procedure.
    i even cant use that usb hard disk on another laptop to boot.it says wrong partition table.due to same reason i think.

  4. Hi,

    thanks for the most useful instruction. I tried it using Ubuntu 8.10 and it is even simpler now! See below.

    1a) Download the gparted Live CD, at least version 0.3.9. This version can create up or resize ntfs partions (previous versions can’t). The use of gparted is recommended to prepare the USB hard disk partions before installing Ubuntu.

    1b) Set up the partitions as required:
    – Set up a partition to share with Windows, using ntfs or FAT32
    – Set up the ubuntu partition with ext3, preferably 15-20GB or more.
    – Set the linux swap partition to double the amount of RAM in the target system

    1c) Alternatively, prepare your HDD using the live Ubuntu CD (don’t install, just run live from the CD). Boot

    from the CD, connect the USB HDD, but unmount the HDD. Run gparted to set up the partition table as required.

    2) Disconnect all your fixed hard disks physically. This way you can ensure the the master boot record and hard disk of the existing machine are not altered.

    3) Plug in the external hard disk. When installing Ubuntu, this external hard drive will be mounted as /dev/sda, since this is (presumably) the first disk in the system. It appears that Ubuntu 8.10 recognises the hard drive’s UUID and writes the /boot/grub/menu.lst file with the UUID information, not the /dev/sda device identifiers.

    4) Boot the Live CD with the installation. This time do an install as you would for an internal drive.

    5) During the Ubuntu installation, the system will ask for automatic or manual partitioning. Choose manual and put the mount point of the ext3 partition to the “/” (root).

    6) Complete the installation to the end. Turn off the computer.

    7) Install the internal hard disks to the machine.

    8) Connect the USB hard drive.

    9) Boot the PC and in BIOS setup, set the boot device order to (1) CDROM, (2) USB, (3) Internal hard disk. Save the BIOS settings to disk and continue.

    10) Ubuntu should now load and run.

    11) You may want to edit /boot/grub/menu.lst to allow booting windows from the internal disk (confirm this: but I suspect the USB drive should possibly remain connected for the full session).

    12) If the above does not work, follow the original instructions on https://ubuntufriends.wordpress.com/2007/03/05/install-ubuntu-on-external-usb-hard-disk/

  5. Nelis Willers says:

    Hi

    It’s me again. I tested the external USB drive so created on a couple of PCs. It works fine, but please note the following:

    The above procedure works fine, but older BIOSs require that the Linux kernel be located near the start of the disk. Please revise the above as follows:

    1b) Set up the partitions as required (this works on PCs with recent BIOSs).
    – Set up the ubuntu partition with ext3, preferably 15-20GB or more (as big as you need).
    – Set the linux swap partition to double the amount of RAM in the target system
    – Set up a partition to share with Windows, using ntfs or FAT32

    This is required for PCs with old BIOSs:
    – create an ext2 linux boot partition of 500M to 1GB, mount to /boot
    – Set up the ubuntu partition with ext3, preferably 15-20GB or more (as big as you need).
    – Set the linux swap partition to double the amount of RAM in the target system
    – Set up a partition to share with Windows, using ntfs or FAT32

    For more information on MBR, GRUB, BIOS limitations, etc. see the excellent pages at
    http://users.bigpond.net.au/hermanzone/

  6. I read your posts for quite a long time and should tell you that your posts always prove to be of a high value and quality for readers.

  7. Mohamed Fawzy says:

    I had installed ubuntu on external Hard drive using sun virtual box from inside windows by creating new virtual box with NO hard disk.
    I defined the usb hard drive in vbox then start with booting from Live CD, then boot in live mode (N.B. don’t use “install” option as the hard disk is not yet installed).
    Click on the install icon on the ubuntu desktop and complete the installation steps.
    every thing goes fine for me.

  8. YAA Adding this to my bookmarks. Thank You

  9. Gena Melton says:

    by the way, this Windows boot CD is easy to use and works

  10. interesting. myself I have just found this cool CD for booting and repairing Windows at windowsbootcd.com, trying it out right now

  11. USB Drive|Mini USB Camera|USB Camera|Flash Drive|Technology…

    […]Install Ubuntu on external USB Hard Disk « Ubuntu and friends[…]…

Leave a reply to Milkyway Cancel reply