Installing Ubuntu on External USB Hard Drive

Okay.. so this is not new and I am not trying to reinvent the wheels many others have spun already! All I am doing here is to mention some of the things they have missed which cause a lot of grief when you are trying to get this done. So this is essentially a add-on to posts like these http://www.pendrivelinux.com/installing-ubuntu-to-a-usb-hard-drive/ but with the missing pieces that I found elsewhere.

Use Case:

  • I have a primary machine running Windows or Mac or whatever
  • I have an external 3.5″ or 2.5″ hard drive (~17GB – 20GB) that I pulled out of my old desktop or laptop resp. This is not a flash drive btw, although I have done this kind of setup for the flash drive as well (I will have it on this blog soon)
  • I want to use this COMPLETE disk for Linux WITHOUT disturbing my Windows or Mac machine.
  • I do not want to install a bootloader on my primary machine, so I am not looking for dual boot. This is a completely separate install on this second hard drive.

Prerequisites:

  • Obviously you need a machine that you are going to use with this external drive. (Obviously you need a Processor, Keyboard, Mouse, Display, Network card.. the whole works except the hard disk! :-)
  • The BIOS on this machine should support booting from external USB drive.

Get Ready:

  • Get rid of all the data on the external hard drive aka transfer it or trash it if you don’t need it. Preferably format it completely (NOT quick format).
  • Make sure you run a chkdsk (if you are a windows user) like utility on the disk to make sure it is in good state. This happened to me on one drive and the installation of ext3 partition just stalled everytime.
  • Download the Ubuntu ISO from the Ubuntu site and burn it to a CD using your choice of ISO writer software. I think there is a ISO Recorder PowerToy for XP as well.
  • Shut down your machine.
  • Connect your external hard drive now.
  • Make sure you have this CD (called the Live CD) in the CD drive and start your machine.
  • BIOS Changes: Be quick and hit F12 or F2 or whatever key it is that allows you to get into the BIOS settings of your machine when it starts. Now make sure you have the following Boot order for these 3 media: CD, USB Drive, Local Hard Disk.

Step-By-Step:

  • Thanks to the boot order in the BIOS, your machine should boot from the CD.
  • Now select “Install Ubuntu” and proceed till you get to the Partitioner stage.
  • Here is where you need to be awake if you want to avoid a huge frustration later on!! I can’t stress it enough. LOOK AT THE SCREEN AND MAKE SURE YOU KNOW WHICH OPTIONS YOU ARE SELECTING. So choose the “Guided install (use entire disk)” option. CHOOSE THE EXTERNAL HARD DRIVE HERE AND NOT YOUR WINDOWS HARD DRIVE PLEASE!!. You can identify the correct drive by looking at the size. It should usually show up as the second drive there anyway. This is why many install instructions, suggest that you disconnect your primary drive before you attempt to install on an external drive. That way you will only see the external drive and won’t get confused. But for laptop users, disconnecting the internal drive may not be so easy and quick. AND YOU DO NOT NEED TO DO THAT IF YOU ARE CAREFUL.
  • Go ahead and enter your information on the “Who are you?” screen  and click ‘Advanced’ button on the ‘Ready to install” screen that follows (which shows the information you have selected to get your confirmation). Install GRUB on the appropriate drive (/dev/sdb or whatever it is). (Do not install on (hd0) which is the default option)
  • The installation should start now.
  • After it is done, you will be prompted to remove the CD and reboot.
  • On Rebooting, you should see the GRUB menu. Booting from Linux here most probably won’t work. Here is why – When you installed Ubuntu on this external drive, you booted from CD (so GRUB thinks it is being installed on HD1 (HD0 being the CD) – see our boot order above. Now when you boot from the external drive without the CD, this is HD0 and your Windows is HD1. So GRUB tries to load Linux from the Windows partition – and that fails and gives you error 17.
  • To fix this – just type ‘e’ and see that it is (hd1,0). Change this to (hd0, 0) and now Ubuntu should load. But this is only a temporary change.
  • So go into Ubuntu and edit the /boot/grub/menu.lst file and change (hd1,0) to (hd0, 0) everywhere in this file and save it and Reboot.

Now everything should be fine!

Enjoy!!

10 Comments

  1. Ken says:

    Kedar,
    I believe this is exactly what I’ve been looking for! I don’t want a Live USB; I want an actual installation on an external USB harddrive. I’ll give this a try within the next few days. I just have to clear existing files off the harddrive, and then I’m ready to go.
    Thank you very much!

  2. Jamana says:

    Great post, but I am wondering if it only works in windows.

    I followed every single step in the post, but whenever I choose Ubuntu in my bootloader (rEFIt) I am greeted by a message indicating the operating system is missing.

    I am using a Macbook Air 1,1

  3. Hi , you can install the program and start working. I m using in Windows, i dont know whether it will support in MAC or Linux.

  4. cookiej4r says:

    Great blog I’ve actually bookmarked it for learning ubuntu. Can you recommend any books about ubuntu for me? yep, I am a beginner of ubuntu. :] thanks in advance.

  5. Darron Kown says:

    I think you could pick up that comment and use it as a blog post. What you wrote is great advice any way that you look at it.

  6. Thanks a bunch! That was really informational, I just saved your url.

  7. If you had to choose between a Seagate, Western Digital, or a Samsung hard drive, which would it be? Which do you consider the most reliable out of them? I had a WD that went to crap on me after about 6 months, so I’m a bit leery of them.

  8. Morning, It’s nice to stumble upon a good website like this one. Do you care if I used some of your info, and I’ll leave a link back to your website?

  9. Kedar says:

    Sure you can. Thanks for your interest.

  10. I had been very pleased to locate this site.I wanted to thank you for this great read We certainly taking pleasure in each and every tiny bit of it and that i have you saved to look at brand new stuff you publish.

Leave a Reply