PDA

View Full Version : [ubuntu] 9.04 - How to fix grub configuration for dual boot?



milanlin
May 4th, 2009, 09:49 PM
Hello,
after upgrading from felicia to 9.04 the grub does not boot xp.
How to configure it? Here are some info:

from menu.lst

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sdb1
title Windows XP Media Center Edition
rootnoverify (hd1,0)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1

device.map
(hd0) /dev/sda
(hd1) /dev/sdb
(hd2) /dev/sdc
(hd3) /dev/sdd
(hd4) /dev/sde
(hd5) /dev/sdf

sudo fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe76f2c61

Device Boot Start End Blocks Id System
/dev/sda1 * 2 60801 488376000 f W95 Ext'd (LBA)
/dev/sda5 2 60801 488375968+ 7 HPFS/NTFS

Disk /dev/sdb: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3fc83fc8

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 10137 81425421 7 HPFS/NTFS
/dev/sdb2 10138 35634 204804652+ f W95 Ext'd (LBA)
/dev/sdb5 10138 35634 204804621 7 HPFS/NTFS

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xaa74b393

Device Boot Start End Blocks Id System
/dev/sdc1 * 2 60801 488376000 f W95 Ext'd (LBA)
/dev/sdc5 2 60801 488375968+ 7 HPFS/NTFS

Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes
16 heads, 63 sectors/track, 1938021 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk identifier: 0x84d5a45d

Device Boot Start End Blocks Id System
/dev/sdd1 2 1938021 976762080 f W95 Ext'd (LBA)
/dev/sdd5 2 1938021 976762048+ 7 HPFS/NTFS

Disk /dev/sde: 40.0 GB, 40037760000 bytes
255 heads, 63 sectors/track, 4867 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc344c344

Device Boot Start End Blocks Id System
/dev/sde1 1 4662 37447483+ 83 Linux
/dev/sde2 4663 4867 1646662+ 5 Extended
/dev/sde5 4663 4867 1646631 82 Linux swap / Solaris

Disk /dev/sdf: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x8d399bc0

Device Boot Start End Blocks Id System
/dev/sdf1 * 1 60800 488375968+ 7 HPFS/NTFS

XP is on /dev/sdb1 = (hd1,0) for grub, I thing.
How to?? Thanks

caljohnsmith
May 5th, 2009, 12:34 AM
Actually, on start up Grub sees the order of your drives the same as your BIOS boot order, so sdb is not necessarily (hd1) on start up. And since I don't know how your drives are ordered in your BIOS boot order, the easiest thing to do is try all possible combinations for booting Windows, so how about adding the following entries to your menu.lst:

title Windows XP (hd2)
rootnoverify (hd2,0)
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1

title Windows XP (hd3)
rootnoverify (hd3,0)
map (hd0) (hd3)
map (hd3) (hd0)
chainloader +1

title Windows XP (hd4)
rootnoverify (hd4,0)
map (hd0) (hd4)
map (hd4) (hd0)
chainloader +1

title Windows XP (hd5)
rootnoverify (hd5,0)
map (hd0) (hd5)
map (hd5) (hd0)
chainloader +1
Try each of the above entries from your Grub menu on start up, and hopefully one of them will work. Let me know how it goes or if you run into problems.

John

milanlin
May 5th, 2009, 08:00 PM
Actually, on start up Grub sees the order of your drives the same as your BIOS boot order, so sdb is not necessarily (hd1) on start up. And since I don't know how your drives are ordered in your BIOS boot order, the easiest thing to do is try all possible combinations for booting Windows, so how about adding the following entries to your menu.lst:

title Windows XP (hd2)
rootnoverify (hd2,0)
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1

title Windows XP (hd3)
rootnoverify (hd3,0)
map (hd0) (hd3)
map (hd3) (hd0)
chainloader +1

title Windows XP (hd4)
rootnoverify (hd4,0)
map (hd0) (hd4)
map (hd4) (hd0)
chainloader +1

title Windows XP (hd5)
rootnoverify (hd5,0)
map (hd0) (hd5)
map (hd5) (hd0)
chainloader +1
Try each of the above entries from your Grub menu on start up, and hopefully one of them will work. Let me know how it goes or if you run into problems.

John

Recently I did a hardware change and I forgot about it. I have pluged in new hdd, so there was a change in bios. As you said Grub sees the order of drives the same as BIOS boot priority. My xp hdd is 2nd in bios boot priority, but bios reed xp hdd as channel 5 = hd4 for grub's menu.lst. So I have rewriten the particular code to
title Windows XP Media Center (hd4)
rootnoverify (hd4,0)
map (hd0) (hd4)
map (hd4) (hd0)
chainloader +1

and it is now booting. Many thanks for your help.
and now for goog ubuntuing :-) I need to configure multiaudio with audigy ;(

caljohnsmith
May 5th, 2009, 08:58 PM
That's great news Windows XP is now booting from Grub again. Cheers and enjoy your dual-boot setup. :)

John