Thanks to the comments, for it gave me the general idea on how to proceed, as well as this Ubuntu article on reinstalling GRUB 2. The steps below worked on my system, a clean install of Ubuntu 24.04. Edit based on your custom setup. If you have files you can't lose, backup first.
- Prepare another system to boot from (e.g. a Live USB). Or attach your system storage to another computer.
- Once your system storage is attached, get its device paths, both the system disk and partition.
Example HDD paths: disk: /dev/sdb, partition: /dev/sdb2
Example NVME paths: disk: /dev/nvme0n1, partition: /dev/nvme0n1p3
These paths may be known by running lsblk or fdisk -l if using the CLI, or by launching GNOME Disks if you prefer a GUI.
- On the Terminal, run these commands (lines after
# are comments):
sudo su
mount /dev/${partition} /mnt
cd /mnt
If you haven't yet, edit fstab, i.e. nano /mnt/etc/fstab. The updated fstab must point
from @ or @home subvolumes, so change the options from "defaults" to include "subvol="
Example root: UUID=ABC… / btrfs subvol=@ 0 0
Example home: UUID=ABC… /home btrfs subvol=@home 0 0
btrfs subvolume create @
btrfs subvolume create @home
mv home/* @home
mv !(@|@home) @
sync
Mount /boot and /boot/efi if those came from other partitions.
In 24.04 by default, /boot/efi is in another partition, while /boot is not.
To confirm, check fstab, or run ls @/boot/ and it will list several files
If /boot is from another partition, run: mount /dev/${boot_partition} @/boot
mount /dev/${boot-efi_partition} @/boot/efi
https://help.ubuntu.com/community/Grub2/Installing#via_the_LiveCD_terminal
Note: Insert path for system disk, not system partition. See step 2.
grub-install --boot-directory=/mnt/@/boot --efi-directory=/mnt/@/boot/efi /dev/${disk}
Before exiting, double-check that all in @/etc/fstab are in place
- Exit Live USB and boot in your system.