Assigning new UUIDs to the cloned partitions

I have cloned a SSD with nios to another one and was wondering the steps to take in order to assign new UUIDs to the cloned SSD for differentiation. Would appreciate if someone could enlighten and detail the correct approach to take (I have boot, root and swap partition btw)

I guess if you’re being really thorough you need to both the UUID in the partition table (assuming GPT), as well as the filesystem UUID. The tooling for the latter is fs specific - tune2fs will do it for ext2/3/4, btrfstune for btrfs (and note that for btrfs there a ‘quick’ way that’s not compatible with pre-5.0 kernels.) swap I guess you can just re-mkswap it again (assuming you haven’t got hibernated system data in there.)

For the partition table, gdisk seems to have an option in the expert menu to randomize the disk guid and the partition guids.

Do note if you do this, you should check your nixos configuration to see if it’s mounting partitions by partuuid or fs-uuid, and update it if it is.

thank you, that makes sense