Another way to set the UUID of a btrfs fs is: btrfstune -U LONG_UUID /device
So
1. fsarchive presumably mounts an image with UUID=foo
2. mkfs will create a new fs with UUID=bar
3. umount both UUIDs, and disconnect the device with UUID=foo
4. btrfstune -U foo /new_fs_device
I'm not sure how to do this without disconnecting the fsarchive UUID=foo
before conversion, but upstream might know. I'm not sure how fsarchiver
works, but another option would be to
1. Store the source UUID
2. Fsarchiver stores image as a transient UUID
3. Wipefs any conflicting UUIDs on the system to-be-restored
Or error and abort and advise user to do so.
4. Mkfs -U with stored source UUID
5. Fsarchiver restores data
The advantages of this second approach are that metadata is not
rewritten (this is safer), and that UUIDconflicts will never occur
except in the restore-twice case. The only way to mitigate that is to
implement a best-practises wipefs.
Abusing UUIDs by duplicating them used to actually corrupt btrfs.
'hope this helps,
Nicholas
signature.asc
Description: PGP signature

