Duplicating nvme boot drive

Armbian 23.02.2 Jammy with Linux 5.10.110-rockchip-rk3588

I have a script automates the process of preparing a disk for use to boot as nvme drive. I copy an existing working nvme drive that boots and works fine. The destination copy is a drive on sda.

  • Erases the existing partition table and data on /dev/sda.
  • Creates a new GPT (GUID Partition Table) on /dev/sda.
  • Creates a first bootable partition of 250MB with ext4 filesystem and label “armbi_boot”. This partition is set with the PARTLABEL “bootfs”.
  • Creates a second partition using the remaining disk space with ext4 filesystem and label “armbi_root”. This partition is set with the PARTLABEL “rootfs”.
  • Mounts the created partitions to their respective directories in /media.
  • uses rysyn to copy all files from /boot and / to new sda partitions /boot and /.

When I replace the nmve drive and try to boot form the new drive. It does not boot.

What am I missing to get this to boot?

The UUID is different

How can I fix that. I guess I can set it to the same when I create the partition. Would that be the right approach?

Either externally modify UUID to the new one in armbianEnv.txt (I think) on your /boot partition and /etc/fstab, or change the partition UUID. Google is your friend how. I think you can use gparted. Not sure how to do this automatically (I’d just dd the whole disk though).

Setting the UUID on partition creation did the job. Thanks for your comment as I will try armbianEnv.tx and fstab too. Thanks!

1 Like

You are correct armbianEnv.txt, and /etc/fstab. Set the UUIDs and its good. Thanks a bunch. That worked.

1 Like