January 22, 20197 yr Hi, as mentioned with @johnnie.black on PM, i'm creating this topic, if this question helps someone else too. I would like to move my array drives to encrypted btrfs. now i have a un-encrypted drives with btrfs with folder for data and folder for snapshots. how i can move all data to another drive without loosing all snapshots?
January 22, 20197 yr Community Expert So, like mentioned on the pm, I never tried this, but it should work: -do a current snapshot on the unencrypted disk btrfs sub snap -r /mnt/sourcedisk/Share /mnt/sourcedisk/path_to_snaphot -use send/receive to send that snapshot to the new encrypted disk, e.g: btrfs send /mnt/sourcedisk/path_to_snapshot | btrfs receive /mnt/destdisk -use cp --reflink=always to copy that snapshot and create the share: btrfs sub create /mnt/diskX/Share cp -aT --reflink=always /mnt/diskX/path_to_snapshot /mnt/diskX/Share X has to always be the same disk. -use send/receive to send the rest of the snapshots using the first snapshot sent as the parent, so only the differences are sent. btrfs send -p /mnt/sourcedisk/path_to_snapshot /mnt/sourcedisk/path_to_an_older_snapshot | btrfs receive /mnt/destdisk Edited January 22, 20197 yr by johnnie.black
January 22, 20197 yr Community Expert Did a little test and this does indeed seem to work as intended. Last send/receive needs to be repeated as many times as snapshots you have, or the at least for the ones you want to send to the new disk, you can also use a different parent snapshot as you send older ones so the send is faster, e.g., say you have these snapshots: 20190122 (the last one created and the one used for the initial send/receive) 20190121 20190120 20190119 So for example the first incremental send would be: btrfs send -p /mnt/disk1/snaps/20190122 /mnt/disk1/snaps/20190121 | btrfs receive /mnt/disk2/snaps for the second one you could then use: btrfs send -p /mnt/disk1/snaps/20190121 /mnt/disk1/snaps/20190120 | btrfs receive /mnt/disk2/snaps third one: btrfs send -p /mnt/disk1/snaps/20190120 /mnt/disk1/snaps/20190119 | btrfs receive /mnt/disk2/snaps And so on, so each incremental send is as small as possible, you can also pipe it through pv to see how much data is being sent from each one, e.g.: btrfs send -p /mnt/disk1/snaps/20190122 /mnt/disk1/snaps/20190121 | pv | btrfs receive /mnt/disk2/snaps
January 22, 20197 yr Author Thanks! i'm in the process of send/receive the first snapshot to target drive. speed seems something slower than if i simple copy from disk to disk shares.
January 23, 20197 yr Author ok, transfer of the first disk done. all commands above worked just fine. data is changing very slowly on that disk, so snapshot transfers was very fast. Thanks @johnnie.black for help!
Archived
This topic is now archived and is closed to further replies.