Cannot install Ubuntu 20.04 on Mac mini 2020
Solution 1:
OK so this is what worked for me.
From the 20.04 iso on a USB let the installer do it's thing.
It will create a small partition with /boot/efi and take up the rest of the drive with /
as you know there is no need for a swap partition as Ubuntu now uses a swap file.
The installer will appear to fail as per my question above.
Executing 'grub-install /dev/nvme0n1' failed. This is a fatal error.
When you reboot you will get a limited grub terminal.
Full notes are here but below are the basics from rohiths answer;
At the grub console;
grub> ls
(memdisk) (hd0) (hd0,msdos) (hd1) (hd2) (hd2,gpt3) (hd2,gpt2) (hd2,gpt1)
You may not get exactly the same results as this, but you’ll have some similar options.
Now, find the partition which contains your user's home directory.
grub> ls (hd2,gpt2)/home
rohith/
Keep trying until you find it.
The result from the last step has two parts: (hdX,gptY). You need to keep the hdX part, but go through all the gptY options looking for a /boot/grub directory.
grub> ls (hd2,gpt2)/boot/grub
unicode.pf2 [...] grub.cfg
Now you want to set this as your root for further commands.
grub> set root=(hd2,gpt2)
The only way to boot properly was to use the UUID of the drive. To get it -
grub> ls -l (hd2,gpt2)
Note down the UUID. You'll have to type it manually in the next step.
grub> linux /boot/vmlinuz〈...tab here!...〉.efi.signed root=UUID=〈the UUID from above〉
The GRUB console can do tab completion, so if you just type out the vmlinuz part and hit tab, then hit . and tab again, you won't have to type the whole file name. make sure that the efi.signed part is present.
Now, set the initial RAM disk
grub> initrd /boot/initrd〈...tab here!...〉
You should be able to boot with the command
grub> boot
This will reboot and get you to the login screen as if you had a perfect install and rebooted. If you have an internet connection you can get the system up-to-date at this point but do NOT reboot untill you fix grub. NOTE the boot partition is incorrect, the boot loader actually needs to be reformatted as FAT32 with mount point /boot/efi with flags (boot,esp) which is done simply using gparted.
According to rohiths answer, The system was initially unbootable because the Mac bootloader expects the EFI partition to be formatted as HFS+, the typical Mac filesystem, while the Ubuntu installer actually formats it as VFAT. But this is NOT correct on my machine.
So now you can mount the new partition with boot/efi and re-install grub, check your config and update-grub then you can reboot.
Solution 2:
I have the same problem when i install Ubuntu 20.04/10 on my Mac min. To solve this problem i boot to the Ubuntu live from my USB and in the terminal, i use this commands to repair grub. First eject any external drive.
sudo mkdir -p /mnt/drive
sudo mount /dev/nvme0n1p2 /mnt/drive
sudo mount /dev/nvme0n1p1 /mnt/drive/boot/efi
sudo mount --bind /dev /mnt/drive/dev
sudo mount --bind /dev/pts /mnt/drive/dev/pts
sudo mount --bind /proc /mnt/drive/proc
sudo mount --bind /sys /mnt/drive/sys
sudo cp /etc/resolv.conf /mnt/drive/etc/resolv.conf
sudo chroot /mnt/drive
su - <your username>
sudo update-grub