



























I'll share my experience installing GRUB on HFS+. This issue hasn't been clearly discussed anywhere. Perhaps this will be helpful.
MacBook Pro 11.3 A1398 (EMC 2745).
Triple boot: macOS Big Sur + Windows 11 + Arch Linux.
Create a separate HFS+ partition (in macOS Big Sur). I recommend using the recovery environment or installation media—this will reduce unnecessary clutter.
# diskutil addPartition disk0 hfs+ "LinuxBoot" 100M
# reboot
In the Arch Linux installation environment.
Mount the HFS+ partition anywhere (for example, /hfsprt).
# mount --mkdir -t hfsplus -o rw /dev/sda5 /mnt/hfsprt
Preparing the HFS+ partition.
# touch /hfsprt/mach_kernel
# mkdir -p /hfsprt/System/Library/CoreServices
# mkdir -p /hfsprt/EFI/BOOT
# ln -f /hfsprt/mach_kernel /hfsprt/EFI/BOOT/mach_kernel
Install GRUB.
# pacman -S grub os-prober
# grub-install --target=x86_64-efi --efi-directory=/hfsprt --removable --no-nvram --disable-shim-lock
grub-install will generate all the necessary files (as described in the Arch Linux wiki), but in the /hfsprt/EFI/BOOT/ directory.
Align the HFS+ partition structure to the macOS boot drive using hard links.
# ln -f /hfsprt/EFI/BOOT/System/Library/CoreServices/SystemVersion.plist /hfsprt/System/Library/CoreServices/SystemVersion.plist
# ln -f /hfsprt/EFI/BOOT/System/Library/CoreServices/.disk_label /hfsprt/System/Library/CoreServices/.disk_label
# ln -f /hfsprt/EFI/BOOT/System/Library/CoreServices/.disk_label.contentDetails /hfsprt/System/Library/CoreServices/.disk_label.contentDetails
# ln -f /hfsprt/EFI/BOOT/System/Library/CoreServices/boot.efi /hfsprt/System/Library/CoreServices/boot.efi
# grub-mkconfig -o /boot/grub/grub.cfg
...
# reboot
Using blessing.
Start the computer in recovery mode (Command (⌘) + R)
# bless --folder /Volumes/LinuxBoot/System/Library/CoreServices/ --file /Volumes/LinuxBoot/System/Library/CoreServices/boot.efi --setBoot
# reboot
What is achieved?
The Linux boot partition behaves identically to the native macOS boot volume.
Arch Linux will always appear in the Mac startup manager (Option (⌥) menu) with a custom GRUB version label.
The system remains bootable and automatically restores its NVRAM boot entry even after an NVRAM reset.
The bootloader is isolated from the main EFI partition, preventing conflicts with the Windows boot manager.
GRUB updates are processed automatically by the system.
P.S.: Sorry for my English.
Last edited by Leksii (Today 22:35:08)
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。