I just acquired a macbook air. I dual-booted mac os with Ubuntu. It is my first time multiple-booting on a mac. I triple-booted with another Ubuntu. Ater removing the third distro, I experience some issues with grub.
First of all, I made my partitions as follow:
$ lsblk sda sda1 200M /boot/efi sda2 47.3GB # Mac os sda3 620MB # Mac rescue sda4 2GB # Swap partition sda5 50GB # Ubuntu 1 sda6 50GB # Ubuntu 2 sda10 100GB # ext4 file system
I did an install of Ubuntu on
sda5. Once finished, it directly boots with Ubuntu which is great. I later installed another ubuntu on
sda6 as I would like to test using other ditros and I want to check if I could do that easily. Note that the Ubuntu version is the exact same I installed on another partition. Once the second Ubuntu installed, I reboot and I have the grub screen asking me to chose between the two Ubuntus. Neat. Then, having no use for the second ubuntu, I simply erased
$ gdisk /dev/sda > d # delete partition > 6 # delete partition 6 > w # write changes > Y # confirmation of writing changes. > q # quit gdisk $ lsblk sda sda1 200M /boot/efi sda2 47.3GB # Mac os sda3 620MB # Mac rescue sda4 2GB # Swap partition sda5 50GB # Ubuntu 1 sda10 100GB # ext4 file system
Now on reboot, I get the grub command line on black screen. I have to specify the disk where my ubuntu is located. I followed some indications in this thread to boot on Ubuntu: https://askubuntu.com/questions/159846/tried-to-boot-ubuntu-but-the-grub-rescue-shows-up-instead and tried doing the following:
grub> ls (hd2,gpt5) # That's my Ubuntu partition grub> root=(hd2,gpt5) grub> configfile /boot/grub/grub.cfg
Now I succesfully booted in Ubuntu. After logging in, I followed the instrutions on updating grub:
$ sudo update-grub
Alas when rebooting, the grub screen pops up again. So updating grub did not do the trick. I also tried to do with grub 2 in case:
$ sudo update-grub2
It does not change anything.
I also tried to reinstall the second version of Ubuntu on sda6. Same scheme, when I reboot, I am asked to chose between the two Ubuntu versions in the grub menu, so it kind of solves the issue. But as soon as I remove the second Ubuntu partition, the first one won't boot directly unless I specify it in the grub command line screen.
I don't know if this might be useful, but here is my fstab:
$ cat /etc/fstab # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda2 during installation UUID=85ab4560-729a-4f7d-91d9-69af89ea1219 / ext4 errors=remount-ro 0 1 # /boot/efi was on /dev/sda1 during installation UUID=DAC6-DEC2 /boot/efi vfat defaults 0 1 # swap was on /dev/sda4 during installation UUID=9c76739a-5996-43d8-a14e-fe690c06870f none swap sw 0 0
What can I do to solve this issue? Is it a matter of EFI? Why removing the second Ubuntu partition makes the first one unrecognized to grub?
Note that I would like to find a clean solution, so I would like to avoid reinstalling Ubuntu to solve it.