![](https://seccdn.libravatar.org/avatar/77cb4da5f72bc176182dcc33f03a18f3.jpg?s=120&d=mm&r=g)
On 2017-07-23 22:17, Juan Erbes wrote:
They are many ways to do this job, like:
dd if=/dev/sda1 of=/dev/sdb1 bs=1048576
But this riski and it duplicates the UUID of the hard disks.
The risk with dd is that you make a mistake and write to some unintended place and destroy it. Otherwise, it is pretty safe if the partitions are the exact same size. Well, you can probably change the UUID and Label afterwards, which can be done with btrfstune (see man page). The destination can be bigger size, but then you have to grow the filesystem, and this is risky: https://www.suse.com/es-es/support/kb/doc/?id=7018329 https://www.suse.com/documentation/sles-12/singlehtml/stor_admin/stor_admin.... https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs-filesystem
Other more civilized way is with send btrfs:
The steps to "clone" /source to /target are:
Get a list of subvolumes ordered by ogen: btrfs subvolume list -qu --sort ogen /source. Sorting is probably enough to guarantee that snapshots or subvolumes which depend on previous ones are handled first. This is important for dealing with Copy-on-Write, because we need to have the base volumes transferred first.
Ah. This seems better. Good find!
https://superuser.com/questions/607363/how-to-copy-a-btrfs-filesystem
Notice that this is a support forum like this. Ie, not a categorical procedure. There is another interesting method here: https://unix.stackexchange.com/questions/63528/how-to-clone-btrfs-filesystem... Still, if your idea is to upgrade the resulting system to a new release, you should still consider installing fresh, because the new release may have a different subvolume structure. -- Cheers / Saludos, Carlos E. R. (from 42.2 x86_64 "Malachite" at Telcontar)