Bug 753923 - grub2-mkconfig finds Windows 8 partition, menu entry will not boot
Summary: grub2-mkconfig finds Windows 8 partition, menu entry will not boot
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: grub2
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Peter Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-14 21:22 UTC by Flóki Pálsson
Modified: 2012-12-23 23:54 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-23 23:54:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
F16 /boot/grub2/grub.cfg (11.51 KB, text/plain)
2011-11-14 21:22 UTC, Flóki Pálsson
no flags Details
F14 grub.config (6.00 KB, text/plain)
2011-11-14 21:23 UTC, Flóki Pálsson
no flags Details
# fdisk -l in F16 (2.65 KB, text/plain)
2011-11-14 21:24 UTC, Flóki Pálsson
no flags Details
grub and other inforatin (4.49 KB, text/plain)
2012-05-13 18:08 UTC, Flóki Pálsson
no flags Details

Description Flóki Pálsson 2011-11-14 21:22:09 UTC
Created attachment 533629 [details]
F16 /boot/grub2/grub.cfg

Description of problem:
I is not possible to boot into Windows 8 with menu entry in /boot/grub2/grub.cfg in F16 created with grub2-mkconfig -o /boot/grub2/grub.cfg.
Win 8 shows start up screen an then reboots.   

Version-Release number of selected component (if applicable):
grub2-1.99-12.fc16.x86_64
WindowsDeveloperPreview-64bit-English.iso

How reproducible:
always 

Steps to Reproduce:
1. Innstall WIN 8 WindowsDeveloperPreview-64bit-English.iso on /dev/sda while other disks are unplugged.
2. run  in F16 grub2-mkconfig -o /boot/grub2/grub.cfg
3. reboot select Fedora F16 in F14 boot menu
4. select "Windows Recovery Environment (loader) (on /dev/sdb1)" in F16 boot menu

  
Actual results:
Windows 8 shows first  start screen and then reboots.

Expected results:
To boot into Win 8 from F16 grub2 menu entry.

Additional info:
Bios is configured to boot to /dev/sdc
It is possible to boot to win 8 from F14 menu entry.

Win 8 was installed to disk /dev/sda ( 250 gb ) while other disks where unplugged.  

WIN 8 version installed 
WindowsDeveloperPreview-64bit-English.iso

F16 boot is on /dev/sdc10
F16
Command to regenerate grub2 in F16
grub2-mkconfig -o /boot/grub2/grub.cfg

Section from 
# gedit /boot/grub2/grub.cfg &
inn F15 
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Recovery Environment (loader) (on /dev/sdb1)" --class windows --class os {
	insmod part_msdos
	insmod ntfs
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set=root E47C1A4B7C1A193E
	drivemap -s (hd0) ${root}
	chainloader +1
}
#
F14 
section from F14 which boots WIN 8 ok 
gedit /media/F14/boot/grub/grub.conf &
# section to load Windows 
title Windows         
rootnoverify (hd1,0)         
chainloader +1
#
#
F14 boot too F16 boot menu
title Fedora F16
	root (hd0,9)
	kernel /boot/grub2/core.img
	boot

Comment 1 Flóki Pálsson 2011-11-14 21:23:37 UTC
Created attachment 533630 [details]
F14 grub.config

Comment 2 Flóki Pálsson 2011-11-14 21:24:39 UTC
Created attachment 533631 [details]
# fdisk -l  in F16

Comment 3 Flóki Pálsson 2011-11-14 21:28:03 UTC
Correction to Comment 0
># gedit /boot/grub2/grub.cfg &
>inn F15 

inn F15 should bee F16

Comment 4 Mads Kiilerich 2011-11-17 22:02:38 UTC
You installed windows to sda? But boot it from sdb? And you windows stuff on both sda and sdb?

What do you have in /boot/grub2/device.map ? What linux drive letters do you think these devices corresponds to? Will grub2-mkdevicemap change the content of that file?

What do os-prober show?

Can you boot windows from grub2 from the other linux distros you have?

Can you do some experiments and edit your grub.cfg and see if you can find a combination that shows what grub2-mkconfig should have generated?

Comment 5 Flóki Pálsson 2011-11-19 17:14:38 UTC
the error is probably in /boot/grub2/device.map.
'(hd0)      /dev/sdb'  shoul be '(hd1)      /dev/sdb'


>You installed windows to sda? But boot it from sdb? And you windows stuff on
>both sda and sdb?
From comment 0 
corretion
"Win 8 was installed to disk /dev/sda ( 250 gb ) while other disks where
unplugged. "
Windows 8 is on  /dev/sdb ( 250 gb ). /dev/sda ( 500 gb ) is olny data.
Windows 8 is only on /dev/sdb ( 250 gb ).


