 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

20th October 2012, 01:27 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Location: Grenoble
Posts: 12

|
|
|
Cannot boot to Win7
Dear Fedoraforum's users!
Initially I had win7 on my laptop.
I have formatted one partition (sdb2) with no data on it from ntfs to ext4 to install Fedora17
After formatting and installing I cannot boot to win7 anymore.
When pick Win7 in menu I have: "Windows failed to start. A recent hardware or software change might be the cause" and offer to insert an installation disc.
In my /boot/grub2/grub.cfg file I have following lines:
menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-62082D74082D47FD' {
insmod part_gpt
insmod ntfs
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1 --hint='hd0,gpt1' 62082D74082D47FD
else
search --no-floppy --fs-uuid --set=root 62082D74082D47FD
fi
chainloader +1
}
menuentry 'Windows Recovery Environment (loader) (on /dev/sda5)' --class windows --class os $menuentry_id_option 'osprober-chain-8E7233AF72339AC3' {
insmod part_gpt
insmod ntfs
set root='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5 --hint='hd0,gpt5' 8E7233AF72339AC3
else
search --no-floppy --fs-uuid --set=root 8E7233AF72339AC3
fi
drivemap -s (hd0) ${root}
chainloader +1
}
I can mount to sda[1-5] and I do see boot files there, but I don't know how to edit grub.cfg to be able to load win7 and moreover I don't know why the current version of it does not work. Could you help me, please?
|

20th October 2012, 03:22 AM
|
 |
Registered User
|
|
Join Date: Oct 2006
Location: Singapore, 新加坡
Posts: 736

|
|
|
Re: Cannot boot to Win7
The message "Windows failed to start. A recent hardware or software change might be the cause" sounds like an error message from Windows BCD (Boot Record Data) instead of from Grub2. I had a similar issue with Win7 when I was adding a third OS (Mac OSX) into my already dual-boot system (Fedora & Win7). If I recall correctly I resolved the issue by using the Win7 installation disc and choose the System Recovery Option > Command Prompt. In the command prompt, invoke the Bootrec.exe to rebuild the BCD. Leave the MBR alone cause there is where Grub2 resides. See this link.
__________________
YaoWT - Leave no window unbroken ^_^
|

20th October 2012, 03:38 AM
|
|
Registered User
|
|
Join Date: May 2012
Location: brazil
Posts: 12

|
|
|
Re: Cannot boot to Win7
make a experiment
delete all lines
put after
setroot=hd0, 1
|

22nd October 2012, 05:02 PM
|
|
Registered User
|
|
Join Date: Oct 2012
Location: Grenoble
Posts: 12

|
|
|
Re: Cannot boot to Win7
Quote:
|
The message "Windows failed to start. A recent hardware or software change might be the cause" sounds like an error message from Windows BCD (Boot Record Data) instead of from Grub2. I had a similar issue with Win7 when I was adding a third OS (Mac OSX) into my already dual-boot system (Fedora & Win7). If I recall correctly I resolved the issue by using the Win7 installation disc and choose the System Recovery Option > Command Prompt. In the command prompt, invoke the Bootrec.exe to rebuild the BCD. Leave the MBR alone cause there is where Grub2 resides. See this link.
|
I tried this, but unfortunately repair and rebuild bcd gave nothing.
Indeed initially in grub.cfg it found win7 loader on sda1, but os-prober found it on sda3.
May be you have another idea?
Quote:
make a experiment
delete all lines
put after
setroot=hd0, 1
|
Thanks for advice, but I'm not so strong in operating systems to make expetiments 
---------- Post added at 04:02 PM ---------- Previous post was at 03:58 PM ----------
And of course, I tried to change sda1 to sda3 in grub.cfg, but it did not help.
|

22nd October 2012, 05:28 PM
|
 |
Registered User
|
|
Join Date: Oct 2006
Location: Singapore, 新加坡
Posts: 736

|
|
|
Re: Cannot boot to Win7
This is strange. If your grub entry is wrong and pointing to a wrong partition in your disk then your system should not get the MS Windows specific error message as in your original post. Show the output of these two commands.
# lsblk
# os-prober
In case you don't know, you can also request grub2 to renenerate all the menu entries for you using this.
# grub2-mkconfig -o /tmp/grub.cfg
Compare the output with your current grub.cfg in /boot/grub2/grub.cfg to see if Win7 menu entry is pointing to a same GPT partition. If they are the same and consistent with the output of the two unix commands above then in my opinion the issue lies with Windows BCD.
__________________
YaoWT - Leave no window unbroken ^_^
|

23rd October 2012, 08:13 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Location: Grenoble
Posts: 12

