Linux – Grub problem with dual boot Ubuntu & XP (Ubuntu installed first)

grublinuxmulti-bootwindows

I had Ubuntu installed and I installed XP. I tried to be able to dual boot them by running an Ubuntu live cd and running

~ $ sudo grub
grub> root (hd0,0)
grub> setup (hd0)

But now when I restart I get a black screen that says

'Boot device
Selected Boot Device and press any key

No matter what key I press it shows this error

This is what my system looks like:

/dev/sda1 – Ubuntu – ext3 – 73 GiB
/dev/sda2 – Ubuntu – extended – 3.16 GiB
/dev/sda5 – Ubuntu – linux-swap – 3.16 GiB

/dev/sdb1 – Windows XP – ntfs – 76 GiB

/dev/sdc1 – Stuff – ext3 – Code/Documents

/dev/sdd2 – Stuff – ext3 – Movies/Music

Best Answer

You could be running into a couple of issues here. Your system BIOS may be confused about which drive it's supposed to boot from. It might be easiest to disconnect all but your Ubuntu boot drive, then run through the Grub recovery again.


If you want to try again without pulling drives, make sure you're installing to the right drive by using Grub's tab-completion (type this out and press TAB where indicated):

grub> root (hd<TAB>

Grub will spit out what drives it sees:

grub> root (hd
 Possible disks are:  hd0 hd1 hd2 hd3

Now we're assuming it's drive 0, so type that in, and hit TAB again (yours will look different):

grub> root (hd0<TAB>
 Possible partitions are:
   Partition num: 0,  Filesystem type unknown, partition type 0x7
   Partition num: 1,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 2,  Filesystem type unknown, partition type 0x82
   Partition num: 3,  Filesystem type is ext2fs, partition type 0x83

If it only shows one partition, you've got the wrong drive; try again with drives 1,2,3 to make sure you install to the right drive.

Related Question