Ubuntu on my external USB drive... how not to affect my Windows on my laptop drive?

Asked by Yuzzy

Ok... It might be a little complicated but I'll ask anyway.

I have XP on my laptop's drive that I want to keep that way. I installed Ubuntu on my external USB drive (no problem at all... run like a charm). In order to boot on my Ubuntu and my XP, I got this grub menu. But as soon as I unplug my USB drive I get an Error 21.

Here is what I'de want:

I'de like my XP to boot normaly (no grub menu) when my USB drive is unplugged. And I would like to have this Grub menu when my USB drive is plugged on boot. A little kind of like with a LiveCD.

Possible?

Yuzzy
<email address hidden>

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
attikon (attikon) said :
#1

Hello there.

Im afraid that what you ask for is not possible. The boot loaders are installed in MBR (master boot record) of your hard drive. I suppose that you have installed GRUB on your internal drive's MBR. So, when you power on your pc it loads the menu from that location.

One thing you can do that im not sure it will work is to install GRUB on your external disk (I think there is this kind of option when you install ubuntu, ie to install the boot loader in the disk where you installed ubuntu and not in your primary disk) and erase your current internal disk's MBR. Then when you have your usb disk plugged you should go to your BIOS menu and change the boot order so your internal disk will be booted after your usb disk. When the boot process begins your usb disk will show the GRUB menu hopefully with an option for your Win XP disk.

Have a nice day.

Revision history for this message
Yuzzy (yanbuzz) said :
#2

anyone experienced what he just said?

Revision history for this message
Dmitry Mityugov (dmitry-mityugov) said :
#3

Good explanation, should work.

To install GRUB to your external drive, use these instructions: http://www.gnu.org/software/grub/manual/html_node/Installing-GRUB-natively.html . You can do this from your already installed GRUB loader by invoking an Edit command from the menu; examine what drive GRUB uses to boot and specify the different drive, for example hd1 if it uses hd0, and vice versa.

To remove GRUB from your internal hard drive MBR, use fdisk /mbr on that drive.

I assume your /boot partition is on the external drive, correct?

Revision history for this message
melfig (melchor-2006) said :
#4

hey i had this same problem heres what i had to do since i screwed up my mbr when i installed ubuntu. You have to fix the mbr before you do anything since i didn't have my xp cd i had to download the Super Grub Disk burned this to a cd as and iso image. You want to change your bios so that it boots from you External drive and then your internal drive. Reboot from the Grub cd and choose the english then windows and then fix mbr its something of that sort. After this your windows should boot up normally. Now what i had to do is reinstall Ubuntu i followed the steps when it got to the partition part i wanted to use all of my external drive so i chose that option make sure you know which drive is which though you don't want to erase whats on your laptops drive!!! after this follow the on screen directions for everything. when you get the the last step before you actually install i had to open the terminal and type this command fdisk -l once you do this it will say somehting like Disk /dev/sda: 81.9 GB, 81964302336 bytes this is my external drive so after i got this information the last step has a button that says advanced i believe click this and it will say something about where to install the boot or something like that it will have something like (hd0) i believe. You need to change this to whatever came up when you typed fdisk -l in my case i would type /dev/sda in the place of (hd0). Then install Ubuntu once the installation is complete you should get then grub menu when you reboot and your external drive is plugged in and your windows xp should boot if your external is not plugged in. ONLY if you changed your bios like i explained in the beginning. YOUR NOT DONE THOUGH as you can see when you the grub menu comes up when your external drive is plugged in and you choose to boot Ubuntu it will give you and error. OK now here's how i fixed this. when the ubuntu was highlighted on the grub menu i hit 'e' then it will give you something like (hd1,0) make sure this is highlighted and then hit 'e' again now what you need to do is change the 1 to a 0 so it should look like this (hd0,0) after you do this hit 'b' and Ubuntu should boot up. This is only a temporary change though what i had to do next once ubuntu was loaded up was edit the grub config file now to do this all i had to do was open the terminal and type this command gksudo gedit /boot/grub/menu.lst this will ask you for your password then you will get a text file. OK in this text file we need to make just a few changes whenever you see (hd1,0) you will need to change this to (hd0,0) for mine i had to change these....WHERE MINE SAID ROOT IT WAS ORIGINALLY (hd1,0) so i changed ONLY these to (hd0,0). After you do this save the file and try it out since your external drive is plugged in it will give you the grub menu choose ubuntu and it should load up. Whenever your external drive is not plugged in and you start your pc it should boot windows xp. I hope this helps this is what i had to do to mine and i read articles and articles about this and i finally got it to do what i wanted.
## ## End Default Options ##

title Ubuntu, kernel 2.6.20-16-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=da5352b1-738d-4607-9681-23acaba06a57 ro quiet splash
initrd /boot/initrd.img-2.6.20-16-generic
quiet
savedefault

title Ubuntu, kernel 2.6.20-16-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=da5352b1-738d-4607-9681-23acaba06a57 ro single
initrd /boot/initrd.img-2.6.20-16-generic

title Ubuntu, kernel 2.6.20-15-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=da5352b1-738d-4607-9681-23acaba06a57 ro quiet splash
initrd /boot/initrd.img-2.6.20-15-generic
quiet
savedefault

title Ubuntu, kernel 2.6.20-15-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=da5352b1-738d-4607-9681-23acaba06a57 ro single
initrd /boot/initrd.img-2.6.20-15-generic

title Ubuntu, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet

Can you help with this problem?

Provide an answer of your own, or ask Yuzzy for more information if necessary.

To post a message you must log in.