You are not logged in.

#1 2022-07-17 23:09:34

branthebuilder
Member
Registered: 2016-10-01
Posts: 50

move btrfs subvolume to different device in same volume

I have a top-level root volume with a .snapshots subvolume on the same device. I have a second device initially a separate volume mounted at /data that I would prefer to store the snapshots in. I successfully added that device to the root volume via

btrfs device add -f /dev/sda7 /data

How do I move the .snapshots subvolume to the /data device? The snapshots subvolume is currently empty, so I thought it would work to just remove it and symlink /data/.snapshots to /.snapshots and create the subvolume at /data/.snapshots from scratch. Unfortunately symlinks are not allowed in creating snapshots. Should I instead make the partition mounted at /data into two subvolumes, one mounted at /data, and one mounted at /.snapshots?

Last edited by branthebuilder (2022-07-17 23:24:00)

Offline

#2 2022-07-18 12:01:08

ratcheer
Member
Registered: 2011-10-09
Posts: 861

Re: move btrfs subvolume to different device in same volume

This does not compute. Once you have made two devices part of the same "volume" (I think you mean you added the second device to the filesystem), it is all one thing (like a raid0 volume), and you don't really control where btrfs places the data. If you want your snapshots stored on a separate device, you will have to make a separate btrfs on the second device.

However, you cannot make snapshots directly into a separate filesystem. You can send them from their original filesystem to be received and stored on the other device. The send/receive operation can be incremental, adding only new or changed data to the received snapshot.

Last edited by ratcheer (2022-07-18 12:01:36)

Offline

#3 2022-07-23 21:33:33

branthebuilder
Member
Registered: 2016-10-01
Posts: 50

Re: move btrfs subvolume to different device in same volume

Thank you for clarifying. I indeed did not really understand that subvolumes could not be restricted to one device that was part of a volume. I think I'm probably going to be best served to just make it one volume.

Offline

#4 2022-07-23 22:37:27

ratcheer
Member
Registered: 2011-10-09
Posts: 861

Re: move btrfs subvolume to different device in same volume

You're welcome. The btrfs Wiki is your friend.

https://btrfs.wiki.kernel.org/index.php … subvolumes

Offline

Board footer

Powered by FluxBB