Closed ghost closed 2 years ago
[...] but haven't found a viable solution for the "move" problem.
You can use mv
on subvolumes. This preserves all uuids.,e.g.
cd /path/to/snapshots
# list uuids
lsbtr -u ./
mv home.20220101 ../new_snapshot_dir/home.20220101
or, you can as well create snapshots (read-only). this sets parent uuid, which implies that you need to keep the parent in order to preserve the relationships required for send/receive (check with lsbtr -u
)!
cd /path/to/snapshots
btrfs subvolume snap -r home.20220101 ../new_snapshot_dir/home.20220101
lsbtr -u ../
You can use
mv
on subvolumes.
Only if they're not read-only. Is it ok to remove the flag, move the subvolumes, and set it again?
Oh, this is strange, I'm pretty sure this used to work (this restriction makes absolutely no sense: I can rename it using mv
, but not move it into a folder? Looks like a bug to me...)
Is it ok to remove the flag, move the subvolumes, and set it again?
Should be fine.
Seems to be a known restriction, see here
mv
for renaming a ro snapshot is ok, but not for moving it e.g. into a subdir.
Anyway, I'll try rw > mv > ro.
[EDIT] Can confirm that this works:
false
mv
snapshots to subdirtrue
againe.g.:
cd btrbk_snapshots
mkdir data
find . -maxdepth 1 -iname "data.202*" -exec btrfs property set -ts "{}" ro false \;
find . -maxdepth 1 -iname "data.202*" -exec mv "{}" ./data/ \;
cd ./data
find . -maxdepth 1 -iname "data.202*" -exec btrfs property set -ts "{}" ro true \;
In the past, I had used and configured a single snapshot directory for all snapshots. Browsing it has become tedious, since it receives a lot of snapshots from various subvolumes. I'd like to reorganize that, and introduce multiple subdirs in the snapshot directory, without losing the existing UUIDs.
Is there any way to change to a per-subvolume snapshot subdirectory setup, and move existing snapshots? Adapting all btrbk conf files that I use does look easy, but haven't found a viable solution for the "move" problem.