bugGNU GRUB - Bugs: bug #64304, grub interprets Apple file system...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #64304: grub interprets Apple file system (APFS) wrongly and goes into interactive mode

Submitter:  Vincent S. Cojot <elcoyote_>
Submitted:  Thu 15 Jun 2023 12:33:36 PM UTC
   
 
Category:  Filesystem Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  None Privacy:  Public
Assigned to:  None Originator Name:  Vincent Cojot
Open/Closed:  Open Release:  2.02
Release:  Reproducibility:  Every Time
Planned Release:  None

Thu 15 Jun 2023 12:34:50 PM UTC, comment #1: 

At this point, if I 'sgdisk -Z /dev/sda', then OpenShift's GRUB no longer complains and boot proceeds normally without user interaction.

Can someone please see if GRUB can be repaired so that unknown data no longer tricks it into thinking it has many more disks than there actually are in the machine?

[root@neraka ~]# efibootmgr -v
BootCurrent: 0000
BootOrder: 0000,0001
Boot0000* Red Hat Enterprise Linux HD(2,GPT,d36bfc93-9920-4346-9c56-bd7c57bdb0bb,0x1000,0x3f800)/File(\EFI\redhat\shimx64.efi)
Boot0001* rEFInd Boot Manager PciRoot(0x0)/Pci(0x1c,0x4)/Pci(0x0,0x0)/Pci(0x2,0x0)/Pci(0x0,0x0)/Sata(0,0,0)/HD(1,GPT,403d1eeb-03d6-4a97-940b-034d7b8c5950,0x28,0x64000)/File(\EFI\refind\refind_x64.efi)..
Boot0080* Mac OS X PciRoot(0x0)/Pci(0x1c,0x4)/Pci(0x0,0x0)/Pci(0x2,0x0)/Pci(0x0,0x0)/Sata(0,0,0)/HD(2,GPT,47056646-5996-469c-b7c5-269e306d85f1,0x64028,0x1dd16500)/VenMedia(be74fcf7-0b7c-49f3-9147-01f4042e6842,f7d858ec229b9242b3ba7d0677ff2f50)/File(\D65D8AEE-85B7-4276-8E6D-2198B0B8A76E\System\Library\CoreServices\boot.efi)
Boot0081* Mac OS X Ata(0,1,0)/HD(2,GPT,9cbd5a47-e8e6-44ad-83b2-14ab83db3b2d,0x64028,0x55b7c0)

Vincent S. Cojot <elcoyote_>
Thu 15 Jun 2023 12:33:36 PM UTC, original submission:  

Copied from https://bugzilla.redhat.com/show_bug.cgi?id=1524685

I am testing SNO 4.12 (based on RHEL 8.6) on a Mac Pro x86_64 machine.
The machine has 3 SSDs which are as follows:

/dev/sda (Apple SSD)
/dev/nvme0n1 (TopoLVM - RedHat LVM storage Operator)
/dev/nvme1n1 (OCP SNO 4.12.19)

everything works fine and I can reboot/switch from OCP to MacOS with efibootmgr:

[root@neraka ~]# efibootmgr
BootCurrent: 0000
BootOrder: 0000,0001
Boot0000* Red Hat Enterprise Linux
Boot0001* rEFInd Boot Manager
Boot0080* Mac OS X
Boot0081* Mac OS X

Here's the disk config:
[root@neraka ~]# lsblk   
NAME                           MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                              8:0    0 931.9G  0 disk
|-sda1                           8:1    0   200M  0 part
|-sda2                           8:2    0 238.6G  0 part
`-sda3                           8:3    0   693G  0 part
sr0                             11:0    1  1024M  0 rom 
nvme0n1                        259:0    0   1.8T  0 disk
|-datavg-thin--pool--1_tmeta   253:0    0   840M  0 lvm 
| `-datavg-thin--pool--1-tpool 253:2    0   1.7T  0 lvm 
|   |-datavg-thin--pool--1     253:3    0   1.7T  1 lvm 
|   |-datavg-af11ef7c--d568--42a3--830c--6d7e2102bd15
|   |                          253:4    0    40G  0 lvm  /var/lib/kubelet/pods/7c785320-a7a6-4765-8f5b-671d3d33baeb/volume-subpaths/pvc-ecdeed7a-78ca-
|   `-datavg-bdfefdc5--ba97--40ce--84b3--81d31a4ec402
|                              253:5    0    10G  0 lvm  /var/lib/kubelet/pods/b56bb23f-22c3-41f3-a208-9638747ac29e/volume-subpaths/pvc-e1a0d307-92cf-
`-datavg-thin--pool--1_tdata   253:1    0   1.7T  0 lvm 
  `-datavg-thin--pool--1-tpool 253:2    0   1.7T  0 lvm 
    |-datavg-thin--pool--1     253:3    0   1.7T  1 lvm 
    |-datavg-af11ef7c--d568--42a3--830c--6d7e2102bd15
    |                          253:4    0    40G  0 lvm  /var/lib/kubelet/pods/7c785320-a7a6-4765-8f5b-671d3d33baeb/volume-subpaths/pvc-ecdeed7a-78ca-
    `-datavg-bdfefdc5--ba97--40ce--84b3--81d31a4ec402
                               253:5    0    10G  0 lvm  /var/lib/kubelet/pods/b56bb23f-22c3-41f3-a208-9638747ac29e/volume-subpaths/pvc-e1a0d307-92cf-
