Menu

EFI boot hangs after re-partitioning IMac GPT disk

John Lumby
2019-11-09
2019-11-18
  • John Lumby

    John Lumby - 2019-11-09

    I have been happily running refind to boot my old (2008) Intel Imac for 3 years without hiccup,

    Recently I decide to re-partition my disk to add a swap partition.

    Before :
    parted /dev/sda print
    Model: ATA WDC WD10EZEX-08M (scsi)
    Disk /dev/sda: 1000GB
    Sector size (logical/physical): 512B/4096B
    Partition Table: gpt
    Disk Flags:

    Number Start End Size File system Name Flags
    1 20.5kB 210MB 210MB fat32 EFI System Partition boot, esp
    2 210MB 1000GB 1000GB ext4 MacOS

    After:
    parted /dev/sda print
    Model: ATA WDC WD10EZEX-08M (scsi)
    Disk /dev/sda: 1000GB
    Sector size (logical/physical): 512B/4096B
    Partition Table: gpt
    Disk Flags:

    Number Start End Size File system Name Flags
    1 20.5kB 210MB 210MB fat32 EFI System Partition boot, esp
    2 210MB 988GB 988GB ext4 MacOS
    3 988GB 1000GB 12.1GB linux-swap(v1)

    To achieve this I found I had to rm part 2, mkpart it with the smaller size (and then mkpart the part 3), and then reformat part 2 with mke2fs and restore from backup. All went well.
    I did not alter ESP part 1 in any way and as far as I can tell nor did parted.
    The partition name of part 2 remains "MacOS" which is what refind.conf references.

    But now, when booting the machine from powered-off, holding Option key still brings up the "EFI Boot" icon, but clicking on it results in complete freeze of the machine with that image displayed for ever, no activity and no recognition of keyboard or mouse events.

    I can boot from CD rom in BIOS mode plus grub and everything is ok, all 3 partitions appear fine, everything working.

    I did read the section in the refind doc on "Boot Coup" but I doubt that my problem fits that description. The firmware apparently is willing to boot in EFI mode but nothing happens.

    I assume refind is not like LILO in storing disk block addresses of the linux kernel (?) and needing to be rebuilt after a change.

    Can anyone suggest what is causing this and what I can do to fix it?

    Cheers, John

    P.S. Rod do you still take donations? Remind me where.

     
  • joevt

    joevt - 2019-11-09

    You don't have a macOS boot partition?

    It's not a hybrid disk with gpt and mbr partition maps?

    rEFInd should be bootable from the EFI partition since you did not change the EFI partition. Are all the refind files still there? Is the Bootx64.efi file the same size as the refind_x64.efi file?

     
    • John Lumby

      John Lumby - 2019-11-10

      The history of this setup is,
      . started with an Imac running some regular Mac OS-x
      . 2016 without making any changes to the disk partitioning : (see my "before" in prev post)
      installed refind into part 1:/EFI/BOOT
      reformatted the part 2 from HPFS (I think i9t was) to ext4 and restored an archlinux system into it
      configured refind.conf to boot my archlinux vmlinuz
      ==>> EFI boot worked out of the box to boot my archlinux
      . 2019 thinking what could possibly go wrong, did as described earlier
      parted rm part 2
      parted mkpart 2 12G smaller than before and format ext4 and restore backup
      parted mkpart 3 and mkswap as swap space
      ==>> EFI boot hangs

      So in answer to your questions,
      

      1) Yes I do have an ESP boot partition as part 1 if that's what you mean by macOS boot partition - it is partitioned the way it was under MAC OS-x , formatted as vfat (never reformatted), but I installed refind files.

      2) not sure about the terminology but gdisk -l reports
      Partition table scan:
      MBR: protective
      BSD: not present
      APM: not present
      GPT: present

      Found valid GPT with protective MBR; using GPT.
      Disk /dev/sda: 1953525168 sectors, 931.5 GiB

      3) Yes, all the refind files are still there and /boot/efi/EFI/BOOT/BOOTX64.EFI is unchanged
      -rwxr-xr-x 1 root root 234361 Sep 22 2015 /boot/efi/EFI/BOOT/BOOTX64.EFI

      The only things which have changed are the size of part2 and the addition of one more part 3.
      I am wondering if the apple firmware has some knowledge of the partition structure stored elsewhere like a control fiole or something and whatever that is now doesn't match the disk partitioning and that upsets the EFI firmware.

      Cheers, John

       
      • John Lumby

        John Lumby - 2019-11-18

        It turns out that this hang during efi boot was caused by one or other of the two partitions (EFI boot and/or ext4 MacOS containing archlinux) being marked dirty.
        fsck -f on both seems to have fixed it and refind is back in business.

         

Log in to post a comment.