Ask Your Question

Dual Boot Problem: F16 grub2 boots HP recovery partition

asked 2011-11-21 22:28:39 -0600

Agent007 gravatar image

updated 2011-12-10 09:12:52 -0600

I installed F16 on the internal USB drive of my HP Pavilion m7480n PC. WinXP is installed on the C-drive. The C-drive labeled HPPavilion has an 8 GB partition labeled HPRecovery. In F16 fdisk -l I can identify the partitions as follows:

 Windows Drive:
 HP-Pavilion /dev/sda1 *Boot ID=7 size=292 GB
 HP_Recovery /dev/sda2 ID=c size=8GB

 USB drive with Fedora 16:
 /dev/sdb1 *Boot ID=83 size=500 MB
 /dev/sdb2 ID=8E size=300 GB

When I boot the PC the grub2 menu comes up. If I select Fedora 16 it boots fine, but if I select Windows, grub2 boots HP-Recovery instead of WinXP. I've read the grub2 documentation but it's either outdated or not applicable to F16. I would appreciate any help toward fixing this problem. Thank you!

Nov. 26, 2011 OK. The output of os-prober is:

[root@localhost grub.d]# os-prober rmdir: failed to remove `/var/lib/os-prober/mount': Device or resource busy /dev/sda2:Windows NT/2000/XP:Windows:chain

The contents of /boot/grub2/ is:

this device map was generated by anaconda

(hd0) /dev/sda (hd1) /dev/sdf (hd1,1) /dev/sdf1

December 5, 2011 OK. I followed the suggestion and it worked - sort of. When I rebooted and the GRUB menu came up, lo and behold there was an entry for Windows XP! But when I selected Windows XP, GRUB came back with an error: "Error file not found". I have no idea who or what was looking for a file. The following is an excerpt from the "fdisk -l" command: [root@localhost Documents]# fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xcab10bee

Device Boot Start End Blocks Id System /dev/sda1 * 63 607610429 303805183+ 7 HPFS/NTFS/exFAT /dev/sda2 607610493 625137344 8763426 c W95 FAT32 (LBA)

I assume the disk uuid (as per the suggestion) for my case is "cab10bee". This is the value I used in my MenuEntry in 40_custom. I did a grub-mkconfig command. It worked and the new entry showed up in the grub.cfg file.

December 7, 2011 Well, we seem to be making progress. I put the correct uuid in 40_custom and then recreated grub.cfg as follows:

grub2-mkconfig -o /boot/grub2/grub.cfg

I then rebooted, the Grub menu came up and I selected Windows XP. I was then prompted: "Press any key to continue...". So i pressed the enter key and the Grub menu came back. At this point, as long as I choose Windows XP the only thing that happens is the "Press any key to continue..." prompt. If I choose Fedora 16, then Fedora 16 will boot normally. So I still can't boot Windows XP using grub2.

December 10, 2011 Here is the listing ... (more)

edit retag flag offensive close merge delete

6 Answers

Sort by ยป oldest newest most voted

answered 2011-11-27 03:30:17 -0600

gspe gravatar image

grub2 configuration is a pita :) This /etc/grub.d/40_custom should work with WinXP you just have to change the uuid with the uuid of yours WinXP partition

menuentry "Microsoft Windows XP" {
insmod part_msdos
insmod ntfs
insmod search_fs_uuid
insmod ntldr     
search --fs-uuid --no-floppy --set=root 69B235F6749E84CE
ntldr (${root})/ntldr}
edit flag offensive delete link more

answered 2011-12-06 07:30:32 -0600

gspe gravatar image

updated 2011-12-06 07:33:08 -0600

The uuid you are using is wrong, in order to find the uuid you can simply use this:

ls -l /dev/disk/by-uuid
    total 0
    lrwxrwxrwx. 1 root root 10 Dec  5 19:03 0bbf290f-b69d-4241-b8e0-113a38d23bec -> ../../sdf2
    lrwxrwxrwx. 1 root root 10 Dec  6 11:31 282AD9AE2AD978F0 -> ../../sdb1
    lrwxrwxrwx. 1 root root 10 Dec  6 11:32 287D-1DFA -> ../../sdi1
    lrwxrwxrwx. 1 root root 10 Dec  5 19:03 34684cc7-b21f-4001-b8ed-468d4ed59ca8 -> ../../sde1
    lrwxrwxrwx. 1 root root 10 Dec  5 19:03 442E482F2E481C74 -> ../../sda2
    lrwxrwxrwx. 1 root root 10 Dec  5 19:03 44AC6F4BAC6F3718 -> ../../sda3

so for example the uuid for /dev/sda2 is 442E482F2E481C74

edit flag offensive delete link more

answered 2011-11-22 01:07:27 -0600

asto gravatar image

What documentation did you read? Please post the link. I believe grub2 automatically boots into the first partition on the windows drive. Dunno why it's not doing that in your case. Anyway, to change this behaviour, you will need to edit the grub menu entry for windows. Open /etc/grub.d/40_custom with a text editor of choice. Find the windows menu entry and use the 'set root' option. In your case it should be 'set root = (hd0,0)'

The menu entry will begin something like 'menu entry "Windows"{'

Put the set root option right after that

edit flag offensive delete link more

answered 2011-12-15 02:42:53 -0600

gspe gravatar image

Your config seam to be right. I don't know why it doesn't boot.

Try to mount your Win XP partition and look for ntldr file. For example if you mount you Win XP partition (sda1) under /media/winxp directory you should find /media/winxp/ntldr file.

And you can verify you uuid of your Win XP partition with this command

grub-probe --target=fs_uuid /media/winxp/ntldr
edit flag offensive delete link more

answered 2011-12-08 05:57:45 -0600

gspe gravatar image

Just to be sure that everything is set-up right, could you post your grub menuentry and the output of

ls -l /dev/disk/by-uuid
edit flag offensive delete link more

answered 2011-11-25 13:03:10 -0600

kiilerix gravatar image

The output of "os-prober" and the content of /boot/grub2/ might be relevant.

Please edit your question and insert that.

edit flag offensive delete link more

Question Tools


Asked: 2011-11-21 22:28:39 -0600

Seen: 2,220 times

Last updated: Dec 15 '11