>What do you have in /boot/grub2/device.map ? What linux drive letters do you
>think these devices corresponds to? Will grub2-mkdevicemap change the content
>of that file?
gedit /boot/grub2/device.map &
"
# this device map was generated by anaconda
(hd0)      /dev/sdb
(hd1)      /dev/sda
(hd2)      /dev/sdc
(hd0,10)      /dev/sdb10
"


>What do os-prober show?
# os-prober
  No volume groups found
/dev/sdb1:Windows Recovery Environment (loader):Windows:chain
/dev/sdc11:Fedora release 16 (Verne):Fedora:linux
/dev/sdc12:Debian GNU/Linux (5.0):Debian:linux
/dev/sdc14:Fedora release 16 (Verne):Fedora1:linux
/dev/sdc15:Fedora release 15 (Lovelock):Fedora2:linux
/dev/sdc2:Fedora release 14 (Laughlin):Fedora3:linux
/dev/sdc5:Fedora release 13 (Goddard):Fedora4:linux
/dev/sdc6:Fedora release 15 (Lovelock):Fedora5:linux
/dev/sdc7:Ubuntu 11.04 (11.04):Ubuntu:linux
/dev/sdc8:Linux Mint 11 Katya (11):LinuxMint:linux
/dev/sdc9:Debian GNU/Linux (6.0.3):Debian1:linux


>Can you boot windows from grub2 from the other linux distros you have?
No.
I have tryed both deb 6 and ubuntu 11.04.
Using same metod as for F16.

From Deb 6 /boot/grub/grub.cfg
"
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Recovery Environment (loader) (on /dev/sdb1)" {
	insmod part_msdos
	insmod ntfs
	set root='(hd2,msdos1)'
	search --no-floppy --fs-uuid --set e47c1a4b7c1a193e
	drivemap -s (hd0) ${root}
	chainloader +1
}
"
From deb 6 
/media/deb6/boot/grub/device.map
"
(hd0)	/dev/disk/by-id/ata-ST3500418AS_6VMAHXQY
(hd1)	/dev/disk/by-id/ata-Hitachi_HDP725050GLA360_GEA554RF2ETYLG
(hd2)	/dev/disk/by-id/ata-Hitachi_HDP725025GLA380_GEK230RBSUVDEA
"
from /media/UB1104/boot/grub/grub.cfg
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Recovery Environment (loader) (on /dev/sdb1)" --class windows --class os {
	insmod part_msdos
	insmod ntfs
	set root='(/dev/sdb,msdos1)'
	search --no-floppy --fs-uuid --set=root E47C1A4B7C1A193E
	drivemap -s (hd0) ${root}
	chainloader +1
}
there is no device.map in ubuntu in /boot/grub

>Can you do some experiments and edit your grub.cfg and see if you can find a
>combination that shows what grub2-mkconfig should have generated?
Setting in /etc/grub.d/40_custom and changing hd0 to hd1 then booting from F16 boot in to win 8 is ok.


### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "Windows Recovery Environment (loader) (on /dev/sdb1)" --class windows --class os {
	insmod part_msdos
	insmod ntfs
	set root='(hd1,msdos1)'
	search --no-floppy --fs-uuid --set=root E47C1A4B7C1A193E
	drivemap -s (hd1) ${root}
	chainloader +1
}
### END /etc/grub.d/40_custom ###

and adding  to /etc/grub.d/40_custom an rerun grub2-mkconfig works to.
menuentry "Windows 8" {
set root='(hd1,msdos1)'
chainloader +1
}

the error is probably in /boot/grub2/device.map.
'(hd0)      /dev/sdb'  shoul be '(hd1)      /dev/sdb'


cp /boot/grub2/device.map  /boot/grub2/device.map.bak  

grub-mkdevicemap

Comment 6 Mads Kiilerich 2011-11-20 00:39:41 UTC
How do a device.map generated by grub2-mkdevicemap look like? Will it contain the necessary changes, and will grub2-mkconfig generate a working grub.cfg?

However, I think a part of the answer is this: Windows will apparently have problems booting if the number and ordering of the involved hard drives changes after it has been installed - and that is what happened. Grub2 _can_ be used to work around that, but there is no way the Fedora installer or the grub2 tools can now what physical changes there has been before Fedora was installed and which workarounds this particular installation of windows requires.

Comment 7 Flóki Pálsson 2011-11-20 01:10:17 UTC
>How do a device.map generated by grub2-mkdevicemap look like? 
(hd0)	/dev/disk/by-id/ata-ST3500418AS_6VMAHXQY
(hd1)	/dev/disk/by-id/ata-Hitachi_HDP725025GLA380_GEK230RBSUVDEA
(hd2)	/dev/disk/by-id/ata-Hitachi_HDP725050GLA360_GEA554RF2ETYLG

