How to move btrfs subvolume correctly

btrfs is new to me. I’m in a need to move btrfs subvolumes to different location. How to do it correctly? I have tried snapshotting them but no matter how I specify path I alvays get “No such file or directory”

Some sample how their appear currently:

[root@d... mnt]# btrfs subvolume list /home ID 256 gen 340794 top level 5 path @/vmguests ID 257 gen 340794 top level 5 path @/opt

[root@d… mnt]# btrfs subvolume snapshot @/opt /mnt/temp_home
ERROR: Could not statfs: No such file or directory

BTRFS is a big B-Tree and the sub volumes are not physically distinct from the base partition. If you want to “move” or change capacities?? you could create a new portion (of any type file system) and mount to replace the BTRFS subvoume

@nikkej:

There’s this “How-To” in GitHub – <Move your BTRFS /home subvolume to a new disk>

  • OK, possibly OTT if you’re not planning to move the subvolume to a RAID …

Path @/opt doesn’t exist. Use /opt instead.

Thanks gogalthorp, Donald and maier about your valuable hints. Currently, I’m eagerly learning about btrfs.

@nikkej:

Please be aware that, as of Linux Kernel version 7.0 XFS now has autonomous self healing capabilities – <XFS Introducing Autonomous Self-Healing Capabilities With Linux 7.0>.

This means that, primary reason for choosing Btrfs over XFS where data integrity checking is important is now longer valid.

Donald, the link to github gist were helping alot, especially moving to home header in a gist

None of your answers gave full solution which is great since they left room for intuition and thus self learning

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.