1

I have a brand new 2020 Mac mini (Intel i3 quad core chip). My install (dedicated Ubuntu NO dual boot) fails with the famous;

Executing 'grub-install /dev/nvme0n1' failed. This is a fatal error.

I have bypassed the T2 chip by booting into recovery mode and selecting "No Security" and "Allow booting from external drive". So when I turn on the Mac mini and hit the Alt key it shows me the two icons to select boot, the hard drive and the flash drive. My flash drive has the ubuntu-20.04-desktop-amd64.iso that has been made into a bootable USB by the startup disk creator on my working Ubuntu 14.04 LTS laptop.

No matter what I do the install fails and the Mac mini subsequently boots into an old Grub 2.04 with limited capabilities.

I am unable to follow this good advice Install ubuntu 18.04 on mac mini 2018 as I cannot install rEFInd in that manner.

I have tried several of the Matt Gadient (legend) bootable iso versions.

I have reformatted the entire drive as gpt using gparted and basically started from scratch but cannot find any partition combination that will let the installer complete (other than forcing it to install when there is no EFI partition in which case the installer does NOT fail but obviously the Mac mini fails to boot to anything).

I have tried several manual grub-install options from these pages but the most common error then is /cow is busy and it cannot be unmounted.

When I boot up with boot-repair the program runs but it does not detect anything. From that program if I terminal and lsblk it does not even show the nvme0n1 drive.

So, any ideas how I can get the installer to work or how I can manually install a grub?

1
  • OK that was fun but I am now up and running and even booting the F&%$ing EFI correctly. :) – darth_epoxy Jul 13 '20 at 6:39
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.

2
  • there are multiple files possible after hitting tab. Which one should go into the <>? – Cassie Dec 3 '20 at 5:41
  • Do you mean the vmlinuz or the initrd? Can you list them? – darth_epoxy Dec 3 '20 at 7:29
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.