Cannot install Ubuntu 20.04 on Mac mini 2020

8,349

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
Share:
8,349
darth_epoxy
Author by

darth_epoxy

I got hooked on Blob Wars: Metal Blob Solid and Warzone2100 and the rest is history.

Updated on September 18, 2022

Comments

  • darth_epoxy
    darth_epoxy over 1 year

    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?

    • darth_epoxy
      darth_epoxy almost 4 years
      OK that was fun but I am now up and running and even booting the F&%$ing EFI correctly. :)
  • Cassie
    Cassie over 3 years
    there are multiple files possible after hitting tab. Which one should go into the <>?
  • darth_epoxy
    darth_epoxy over 3 years
    Do you mean the vmlinuz or the initrd? Can you list them?
  • Cy.
    Cy. about 3 years
    That worked for me really well. Thanks for posting.
  • rashok
    rashok almost 3 years
    There is a /boot/vmlinuz-5.8.0-43-generic file. No vmlinuz*.efi.signed file. I am installing ubuntu 20.04 along with macos on macbook pro 16 inch 2019 (intel i9 processor). Please provide solution, I am struggling for last few days, to dual boot ubuntu along with mac. :-(
  • darth_epoxy
    darth_epoxy almost 3 years
    Go with the /boot/vmlinuz-5.8.0-43-generic file as the installer may not have created the efi.signed version and I don't think that's a problem. Essentially by adding the UUID at this step you are telling grub what to boot when you choose Ubuntu. Also remember my scenario was not dual boot it was replacing the mac OS.
  • rashok
    rashok almost 3 years
    Ya this boots ubuntu without any issues, but everytime when I start this grub terminal is coming. And I am doing the above grub commands for every boot. Can you tell me how to save the above grub configurations ?
  • darth_epoxy
    darth_epoxy almost 3 years
    When you are logged in to the Ubuntu desktop session, open a terminal and type sudo update-grub (which is in the last line of my answer) :)
  • lordvidex
    lordvidex about 2 years
    I don't have network connection in the "Try Linux" part, so whatever code needs to download any needed file doesn't work for me