How To Install Ubuntu Linux From USB Drive
How To Install Ubuntu Linux From USB Drive
be quite some work to get Ubuntu working on a USB stick. Besides, having to prepare your USB
device, creating a separate partition on it which will be more or less “useless” after the installation,
giving up 750MB of space?
Together with a colleague of mine, I decided to figure out whether there could be an easier way to
install Ubuntu on a USB device.
I found a way of doing it in a much simpler way… without creating the separate partition to store
the LiveCD:
A couple of assumptions to take into account when going through this manual:
My computer (Dell D820 laptop) has 1 internal disk, devided into 3 partitions (dell utility -
windows - Ubuntu 8.04)
Just one USB device (in my case a 250GB harddisk
BIOS configured to enable boot from internal HDD, CD/DVD and USB Storage device
(I didn’t take screenshots, so I will be explaining a lot about the screens… It looks like a lot of
work, but trust me: it is not, and it really is easy:-)
Once the installation is finished, reboot your PC (this is the safest) from your LiveCD, with your
USB device connected;
Once started, open up a terminal (Applications - Accessories - Terminal);
In the Terminal, type: sudo -i (which will give you root privileges, so be careful from now on!);
Change directories to /media/disk/boot/grub - This will take you to the “/boot/grub” directory on the
USB device;
open menu.lst with vi (make a backup first!)
Go to line 130 (or somewhere in that area).
You will find a line looking like:
## ## End Default options ##
And underneath it you will find three entries pointing to your Ubuntu you just installed:
title Ubuntu 8.04, kernel 2.6.24-16-generic
root (hd1,0)
kernel /boot/vmlinuz………
initrd /boot/initrd…….
quiet
(the above 5 lines repeat 3 times with slight differences)
The magic trick is to change (hd1,0) into (hd0,0) for all these three entries.
Why? Booting from USB device makes your USB device hd0, in stead of hd1 at time of
installation.
Search for the line starting with “# groot=(hd1,0)” and change (hd1,0) to (hd0,0) - Don’t delete the
# at te beginning of this line!
Once you did this, you can optionally remove the remaining of the file
(everything underneath ### END DEBIAN AUTOMATIC KERNELS LIST);
Save the file, make sure it is owned by root:ubuntu (chgrp ubuntu menu.* will do)
Edit device.map (in the same directory) and change the mapping of hd0 to /dev/sdb.
Reboot your machine, from USB, choose the Ubuntu installation from the Boot Loader and you are
one happy person.