I've successfully did a triple boot on my Macbook-pro but somehow even after creating separate EFI partitions, all my grub files ended up in the first EFI partition. So I separated them manually.
Earlier to this process, my auto boot was into the Ubuntu boot screen where I was able to select Ubuntu or Kali. To access OS-X, I had to use option key. There I got 3 options and I was able to opt any. But after separating, and using option key, it also gives me 3 options, but I get some kind of error(excuse my limited knowledge).
The following are the pics for reference.
This is the OS-X boot page.
After a few seconds, I get this page, and then I can normally log-in to either OS.
My auto-boot remained the same, which is getting the above page.
This is my disk information. Disk0s1 is OS-X, Disk0s3 is Ubuntu, Disk0s6 is Kali.
$ diskutil list disk0
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *251.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk1 120.0 GB disk0s2
3: EFI NO NAME 400.6 MB disk0s3
4: Linux Filesystem 65.0 GB disk0s4
5: Linux Swap 15.0 GB disk0s5
6: EFI NO NAME 399.5 MB disk0s6
7: Microsoft Basic Data 50.0 GB disk0s7
$ sudo gpt -r show /dev/disk0
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 409600 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
409640 234375000 2 GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC
234784640 128
234784768 782336 3 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
235567104 126953472 4 GPT part - 0FC63DAF-8483-4772-8E79-3D69D8477DE4
362520576 29296640 5 GPT part - 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F
391817216 780288 6 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
392597504 97636352 7 GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
490233856 863
490234719 32 Sec GPT table
490234751 1 Sec GPT header
The following are the current partition contents.
$ sudo diskutil mount /dev/disk0s1
Volume EFI on /dev/disk0s1 mounted
$ ls -a /Volumes/EFI
. .Spotlight-V100 .fseventsd EFI
.. .Trashes BOOTLOG
$ ls -a /Volumes/EFI/EFI
. .. APPLE BOOT
$ ls -a /Volumes/EFI/EFI/APPLE
. .. CACHES EXTENSIONS FIRMWARE
$ ls -a /Volumes/EFI/EFI/APPLE/EXTENSIONS
. .. Firmware.scap
$ ls -a /Volumes/EFI/EFI/APPLE/FIRMWARE
. .. MBP121.fd
$ ls -a /Volumes/EFI/EFI/BOOT
. .. BOOTX64.EFI
$ sudo diskutil mount /dev/disk0s3
Volume NO NAME on /dev/disk0s3 mounted
$ ls -a /Volumes/NO\ NAME
. .Trashes .fseventsd
.. .VolumeIcon.icns EFI
.Spotlight-V100 ._.VolumeIcon.icns
$ ls -a /Volumes/NO\ NAME/EFI/
. .. BOOT BOOTLOG Ubuntu
$ ls -a /Volumes/NO\ NAME/EFI/BOOT
. .. BOOTX64.EFI
$ ls -a /Volumes/NO\ NAME/EFI/Ubuntu
. BOOTX64.CSV grubx64.efi shimx64.efi
.. grub.cfg mmx64.efi
$ sudo diskutil mount /dev/disk0s6
Volume NO NAME on /dev/disk0s6 mounted
$ ls -a /Volumes/NO\ NAME/
. .Spotlight-V100 .fseventsd
.. .Trashes EFI
$ ls -a /Volumes/NO\ NAME/EFI
. .. kali
$ ls -a /Volumes/NO\ NAME/EFI/kali
. .. grubx64.efi
Best Answer
This answer assumes the following:
/etc/fstab
file is setup up correctly for Ubuntu and Kali. More specifically, each/etc/fstab
file has the correct entry for the filesystem stored in the EFI partition.Below are steps that can be taken to improve your configuration.
Remove from the Mac Startup Manager the existing internal drive icon with the
EFI Boot
label shown below.Use the macOS commands given below.
Give names and labels to the EFI partitions used by Ubuntu and Kali. Also, make Grub from the Kali installation appear in the Mac Startup Manager. Below are the macOS commands I would use.
Add a Kali linux icon to Mac Startup Manager.
Download the file
mac-icns.dmg
from this SourceForge website to yourDownloads
folder. Next, enter the following command to copy the Kali linux icon set (icns) file to your third EFI partition.The next time you boot to the Mac Startup Manager, the following icon should appear.
Change the type of the partition containing Kali to the linux filesystem data type.
Boot to either Ubuntu or Kali linux. Open a window to enter commands. Enter the following command to edit the GUID Partition Table (GPT).
Enter the following commands into
gdisk
.Restart the Mac.
Configure Grub to be hidden and/or omit other operating systems.
Boot to either Ubuntu or Kali linux. Open a window to enter commands. Enter the following command to edit the
grub
file.To remove other operating systems from the Grub menu, add the line
after the line given below.
To skip the Grub menu, add the line
after the line given below.
Exit the editor and enter the following command to update Grub.
Booting Ubuntu from the Mac Startup Manager
When Ubuntu is selected from the Mac Startup Manager, the
bootx64.efi
(which is a copy ofshimx64.efi
) is booted beforegrubx64.efi
is booted. This results in Ubuntu being automatically made the default operating system to boot.Alternative to Booting Grub Using
bootx64.efi
One of the above instructions is to copy the
grubx64.efi
file to thebootx64.efi
file. If thegrubx64.efi
is changed during some future Kali update/upgrade, then this new file will not be copied tobootx64.efi
. One way to avoid this problem would be to replace thebootx64.efi
file with a rEFInd version. This new version would silently boot Grub from thegrubx64.efi
file. Below are the steps needed to make the change.Boot to Kali linux.
Open a window to enter commands.
Enter the following commands to remove any previous versions of rEFInd that may have been downloaded.
Use a web browser to download and save rEFInd to your
Downloads
folder from the following SourceForge website.https://sourceforge.net/projects/refind/
Enter the following command to install rEFInd.
Enter the following command to open
refind.conf
file in thegedit
editor.Add the following lines to the end of the
refind.conf
file.Exit
nano
and save the changes.References
Separating EFI partitions of Ubuntu 20.04 and Mac OSX on Macbook Pro
Fully Move Grub to New Partition
Grub2/Setup
A gdisk Walkthrough
The rEFInd Boot Manager
The rEFInd Boot Manager: Installing rEFInd
refind-install
How to extract a .deb file without opening it on Debian or Ubuntu Linux
What is the difference between grubx64 and shimx64?
How To Add Apt Repository In Ubuntu