Bug 1619042

Summary: grub2 efi mismatch in hd enumeration between disk and partition
Product: [Fedora] Fedora Reporter: Martin <martinrsssf>
Component: grub2Assignee: Peter Jones <pjones>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: lkundrak, pjones
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-21 03:25:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin 2018-08-19 20:54:41 UTC
Description of problem:
Running Fedora 27 x86_64 on Macbook Pro with 2 disks, Linux EFI boot and root partitions in 2nd disk, OSX partition in first disk.

grub2-mkconfig generates partition root references based on enumeration of disks starting with 0 (e.g. hd0, hd1, etc.) but grub2 using efi gpt (possibly installed from anaconda) uses the partition reference with disk number from 1 (hd1,gpt1, hd1,gpt2, etc.)

Version-Release number of selected component (if applicable):
grub2-tools-efi-2.02-22.fc27.x86_64
grub2-tools-2.02-22.fc27.x86_64
anaconda and grub2 from stock installer

How reproducible:
Always

Steps to Reproduce:
1. run grub2-mkconfig -o /boot/efi/EFI/fedora/grub2.cfg
2. systemctl reboot
3. in grub2 menu, choose Mac OSX entry that contains 'set root=hd0,gpt3', press Enter

Actual results:
error: disk 'hd0,gpt3' not found
error: you need to load the kernel first

Expected results:
Boot OSX normally

Additional info:

At the grub menu, press 'c' to enter grub command line, and type 'ls'.
It lists the following: (hd0) (hd1) (hd1,gpt3) (hd1,gpt2) (hd1,gpt1) (hd2) (hd2,gpt8) (hd2,gpt7) ...
This shows 3 disks, hd0, hd1, hd2, even though there is no 3rd disk, and no partition is listed for hd0. All partitions show hd1 as first disk and hd2 as second disk.

The Linux that is in the second disk (hd1,gpt6) boots fine, but OSX that is in first disk (hd0,gpt3) does not.

When I modify to boot (hd1,gpt3), it does boot OSX fine!

So somehow grub2 boot image installed from anaconda is confusing (hd1,gpt3) as first disk partition 3 rather than second disk partition 3, or somehow hd0 is skipped as no partition.

Comment 1 Martin 2018-08-21 03:25:04 UTC
Upon checking other bugs, I find that bug#1524685 is basically the same, with more detail than what I reported.

I am self-closing this bug as duplicate.

*** This bug has been marked as a duplicate of bug 1524685 ***