nvme1n1                        259:1    0 931.5G  0 disk
|-nvme1n1p1                    259:2    0     1M  0 part
|-nvme1n1p2                    259:3    0   127M  0 part
|-nvme1n1p3                    259:4    0   384M  0 part /boot
`-nvme1n1p4                    259:5    0   931G  0 part /sysroot

The -PROBLEM- is that unless I 'wipe' /dev/sda and MacOS, GRUB from /dev/nvme1n1p2 (OCP 4.12) barfs on the APFS partition on /dev/sda and goes into interactive mode:

error: ../../grub-core/disk/eft/efidisk.c:612: fatture reading sector @x1dd164f0 from "hd0".
error: ../../grub-core/disk/eft/eftdisk.c:612: failure reading sector @x1dd16480 from "hd0".
error: ../../grub-core/disk/eft/efidisk.c:612: failure reading sector @x1dd164f0 from "hd1".
error: ../../grub-core/disk/eft/eftdisk.c:612: failure reading sector @x1dd16480 from "hd1".
error: ../../grub-core/disk/eft/efidisk.c:612: failure reading sector @x1dd164f0 from "hd2".
error: ../../grub-core/disk/eft/eftdisk.c:612: failure reading sector @x1dd16480 from "hd2".
error: ../../grub-core/disk/eft/efidisk.c:612: failure reading sector @x1dd164f0 from "hd3".
error: ../../grub-core/disk/eft/eftdisk.c:612: failure reading sector @x1dd16480 from "hd3".
error: ../../grub-core/disk/eft/efidisk.c:612: failure reading sector @x1dd164f0 from "hd4".
error: ../../grub-core/disk/eft/eftdisk.c:612: failure reading sector @x1dd16480 from "hd4".
error: ../../grub-core/disk/eft/efidisk.c:612: failure reading sector @x1dd164f0 from "hd5".
error: ../../grub-core/disk/eft/eftdisk.c:612: failure reading sector @x1dd16480 from "hd5".

after that, pressing 'q' resumes normal boot and the system boots fine into OCP.

I only have 3 drives in this machine, why is GRUB complaining about hd4, hd5 and the rest?

Furthermore, if I ask GRUB to enter a command shell, I see this:


grub> ls
(proc) (hd0) (hd1) (hd2) (hd3) (hd4) (hd5) (hd6) (hd6,msdos1) (hd7) (hd7, gpt3) (hd7,gpt2) (hd7, gpt1) (hd8) (hd9) (hd9, gpt4) (hd9, gpt3) (hd9, gpt2) (hd9,gpt1)
error: ../../grub-core/disk/efi/efidisk.c:612: failure reading sector 0x1dd164f0 from `hd0'.
error: ../../grub-core/disk/efi/efidisk.c:612: failure reading sector 0x1dd16480 from `hd0'.
error: ../../grub-core/disk/efi/efidisk.c:612: failure reading sector 0x1dd164f0 from `hd1'.
error: ../../grub-core/disk/efi/efidisk.c:612: failure reading sector 0x1dd16480 from `hd1'.
error: ../../grub-core/disk/efi/efidisk.c:612: failure reading sector 0x1dd164f0 from `hd2'.
error: ../../grub-core/disk/efi/efidisk.c:612;failure reading sector 0x1dd16480 from `hd2'.
error: ../../grub-core/disk/efi/efidisk.c:612: failure reading sector 0x1dd164f0 from `hd3'.
error: ../../grub-core/disk/efi/efidisk.c:612: failure reading sector 0x1dd16480 from `hd3'.
error: ../../grub-core/disk/efi/efidisk.c:612: failure reading sector 0x1dd164f0 from `hd4'.
error: ../../grub-core/disk/efi/efidisk.c:612: failure reading sector 0x1dd16480 from `hd4'.
--MORE--
 GRUB is completely confused by the Apple APFS partition on /dev/sda.
As much as I can understand/recognize that h6, h7 and hd9 must be my flash drives (they show partitions), where are hd0,hd1,hd2,hd3, hd4, hd5 and hd8 coming from?

this is what fdisk shows:

[root@neraka ~]# fdisk  -l /dev/sda
Disk /dev/sda: 931.9 GiB, 1000555581440 bytes, 1954210120 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 8394576E-EF09-4FD1-8BBE-4DF0182F5102

Device         Start        End    Sectors   Size Type
/dev/sda1         40     409639     409600   200M EFI System
/dev/sda2     409640  500671783  500262144 238.6G unknown
/dev/sda3  500671784 1953947935 1453276152   693G Apple HFS/HFS+

(This is MacOS 12.6.6 - aka Monterrey)

Vincent S. Cojot <elcoyote_>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #54842:  ocp4n_grub2b.png added by elcoyote_ (246KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by elcoyote_ (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-06-15 elcoyote_ Attached File- Added ocp4n_grub2b.png, #54842

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code