grub2 menuentry for Windows 10

asked 2015-09-19 20:20:14 -0600

mgte gravatar image

Saga: Fedora 22 on one drive and Windows 10 on another:


(From parted:) Model: ATA Samsung SSD 840 (scsi) Disk /dev/sda: 256GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags:

Number Start End Size File system Name Flags 1 1049kB 211MB 210MB fat16 EFI System Partition boot, esp 2 211MB 735MB 524MB ext4 3 735MB 256GB 255GB lvm

Model: ATA Samsung SSD 840 (scsi) Disk /dev/sdb: 256GB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags:

Number Start End Size Type File system Flags 1 1049kB 368MB 367MB primary ntfs boot 2 368MB 256GB 255GB primary ntfs 3 256GB 256GB 472MB primary ntfs diag

(from fdisk -l :)
Disk /dev/sda: 238.5 GiB, 256060514304 bytes, 500118192 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
Disklabel type: gpt
Disk identifier: BD7A8230-FB90-4746-9934-07EB48D946BC

Device Start End Sectors Size Type
/dev/sda1 2048 411647 409600 200M EFI System
/dev/sda2 411648 1435647 1024000 500M Linux filesystem
/dev/sda3 1435648 500117503 498681856 237.8G Linux LVM

Disk /dev/sdb: 238.5 GiB, 256060514304 bytes, 500118192 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
Disklabel type: dos
Disk identifier: 0xee3edc6f

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 718847 716800 350M 7 HPFS/NTFS/exFAT
/dev/sdb2 718848 499193855 498475008 237.7G 7 HPFS/NTFS/exFAT
/dev/sdb3 499193856 500115455 921600 450M 27 Hidden NTFS WinRE


Modified /etc/grub.d/40_custom several times. Most recent:

#!/bin/sh exec tail -n +3 $0 # 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 10' {
set root='(hd1,msdos1)'
chainloader +1
}

running grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

grub.cfg gets updated and when I reboot, the Windows 10 menu item appears. However, when I select the item, the system immediately returns with

ERROR: INVALID SECTOR SIZE 65535 ERROR: YOU NEED TO LOAD THE KERNEL FIRST

If I select the Windows drive in the UEFI BIOS (Asus Z97) the system boots fine to Windows, so I am assuming the logical structure of the drive (sdb) is fine. So I am guessing my menuentry for grub2 is incorrect.

Any suggestions?

Thanks!

mgte

edit retag flag offensive close merge delete

Comments

grub2-mkconfig should detect your windows installation and create a menu entry for it. You could use that as an example for your custom menu entry.

randomuser gravatar imagerandomuser ( 2015-09-21 17:37:27 -0600 )edit

@randomuser I just tried it, unless I'm missing anything it just detects and creates the linux entries, didn't add the windows entry despite I do have Windows 10 installed

Juan Alpizar gravatar imageJuan Alpizar ( 2015-12-23 12:56:42 -0600 )edit