geerlingguy / rpi-clone

A shell script to clone a booted disk on a Raspberry Pi.
https://rpi-clone.jeffgeerling.com/
BSD 3-Clause "New" or "Revised" License
272 stars 16 forks source link

Ubuntu Server 24.04 - impossible to boot #43

Open thehedgefrog opened 1 month ago

thehedgefrog commented 1 month ago

I have an SD card I wrote with the Pi imager of Ubuntu Server 24.04. When I run sudo rpi-clone -f sda (with or without the -f option or in succession), the copy succeeds but the USB disk then never boots.

However, if I use the imager to write to the disk directly, it works fine. I have replicated this on 2 Pis and validated that the files are identical on both the card and the drive.

Am I missing an obvious step?

thehedgefrog commented 1 month ago

After some digging, it appears the Raspberry Pi imager's image uses labels in fstab and cmdline.txt for Ubuntu, while it uses PARTUUID for Raspbian. This broke the behaviour.

If I can add a suggestion, --convert-fstab-to-partuuid should also convert labels to PARTUUID to avoid having to do it manually prior to the clone.

kpanoulas2 commented 1 month ago

I had to tweak the process a bit but now it worked for me. I ran sudo rpi-clone -f nvme0n1 When rpi-clone asks for volume name, the name has to be: writable Then before completing the script, the the vfat volume label has to be changed to: system-boot. [to match the contents of the /etc/fstab in the new disk] This can be done with the following command: sudo fatlabel /dev/nvme0n1p1 system-boot After that the system booted as expected.

fubits1 commented 1 month ago

@kpanoulas2 thank you so much for sharing - this solved the problem!