|
|
|
Re: Cannot boot to Win7
Quote:
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 698.7G 0 disk
├─sda1 8:1 0 200M 0 part
├─sda2 8:2 0 128M 0 part
├─sda3 8:3 0 279.5G 0 part
├─sda4 8:4 0 394.5G 0 part
└─sda5 8:5 0 24.4G 0 part
sdb 8:16 0 698.7G 0 disk
├─sdb1 8:17 0 349.3G 0 part
├─sdb2 8:18 0 1K 0 part
└─sdb5 8:21 0 349.3G 0 part /
sr0 11:0 1 1024M 0 rom
|
Quote:
# os-prober
No volume groups found
/dev/sda3:Windows 7 (loader):Windows:chain
/dev/sda5:Windows Recovery Environment (loader):Windows1:chain
|
And new grub2.cfg file point to sda3 for win7.
But in sda1 I also have bootloader for windows. Could it be a conflict somewhere?
Quote:
# mount /dev/sda1 /mnt/
[root@Dragon pepe]# ls /mnt/
EFI
[root@Dragon pepe]# ls /mnt/EFI/
ASUS Boot Microsoft
[root@Dragon pepe]# ls /mnt/EFI/Boot/
bootx64.efi
|
Anyway I'll try to rebuildBCD with another win installer, may be it will help.
|

23rd October 2012, 10:21 AM
|
 |
Registered User
|
|
Join Date: Oct 2006
Location: Singapore, 新加坡
Posts: 736

|
|
|
Re: Cannot boot to Win7
The 200 MB sda1 looks like an ESP (EFI System Partition). That is not your Windows boot partition. The sda3 is more plausible.
On the other hand I am wondering how do you boot into Fedora? It does not appear in your grub2 menu entry and also in output of os-prober. You said you install F17 in sdb2(?). I believe it should be sdb5 instead.
Sorry for not able to help you much there.
__________________
YaoWT - Leave no window unbroken ^_^
|

23rd October 2012, 01:37 PM
|
|
Registered User
|
|
Join Date: Oct 2012
Location: Grenoble
Posts: 12

|
|
|
Re: Cannot boot to Win7
Quote:
|
On the other hand I am wondering how do you boot into Fedora? It does not appear in your grub2 menu entry and also in output of os-prober. You said you install F17 in sdb2(?). I believe it should be sdb5 instead.
|
Yes, probably I was wrong.
Rebuilding BCD doesn't help. But now, when I'm trying to boot to win7, first I have nice window image from win7 and just after - the message "welcome to grub2".
Quote:
|
Sorry for not able to help you much there.
|
Thanks for attempts
|

23rd October 2012, 02:55 PM
|
 |
Registered User
|
|
Join Date: Oct 2006
Location: Singapore, 新加坡
Posts: 736

|
|
|
Re: Cannot boot to Win7
Interesting outcome! By "just after", do you mean to say after win7 splash then message shows?
Also does your system uses UEFI boot mode or the legacy BIOS mode? BTW, you haven't answered my previous question on how do you boot into Fedora. Do you change the firmware boot disk order between sda and sdb in order to boot to Fedora? Where your grub2 bootloader is being installed (sda or sdb)? Sorry again for asking so many questions because up until now I am still unclear of your dual-boot setup.
__________________
YaoWT - Leave no window unbroken ^_^
|

23rd October 2012, 03:10 PM
|
|
Registered User
|
|
Join Date: Oct 2012
Location: Grenoble
Posts: 12

|
|
|
Re: Cannot boot to Win7
Quote:
|
Interesting outcome! By "just after", do you mean to say after win7 splash then message shows?
|
Exactly. I have "Starting Windows" picture and then forwarded to grub2.
Quote:
|
Also does your system uses UEFI boot mode or the legacy BIOS mode?
|
UEFI is set to disabled.
Quote:
|
BTW, you haven't answered my previous question on how do you boot into Fedora. Do you change the firmware boot disk order between sda and sdb in order to boot to Fedora?
|
Yes, sorry, after welcome to grub2 I have fedora menu entry as it is in the grub.cfg. Fedora is set as default, so even if I'm not picking anything, Fedora starts.
Quote:
|
Where your grub2 bootloader is being installed (sda or sdb)?
|
It is on sdb.
|

23rd October 2012, 03:54 PM
|
 |
Registered User
|
|
Join Date: Oct 2006
Location: Singapore, 新加坡
Posts: 736