>Will it contain
>the necessary changes, and will grub2-mkconfig generate a working grub.cfg?
no.
Windows starts in first screen in error mode and ends  in black screen with errors


# gedit /boot/grub2/grub.cfg &
part of file after grub2-mkconfig and generateing a working grub.cfg
"
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows Recovery Environment (loader) (on /dev/sdb1)" --class windows --class os {
	insmod part_msdos
	insmod ntfs
	set root='(hd1,msdos1)'
	search --no-floppy --fs-uuid --set=root E47C1A4B7C1A193E
	drivemap -s (hd0) ${root}
	chainloader +1
}
"

>However, I think a part of the answer is this: Windows will apparently have
>problems booting if the number and ordering of the involved hard drives changes
>after it has been installed - and that is what happened. Grub2 _can_ be used to
>work around that, but there is no way the Fedora installer or the grub2 tools
>can now what physical changes there has been before Fedora was installed and
>which workarounds this particular installation of windows requires.

F16 was installed before windows.
'drivemap -s (hd0) ${root}' is still pinting to hd0 after after grub2-mkconfig and generateing a working grub.cfg
I am not sure.  I think I changed boot order in bios after installing F16.

Comment 8 Mads Kiilerich 2012-05-01 22:16:50 UTC
An os-prober with support for win8 was just pushed to f17 testing. That might make a difference.

Comment 9 Flóki Pálsson 2012-05-13 18:08:55 UTC
Created attachment 584164 [details]
grub and other  inforatin

grub and other  inforatin

Comment 10 Mads Kiilerich 2012-05-13 18:28:35 UTC
(In reply to comment #9)

Thanks, but I'm afraid that you will have to add some description of this information - for example the grub2 version and what works and doesn't work and what is what. Please also try to remove device.map and see if that makes a difference.

Comment 11 Flóki Pálsson 2012-05-13 18:34:18 UTC
  It is not possible to boot win8 from F17.
    Installed F17 TC5.  To boot from F17 to WIN8 does not work.
    Win 8 starts and goes down to bios.

    It not possible to  use caheinload form F14.
    rootnoverify (hd2,0)
    chainloader +1

    After experimenting then It not possible to bot direct to win 8.

    Win 8 is installed on /dev/sda while other disks where unplugged.

Comment 12 Vladimir Serbinenko 2012-06-02 10:21:41 UTC
The config entry which worked for me was:
menuentry "Windows 8" {
   root=<insert right disk here>
   ntldr /bootmgr
}

I haven't tried any other config.

Comment 13 Vladimir Serbinenko 2012-06-03 11:21:36 UTC
I've tried the autogenerated entry today and has no problem. Can you try removing drivemap line?

Comment 14 Vladimir Serbinenko 2012-06-03 18:18:56 UTC
When playing with Windows NT 4, I've made a fix to drivemap. It's committed upstream now.

Comment 15 Mads Kiilerich 2012-06-12 13:01:06 UTC
This fix can be tested with an unofficial scratch build with a snapshot from bzr: grub2-2.0-0.37.beta6.4462.fc17 at http://koji.fedoraproject.org/koji/taskinfo?taskID=4152623 - please report back.

Comment 16 Flóki Pálsson 2012-12-23 20:41:28 UTC
Works now in F18.
works in ubuntu 12.10

does not work fore me in F17.



Fedora F18
menuentry 'Windows 8 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-18BA7078BA70546A' {
	insmod part_msdos
	insmod ntfs
	set root='hd0,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  18BA7078BA70546A
	else
	  search --no-floppy --fs-uuid --set=root 18BA7078BA70546A
	fi
	drivemap -s (hd0) ${root}
	chainloader +1
}

does not work
Fedora F17   
menuentry 'Windows 8 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-18BA7078BA70546A' {
	insmod part_msdos
	insmod ntfs
	set root='hd2,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd2,msdos1'  18BA7078BA70546A
	else
	  search --no-floppy --fs-uuid --set=root 18BA7078BA70546A
	fi
	drivemap -s (hd0) ${root}
	chainloader +1

umbuntu 12.10
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 8 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-18BA7078BA70546A' {
	insmod part_msdos
	insmod ntfs
	set root='hd0,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  18BA7078BA70546A
	else
	  search --no-floppy --fs-uuid --set=root 18BA7078BA70546A
	fi
	drivemap -s (hd0) ${root}
	chainloader +1

From F14 then this works
title Windows
rootnoverify (hd1,0)
chainloader +1


Note You need to log in before you can comment on or make changes to this bug.