PDA

View Full Version : [SOLVED] Boot Windows 10 in Legacy Mode



mac25
9th September 2017, 05:55 AM
Hello,

I installed Fedora 26 from USB on a laptop winth Windows 10 already installed (I assume in UEFI Mode) after disabling UEFI from the BIOS menu and booting in Legacy Mode.
I followed the instructions and installed GRUB2.
After I rebboted into Fedora, I edited /etc/grub.d/40_custom to include the following entry:

menuentry "Windows 10" --class windows --class os {
insmod ntfs
search --no-floppy --set=root --fs-uuid 5E64165E6416396B
ntldr /bootmgr
}

When I reboot, Windows 10 appears in the GRUB menu but when I choose it I get this error message:

file /bootmgr not found

How should I proceed to boot Windows 10 with GRUB?

I include the following information, hoping it would be helpful.

[root@localhost ludwi]# blkid
/dev/sda1: LABEL="Recovery" UUID="82A010E5A010E209" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="21560c0d-bec2-4940-8695-dfd575b09bc5"
/dev/sda2: LABEL="ESP" UUID="4613-32A2" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="9307e321-d914-444a-ba4a-786b2971e00f"
/dev/sda3: PARTLABEL="Microsoft reserved partition" PARTUUID="aab1b645-4bf3-4c0f-8941-7d1a74e34f72"
/dev/sda4: LABEL="Acer" UUID="5E64165E6416396B" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="0ef70ce3-a366-4e8b-8b9a-c4d3fa045522"
/dev/sda5: UUID="28E43024E42FF2AC" TYPE="ntfs" PARTUUID="2bd32c2e-e565-4879-9908-f8e1cf7ba405"
/dev/sda6: LABEL="Push Button Reset" UUID="BAE017E9E017AB21" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="7123f5e4-d184-49b4-a530-23b8dafb5074"
/dev/sda7: PARTUUID="71a3b5d3-5d7a-4739-b3ed-ad4f2e3cc2c0"
/dev/sda8: UUID="1f7c43a8-6acf-49e8-86be-6fc6b0ac070b" TYPE="ext4" PARTUUID="deac5fe6-8e9d-4a8b-8c9c-cd560a7a8368"
/dev/sda9: UUID="6J5AeI-5HyF-zX5f-9rKb-UMvZ-WJPc-UuNVHk" TYPE="LVM2_member" PARTUUID="6e1666b0-cf59-464a-b454-cbbcdf45f511"
/dev/mapper/fedora-root: UUID="93c37e22-5801-47a3-b65d-41be7871bcb3" TYPE="ext4"
/dev/mapper/fedora-swap: UUID="67ec3c10-daaf-4683-a87d-1848cec10521" TYPE="swap"

[root@localhost ludwi]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 400M 0 part
├─sda2 8:2 0 300M 0 part
├─sda3 8:3 0 128M 0 part
├─sda4 8:4 0 399.6G 0 part
├─sda5 8:5 0 505M 0 part
├─sda6 8:6 0 16G 0 part
├─sda7 8:7 0 1M 0 part
├─sda8 8:8 0 1G 0 part /boot
└─sda9 8:9 0 47.8G 0 part
├─fedora-root 253:0 0 44.2G 0 lvm /
└─fedora-swap 253:1 0 3.7G 0 lvm [SWAP]
sr0 11:0 1 1024M 0 rom

[root@localhost ludwi]# grep -i efi /etc/fstab

[root@localhost ludwi]# gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): FE40836B-4D02-4FDE-8E2C-DA8848377A53
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2633 sectors (1.3 MiB)

Number Start (sector) End (sector) Size Code Name
1 2048 821247 400.0 MiB 2700 Basic data partition
2 821248 1435647 300.0 MiB EF00 EFI System Partition
3 1435648 1697791 128.0 MiB 0C01 Microsoft reserved ...
4 1697792 839783843 399.6 GiB 0700 Basic data partition
5 942184448 943218687 505.0 MiB 2700
6 943218688 976773119 16.0 GiB 2700 Basic data partition
7 839784448 839786495 1024.0 KiB EF02
8 839786496 841883647 1024.0 MiB 8300
9 841883648 942184447 47.8 GiB 8E00

[root@localhost ludwi]# ls -l /boot/efi/EFI
total 8
drwxr-xr-x. 2 root root 4096 Jul 5 18:21 BOOT
drwxr-xr-x. 4 root root 4096 Sep 8 19:59 fedora
[root@localhost ludwi]#


[root@localhost ludwi]# grep -i efi /etc/fstab
[root@localhost ludwi]#

owl102
9th September 2017, 12:19 PM
I installed Fedora 26 from USB on a laptop winth Windows 10 already installed (I assume in UEFI Mode) after disabling UEFI from the BIOS menu and booting in Legacy Mode.
I followed the instructions and installed GRUB2.
After I rebboted into Fedora, I edited /etc/grub.d/40_custom to include the following entry:

