Ubuntu on an external drive---how to?

Paul Johnson pauljohn32 at gmail.com
Mon Jun 2 18:46:59 UTC 2008


On Mon, Jun 2, 2008 at 1:17 PM, Derek Broughton <news at pointerstop.ca> wrote:
> Kanda Kumar V wrote:
>
>> I've tried installing the boot loader (the grub) into /dev/sda (my
>> external drive) and when i reboot after the installation finishes.. i'm
>> getting grub error 17. i can't boot from my external USB device... i've
>> set my boot priority in BIOS as 1. USB hdd 2.CD drive 3.internal disk(the
>> windows one)...
>>
>> my external drive is an Western digital USB external HDD.
>
> Grub error 17 is "can't mount partition" (please post the error messages, we
> shouldn't have to go looking)
>
> Which makes one wonder if you really have grub pointing at the right
> device/partition.
>
> Regardless of whether /dev/sda really is the USB drive, there are a couple
> of other options.
>
> 1) You probably can't boot from a USB device if usbstorage, and probably
> other modules aren't in the initrd image in /boot.  I can't begin to
> imagine how you make sure the right modules are there.
>
> 2) You might try installing grub to the USB drive's partition superblock,
> rather than the MBR, and chaining from the internal drive's grub.  The
> entry in the internal drive's boot menu.lst would look like:
>
> title           USB Boot
> root            (hd1,0)
> makeactive
> chainloader     +1
>
> --
> derek

I have done this in Ubuntu 8.04. First, I did it the way you did, and
after trying to reboot, end up with a grub error.  That grub error
happens because the boot from the CDROM treats the internal disk as
sda, but when you boot off the external usb disk, then it becomes sda.
 As a result, it is necessary to make some customization of the
menu.lst file as well as rerunning grub.  I learned how to do those
things while fiddling with Fedora USB installs, and I don't think a
newbie linux user is going to succeed very well at it.

There is a second, fool proof strategy, which I have also done.

Step 1. Remove your hard disk from your laptop.

Step 2. Insert the USB drive, boot from the DVD, and install onto the
external drive.  I use the custom partition option, because I don't
like the way Ubuntu does by default.  When It asks about installing a
boot loader, accept the default (I recall that says (hd0) ).

Reboot after installing, make sure all is OK.

When you re-insert your hard disk, you can still boot from the USB
device.  The USB device will be found as sda, just as if it was the
only drive.

This method does not automatically create a "dual boot" configuration,
it does not know about your MS Windows and won't give that option.
But you can put it in easily enough by editing the menu.lst file.

If you persist in trying to reconfigure grub and deal with your
startup problem, email me again and I'll try to remember the details.
As I recall, if the boot gets far enough to fail inside grub, then you
end up at a command line prompt where you can type grub commands.
Your system now thinks it will find linux at root (hd1), but instead
it is on disk (hd0). You type "root (hd0,0)" to tell it your boot
partition is on that one magic spot.  then in the kernel line, you
make sure you tell it root= points to your / partition, and then you
need to fire up the initialram disk.  I did not take notes on how I
did it, and I don't think you should try to.  INstead, just take the
easy method outlined above.

PJ



-- 
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas




More information about the ubuntu-users mailing list