1

I can't seem to boot out of the Xubuntu 20.04 in a duplicated partition to my initial / root partition.

My only operable OS on my machine was Xubuntu 20.04, mounted as / on a partition nvme0n1p3. I wanted to add another partition and install the root / mount point for Ubuntu 24.04 into it. I ran into issues whereby the manual partitioner couldn't recognize my /boot/efi partition (similar to this). My guess at the moment is that Ubuntu 24.04 can't proceed with the install because it requires that initial partition to be 1 GiB, not the 512 MiB that more than sufficed under Xubuntu 20.04.

SO, I'm trying to make space to enlarge that first partition, which means I need to effectually move the nvme0n1p3. The steps that made the most sense were to:

  1. create a new partition (nvme0n1p4) off the end of the current nvme0n1p3 partition, with a gap of 2 GiB
  2. Duplicate the old Xubuntu 20.04 from the original (nvme0n1p3) to the new partition (nvme0n1p4)
  3. Once convinced that I can boot and run out of the duplicated (nvme0n1p4) partition, delete the original partition ((nvme0n1p3)
  4. Resize the vfat /boot/efi partition to 2.5 GiB (more than necessary, but a precaution against similar issues in the future)
  5. Create a new nvme0n1p3 partition (it might not get called that) between the boot and nvme0n1p4 partitions, but just leave it empty for now
  6. Create a new partition (nvme0n1p5) partition in the unallocated space to the "right" of the existing partitions, and eventually install (hopefully) Ubuntu 24.04 into it.

I'm stuck between steps 2 and 3. The finer detail is:

  1. Use gparted to do the partitioning described above
  2. Re-boot off of the Ubuntu 24.04 USB stick (so that all partitions can be unmounted)
  3. dd the existing nvme0n1p3 partition to the new nvme0n1p4 partition
  4. Follow along here to give the new partition a unique UUID and edit the /etc/fstab entry in the nvme0n1p4 partition accordingly
  5. Run update-grub, and confirm new menu entries in /boot/grub/grub.cfg
  6. Attempt to boot into the cloned-Xubuntu 20.04 nvme0n1p4 partition

I am apparently able to select the right menu option in the grub menu, but it boots me into the original nvme0n1p3 partition.

Some details:

sudo lsblk -f:

nvme0n1

- - - - - -
├─nvme0n1p1 vfat 995C-7BB0 469M 1% /boot/efi
├─nvme0n1p2 swap e67db830-5b33-41bb-859d-8ab967d79db6 [SWAP]
├─nvme0n1p3 ext4 63c24e20-9e18-4b6d-9091-5289f1398d61 21.8G 65% /
├─nvme0n1p4 ext4 e3a93f78-5ba8-445a-9a9f-bcd95aabd7dd
└─nvme0n1p5 ext4 d777c31a-6fb1-4b27-bedd-1d5400569eee

sudo fdisk -l

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 976895 974848 476M EFI System
/dev/nvme0n1p3 976896 157227007 156250112 74.5G Linux filesystem
/dev/nvme0n1p4 161323008 325163007 163840000 78.1G Linux filesystem
/dev/nvme0n1p5 325163008 489003007 163840000 78.1G Linux filesystem
/dev/nvme0n1p2 945522688 976771071 31248384 14.9G Linux swap

I understand that one shouldn't edit the /boot/grub/grub.cfg file directly, but I'm a little puzzled at entries like

menuentry 'Ubuntu 20.04.6 LTS (20.04) (on /dev/nvme0n1p4)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-e3a93f78-5ba8-445a-9a9f-bcd95aabd7dd' {
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root e3a93f78-5ba8-445a-9a9f-bcd95aabd7dd
else
search --no-floppy --fs-uuid --set=root e3a93f78-5ba8-445a-9a9f-bcd95aabd7dd
fi
linux /boot/vmlinuz-5.15.0-127-generic root=UUID=63c24e20-9e18-4b6d-9091-5289f1398d61 ro quiet splash $vt_handoff
initrd /boot/initrd.img-5.15.0-127-generic
}

update-grub appears to pick up the new UUID through most of the entry, but ultimately retains the old UUID in the "linux /boot/vmlinuz-5.15.0-127-generic" line. If this is the problem, update-grub is evidently getting the wrong info from somewhere I haven't found yet. Is that the problem? What else am I missing?

update-grub itself doesn't suggest there should be any problems:

Sourcing file '/etc/default/grub'
Sourcing file '/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-127-generic
Found initrd image: /boot/initrd.img-5.15.0-127-generic
Found linux image: /boot/vmlinuz-5.15.0-125-generic
Found initrd image: /boot/initrd.img-5.15.0-125-generic
Found Ubuntu 20.04.6 LTS (20.04) on /dev/nvme0n1p4
Adding boot menu entry for UEFI Firmware Settings
done

EDIT/ADDED: Curiously, the non-booting nvme0n1p4 partition is in the os-prober portion of grub.cfg. This suggests it should be in the 10_linux section. update-grub seems to be getting it wrong?

Edit #2: The answer in this question convinced me to go off piste and edit /boot/grub/grub.cfg by hand and try rebooting. I moved the nvme0n1p4 partition / root to the 10_linux section, and replaced the ...-5289f1398d61 lines to ...-bcd95aabd7dd. Selecting the same menu item as before this time booted me into this partition. So, success, except I wasn't supposed to edit that file by hand.

And, running (this time) sudo update-grub2, the original nvme0n1p3 / root winds up in the 30_os-prober section, the expected reciprocal of before, though this time all UUIDs in all the menu and submenu blocks show ...-5289f1398d61.

GoneAsync
  • 119

0 Answers0