menuentry "Windows 10" --class windows --class os {
insmod ntfs
search --no-floppy --set=root --fs-uuid 5E64165E6416396B
ntldr /bootmgr
}

When I reboot, Windows 10 appears in the GRUB menu but when I choose it I get this error message:

file /bootmgr not found

How should I proceed to boot Windows 10 with GRUB?
If Windows is installed in UEFI mode, it's bound to UEFI and GPT partitioning. If Windows is installed in Legacy/CSM mode, it's bound to Legacy/CSM and MBR partitioning.

So in short, you cannot. If Windows is installed in UEFI mode, you have to boot it in UEFI mode, by either using the UEFI boot manager your PC offers, or by using a boot manager (like Grub) installed in UEFI mode.

As result, if you do not want to use the UEFI boot manager of your PC but Grub instead to offer a Windows boot parallel to Fedora boot, you have to install Fedora in UEFI mode as well.

TruboXL
9th September 2017, 03:11 PM
I don't think you need to fiddle around with anything at all, GRUB should pick up Windows, assuming you don't do very custom configs on your system...

Can you post this? Just to check Fedora is running on UEFI or BIOS...
(from https://fedoraproject.org/wiki/Unified_Extensible_Firmware_Interface)

$ ls /sys/firmware/efi

mac25
9th September 2017, 06:59 PM
ls /sys/firmware/efi

gives - no such file or directory

I didn't touch anything in the configuration besides adding the Windows entry in Grub custom 40.
To boot both Windows and Fedora in UEFI mode do I have to reinstall Fedora completely or can I just reinstall Grub in the efi?

mac25
9th September 2017, 07:05 PM
ls /sys/firmware/efi

gives - no such file or directory

I didn't touch anything in the configuration besides adding the Windows entry in Grub custom 40.
To boot both Windows and Fedora in UEFI mode do I have to reinstall Fedora completely or can I just reinstall Grub in the efi?

Doug G
9th September 2017, 07:48 PM
This wiki page https://fedoraproject.org/wiki/Unified_Extensible_Firmware_Interface seems to say you should reinstall fedora. I've set up a few dual-boot with windows 10 and secure boot, the only trick was to start the fedora live usb or installer with uefi/secure boot enabled in the computer. After installation, grub2 is set up to properly boot in secure boot mode, windows remains untouched, and you can also skip grub and use the UEFI boot manager to select which OS you want to boot if you want. For example, on my Dell machines hit F12 to bring up the bios boot manager and simply select the desired OS. grub doesn't appear at all if you choose windows boot here.

mac25
10th September 2017, 02:42 AM
I tried installing Fedora booting in UEFI mode, but it would repeatedly crash during the install as described in this post:

https://www.forums.fedoraforum.org/showthread.php?t=315405

I was finally able to install Fedora only by booting with UEFI disabled, but then Windows 10 would not boot from Grub.
Now I wiped the partitions created by Fedora during the install and Windows boots again normally in UEFI mode, but i need to make sure on how to proceed before go through the install once again.

TruboXL
10th September 2017, 06:11 AM
either you can

1. troubleshoot fedora 26 installation crash
running the installer side by side with a terminal running

$ journalctl -f
and ultimately lead to the cause, hopefully...

or

2. change your edits to


menuentry "Windows 10" --class windows --class os {
insmod fat
search --no-floppy --set=root --fs-uuid 4613-32A2
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

fingers crossed...

mac25
12th September 2017, 06:07 PM
Reinstalled Fedora booting in UEFI mode and this time Fedora installed without a hitch.
I only had to access the BIOS and select Fedora as the boot option and Windows was there in the Grub menu.
UFFFFF!

Thanks for your help.

antikythera
13th September 2017, 04:37 PM
if at some point windows won't boot from GRUB and comes up with a broken chainloader message, here are some options.

exit grub by pressing C to access the command prompt. then type exit. windows will load.

alternatively install a better bootloader called rEFInd (http://www.rodsbooks.com/refind/). it remembers the last booted operating system and defaults to that with a countdown timer. so if you want to get back into windows for example after applying updates, you don't have the danger of the notebook booting into fedora if you are away from keyboard when it restarts after installing updates. and vice versa, restart fedora and it will present you with fedora next time first. rEFInd comes in handier still when you have 5 or 6 different OS installed.

dd_wizard
13th September 2017, 08:25 PM
A big thumbs up to refind. It helps to be comfortable with working in a terminal window when setting refind up. But, you will quickly appreciate the improvement over grub2. Refind builds it boot menu at boot time, so you can power the system off, plugin a USB HDD or thumb drive, power up, and refind will offer to boot from the new device. Provided it contains a bootable OS, that is. :)

dd_wizard