|
|
|
Re: Cannot boot to Win7
If you are not using UEFI boot then you really do not need the ESP, but that's not the root cause of your problem.
I would say now at least you have moved on from the original issue (BCD error message) that you described in the first post. That is, when Win7 is selected in the menu entry then grub2 bootloader has successfully passed the baton to the Windows side to start its process. Unfortunately something is still wrong and resulting in a PC reboot and you are being welcomed back by Grub2 again  Well, this is what I think has happened, I could be wrong.
I have not played with booting from more than one disk in a while. My current triple-boot setup uses just one SSD, so I do not have to worry about grub2's parttool to change the boot flag of a partition to make it active.
Before you install F17 on sdb, does your Win7 always boot from sdb? Or it was actually boot from sda earlier? Can you also attach your latest grub.cfg in the post?
__________________
YaoWT - Leave no window unbroken ^_^
|

23rd October 2012, 04:06 PM
|
|
Registered User
|
|
Join Date: Oct 2012
Location: Grenoble
Posts: 12

|
|
|
Re: Cannot boot to Win7
Quote:
|
If you are not using UEFI boot then you really do not need the ESP, but that's not the root cause of your problem.
|
I've tried both variants, but result was the same.
Quote:
|
I would say now at least you have moved on from the original issue (BCD error message) that you described in the first post.
|
Actually, no. Splash of win7 occurs when I say BIOS to load windows boot manager. But if I pick up win7 in the grub menuentry - it still provides the same error.
Quote:
|
Before you install F17 on sdb, does your Win7 always boot from sdb? Or it was actually boot from sda earlier?
|
Always from sda, sdb was totally empty according to win7.
Quote:
|
Can you also attach your latest grub.cfg in the post?
|
Here it is.
Quote:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="${saved_entry}"
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd1,msdos5' d41791df-d2e1-4a36-9b98-b3580d52badd
else
search --no-floppy --fs-uuid --set=root d41791df-d2e1-4a36-9b98-b3580d52badd
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
set timeout=5
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Fedora Linux' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-d41791df-d2e1-4a36-9b98-b3580d52badd' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd1,msdos5' d41791df-d2e1-4a36-9b98-b3580d52badd
else
search --no-floppy --fs-uuid --set=root d41791df-d2e1-4a36-9b98-b3580d52badd
fi
echo 'Loading Linux 3.3.4-5.fc17.x86_64 ...'
linux /boot/vmlinuz-3.3.4-5.fc17.x86_64 root=UUID=d41791df-d2e1-4a36-9b98-b3580d52badd ro rd.md=0 rd.lvm=0 rd.dm=0 SYSFONT=True rd.luks=0 KEYTABLE=ru LANG=en_US.UTF-8 rhgb quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-3.3.4-5.fc17.x86_64.img
}
submenu 'Advanced options for Fedora Linux' $menuentry_id_option 'gnulinux-advanced-d41791df-d2e1-4a36-9b98-b3580d52badd' {
menuentry 'Fedora Linux, with Linux 3.3.4-5.fc17.x86_64' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.3.4-5.fc17.x86_64-advanced-d41791df-d2e1-4a36-9b98-b3580d52badd' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd1,msdos5' d41791df-d2e1-4a36-9b98-b3580d52badd
else
search --no-floppy --fs-uuid --set=root d41791df-d2e1-4a36-9b98-b3580d52badd
fi
echo 'Loading Linux 3.3.4-5.fc17.x86_64 ...'
linux /boot/vmlinuz-3.3.4-5.fc17.x86_64 root=UUID=d41791df-d2e1-4a36-9b98-b3580d52badd ro rd.md=0 rd.lvm=0 rd.dm=0 SYSFONT=True rd.luks=0 KEYTABLE=ru LANG=en_US.UTF-8 rhgb quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-3.3.4-5.fc17.x86_64.img
}
menuentry 'Fedora Linux, with Linux 3.3.4-5.fc17.x86_64 (recovery mode)' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.3.4-5.fc17.x86_64-recovery-d41791df-d2e1-4a36-9b98-b3580d52badd' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5 --hint='hd1,msdos5' d41791df-d2e1-4a36-9b98-b3580d52badd
else
search --no-floppy --fs-uuid --set=root d41791df-d2e1-4a36-9b98-b3580d52badd
fi
echo 'Loading Linux 3.3.4-5.fc17.x86_64 ...'
linux /boot/vmlinuz-3.3.4-5.fc17.x86_64 root=UUID=d41791df-d2e1-4a36-9b98-b3580d52badd ro single rd.md=0 rd.lvm=0 rd.dm=0 SYSFONT=True rd.luks=0 KEYTABLE=ru LANG=en_US.UTF-8 rhgb quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-3.3.4-5.fc17.x86_64.img
}
}
if [ "x$default" = 'Fedora Linux, with Linux 3.3.4-5.fc17.x86_64' ]; then default='Advanced options for Fedora Linux>Fedora Linux, with Linux 3.3.4-5.fc17.x86_64'; fi;
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (loader) (on /dev/sda3)' --class windows --class os $menuentry_id_option 'osprober-chain-62082D74082D47FD' {
insmod part_gpt
insmod ntfs
set root='hd0,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 --hint='hd0,gpt3' 62082D74082D47FD
else
search --no-floppy --fs-uuid --set=root 62082D74082D47FD
fi
chainloader +1
}
menuentry 'Windows Recovery Environment (loader) (on /dev/sda5)' --class windows --class os $menuentry_id_option 'osprober-chain-8E7233AF72339AC3' {
insmod part_gpt
insmod ntfs
set root='hd0,gpt5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt5 --hint-efi=hd0,gpt5 --hint-baremetal=ahci0,gpt5 --hint='hd0,gpt5' 8E7233AF72339AC3
else
search --no-floppy --fs-uuid --set=root 8E7233AF72339AC3
fi
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.d/30_os-prober ###
### 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.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
|
|

23rd October 2012, 04:55 PM
|
 |
Administrator
|
|
Join Date: Aug 2009
Posts: 6,612

|
|
|
Re: Cannot boot to Win7
Well, one thing you may be running in to..
Windows can not boot as a BIOS boot system from a gpt partitioned drive. You have to use uEFI to boot Windows from that drive.
That could be the issue. You installed Fedora (and grub2) as a BIOS boot system, and Windows has to be a uEFI booted system on a gpt partitioned drive..
|

23rd October 2012, 05:01 PM
|
|
Registered User
|
|
Join Date: Oct 2012
Location: Grenoble
Posts: 12

|
|
|
Re: Cannot boot to Win7
Quote:
Originally Posted by DBelton
Well, one thing you may be running in to..
Windows can not boot as a BIOS boot system from a gpt partitioned drive. You have to use uEFI to boot Windows from that drive.
That could be the issue. You installed Fedora (and grub2) as a BIOS boot system, and Windows has to be a uEFI booted system on a gpt partitioned drive..
|
Yes, but I've tried everything in both (enabled or disabled UEFI) modes. And result is the same.
|

23rd October 2012, 05:15 PM
|
 |
Registered User
|
|
Join Date: Oct 2006
Location: Singapore, 新加坡
Posts: 736

|
|
|
Re: Cannot boot to Win7
Quote:
|
Actually, no. Splash of win7 occurs when I say BIOS to load windows boot manager. But if I pick up win7 in the grub menuentry - it still provides the same error.
|
I see. To avoid future misunderstanding, can you inform in the post clearly if you have changed the settings.
I see two possibilities that could be the cause of your problem. I cannot rule them out as you have not provided the info.
1. If prior to installing F17, your Win7 boots from sda using UEFI mode (possible as you have ESP in sda1) and then subsequently during F17 installation to sdb apprently you change to boot using legacy BIOS mode. Should you use UEFI to install F17 then you would get older version of grub installed instead of grub2. If this is the case then there is no easy solution to your problem. In a nutshell, you cannot use BIOS mode to boot into Win7 which has been installed using UEFI mode before. No matter how you change grub2 entry, it would not work because the problem is not with grub2.
However, if your system always use legacy BIOS before and after F17 installation then it could be:
2. Win7 still expects sda to be the boot disk which is not true anymore. For this case, there is still a possible solution by adding grub2's drivemap command to swap between sda (hd0) and sdb (hd1). Something like "drivemap -s (hd1) (hd0)" before the "chainloader +1".
---------- Post added at 12:15 AM ---------- Previous post was at 12:05 AM ----------
Quote:
Originally Posted by DBelton
Windows can not boot as a BIOS boot system from a gpt partitioned drive.
|
This is not entirely true. Legacy BIOS mode can use GPT partitioned drive as well as MSDOS partitioned drive. At least the BIOS + GPT combo works on my system. The real issue lies with Windows BCD which is being installed and prepared differently for UEFI and BIOS mode.
Oh, but I forget to add that my GPT is a hybrid MBR. Now I recall that I have to do that because of stupid MS Windows. So DBelton may be correct after all  , although I must add there is a way to work around it.
__________________
YaoWT - Leave no window unbroken ^_^
Last edited by weitjong; 23rd October 2012 at 05:37 PM.
Reason: additional comment
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 18:07 (Wednesday, 22-05-2013)
|
|
 |
 |
 |
 |
|
|