Equivalent of pvmove for BTRFS

btrfsfilesystems

Similar to the question I asked a while back. This one's a little easier? I can see there's volume management logic in BTRFS for removing/adding/rebalancing physical drives, but is there a tool to manually move extents/blocks off a particular physical device and onto another? Seems like it would be important for files that should be created quickly (like backup files) but can be moved to slower storage on the backend.

Best Answer

The redistribution of files when removing a device is transparent. I looked at the source ( a 1 Gb git clone) but I have never been able to find anything in the user-land utilities (now bundled in btrfs IIRC) to do this without actually removing (btrfs device delete) and re-adding (btrfs device add) the device. I specifically looked at mapping subvolumes to specific devices without results.

The removing of a device takes time equivalent to the amount of data to be moved, during which the device is not used for new data. Also, there is no control to leave frequently accessed items on the device. So that was not a useful option.

I have my setup now so that the slower 'backend' is a separate filesystem to which specific data is move based on file type and access information. That is, of course, not as convenient as having one big filesystem with respect to running out of space (at least 'backend' storage is relatively cheap).

If you have not already done so you might also want to look at this entry on the btrfs Wiki.

Related Question