Ubuntu – Cannot install Ubuntu 20.04 on Mac mini 2020

20.04bootloadergrub-efimac-miniuefi

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?

Best Answer

  • 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.

  • Related Question