Post History
A convenient but a little risky method Don't do this unless you have backups on a separate drive, and are prepared to restore from them. Properties Pros Easy Uses native BTRFS tools Can be ...
Answer
#1: Initial revision
# A convenient but a little risky method **Don't do this unless you have backups on a separate drive, and are prepared to restore from them.** ## Properties ### Pros - Easy - Uses native BTRFS tools - Can be done on a live system, even if `/` is on this filesystem. - Though you will need to update mount configs, initramfs and bootloader if you intend to boot into the migrated filesystem. ### Cons - The filesystem on the old drive will be left unusable. - An interruption (like powerloss) during the operation can lead to data loss. ### Neutral - This method will leave the filesystem UUID unchanged, so you don't have to update your configs in places like `/etc/fstab`. ## Instructions We leverage the fact that BTRFS is a multi-drive capable filesystem. First we add the new drive to the filesystem, and then we remove the old one. BTRFS will take care of moving the data behind the scenes. Make sure that the new drive is at least as big as the old one. Don't create a new filesystem there prior. ```commandline # btrfs device add /dev/newdrive /path/to/the/filesystem # btrfs device remove /dev/olddrive /path/to/the/filesystem ``` [Dodumentation](https://btrfs.readthedocs.io/en/latest/btrfs-device.html#typical-use-cases) ## Notes - I speak of "drives" but this can mean any type of block device. E.g. a partition or an opened dm-crypt container. - This method generalizes to any number of drives. E.g. changing 2 drives from a 5 drive filesystem.