I've got two installations of Ubuntu 18.04 on my computer. Ideally I just want one but when I run sudo update-grub
it keeps updating the configuration for the wrong partition. I eventually want to delete the second partition but don't want to do so until I can relink my main partition with grub.
> sudo update-grub
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-42-generic
Found initrd image: /boot/initrd.img-5.4.0-42-generic
Found linux image: /boot/vmlinuz-5.3.0-28-generic
Found initrd image: /boot/initrd.img-5.3.0-28-generic
Found linux image: /boot/vmlinuz-4.15.0-112-generic
Found initrd image: /boot/initrd.img-4.15.0-112-generic
Found Ubuntu 18.04.4 LTS (18.04) on /dev/nvme0n1p6
Adding boot menu entry for EFI firmware configuration
done
The partition I want to delete is /dev/nvme0n1p6. And the one I want to keep and link with grub is /dev/nvme0n1p1 but it doesn't seem to be detected. Is there a way to safely change configurations so that it updates grub for /dev/nvme0n1p1? I will eventually delete /dev/nvme0n1p6 if it is save to do so.
Edit: I tried to the suggested post askubuntu.com/questions/1168713/ (I know it's for non-UEFI) and got the output below when running on /dev/nvme0n1p6 (partition I want to delete).
$ sudo dpkg-reconfigure grub-pc
[sudo] password for dionode:
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-42-generic
Found initrd image: /boot/initrd.img-5.4.0-42-generic
Found linux image: /boot/vmlinuz-5.3.0-28-generic
Found initrd image: /boot/initrd.img-5.3.0-28-generic
Found Ubuntu 18.04.4 LTS (18.04) on /dev/nvme0n1p1
Adding boot menu entry for EFI firmware configuration
done
Sudo update-grub from this same partition also contains that line Found Ubuntu 18.04.4 LTS (18.04) on /dev/nvme0n1p1
so it looks like update-grub from each partition only finds Ubuntu for the other partition. Is that normal?
Turns out the problem was with multiple grub installations so one of them was effectively not being used. I managed to save this problem by following the post askubuntu.com/questions/1168713 which was directed at non-UEFI systems but turns out to work for UEFI systems too.