0

I installed Ubuntu as a recovery option for my computer in case Windows breaks, but now I actually like it. I decided to increase the Ubuntu partition size, and since I don’t care about the data in my previous Ubuntu installation, I reinstalled it on a larger partition.

Now, I want to remove the old installation from the EFI System Partition (ESP), but I only see one instance of Ubuntu in the boot menu. I'm concerned about what will happen if I delete it—will it break both Ubuntu installations or just one?

Edit: solved

Regardless, I need guidance on how to delete the previous Ubuntu installation while keeping the new one. Additionally, I’m triple-booting Windows 10, Windows 11, and these two Ubuntu installations.

1 Answers1

3

All installs of Ubuntu use one UEFI entry 'ubuntu' and many unofficial flavors alsp use same entry if based on Ubuntu. All installs must be UEFI, not old BIOS.

Last install is normally the grub in control, if you want another grub in control, boot into it and do sudo grub-install. That resets the UUID in the ESP to that install's UUID. You can manually edit UUID, but permissions on ESP are restricted by settings in fstab.

Windows often is similar in that you have one BCD in control that lets you choose one Windows or the other. Some reconfigure with another temporary ESP, to have 2 BCDs, so grub can directly boot either Windows install.

You can see UEFI boot entries with, UEFI uses GUID of ESP to know which partition to find boot files:

sudo efibootmgr

And you can see UUIDs & GUIDs.

lsblk -e 7 -o name,fstype,size,fsused,label,partlabel,mountpoint,uuid,partuuid

Since 14.04 fstab has mounted ESP - efi system partition with no permissions (0077). (shows my UUID only as example. UUID=68CD-3368 /boot/efi vfat umask=0077 0 1 Prior it used defaults, but was then not as secure: UUID=68CD-3368 /boot/efi vfat defaults 0 1

You can mount ESP from live installer to see three line grub entry which uses the UUID to find grub.cfg in default install. If fstab has correct ESP mounted then update grub in any other install will update UUID. Not major updates in second install may redo it as default & you have to reset to your preferred install

Example 3 line grub configfile in ESP, the UUID 75f... is UUID of my install root partition on nvme0n1p6 (hd0,6). And in install ESP is mounted at /boot/efi

fred@dell5310:~$ cat /boot/efi/EFI/ubuntu/grub.cfg
search.fs_uuid 75f21d9b-d206-4e74-afc3-f44ac6c4a583 root 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

If for some reason I get grub> and either remember or use ls to find grub.cfg, can use configfile to boot as above but one line.

configfile (hd0,gpt6)/boot/grub/grub.cfg

I have tried getting different UEFI entries, by editing /etc/default/grub, but find Ubuntu's grub is hard coded to use /efi/boot/grub.cfg in ubuntu folder. I do get new folders in ESP with new name and new UEFI entries, but it does not use grub from that folder just ubuntu folder.

This user said it worked for him. How do I install two independent Ubuntu installations on a single hard drive with UEFI?

oldfred
  • 12,583