Cloning root partition to another disk ...with BTRFS

I have a simple question which so far I haven’t been able to find a simple answer for:

How do I clone my BTRFS root partition (all subvolumes) onto another BTRFS root partition (same size) on another disk, and make it bootable? This is to make a hot-swap backup disk.

(NOTE: I’ve done this before pre-BTRFS, but just discovered that with BTRFS, cpio and rsync aren’t sufficient anymore.)

The easiest way would seem to be ‘dd’ to move the bits over since the
disks are the same size. Where ‘sda’ is the source and ‘sdb’ is the

sudo dd if=/dev/sda of=/dev/sdb bs=1048576
#and then wait for a long time.

Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the
forum as I do not use the web interface often.

The above advice will copy a whole disk of course and not just the partition. So for copying “only” the partition, the partition number should be added. Example:

dd if=/dev/sda1 of=/dev/sdb1 bs=1048576

And of course you must do this (as root) from a system that is not using (let alone being booted from) either of those partitions. Use e.g. a rescue system or other live system.

you might find this thread interesting, we where discussing how to do this, stratacast1 [17th January 2017, 04:47 PM] eventually uses the btrfs replace command (1 single command - automatically modifies fstab etc!), a second viewer also confirms the method.

it modifies (invalidates) source device so probably not suitable for intended “hot backup” use.

correct, note to self for the 10th time - read the entire question before answering

Thanks for the responses!

1) dd

I don’t really want to use dd, because it results in 1) duplicate UUIDs preventing simultaneous mounting/use, and 2) takes a long time (I’d already read this thread).

2) btrfs replace

This sounds closer to what I need, but as arvidjaar indicated, it’s unacceptable for building a “hot backup” (Writing to the source disk is unacceptable. It cannot write to the source partition; that’s the master copy!) It’s also not clear whether it replicates the subvolume structure of the partition.

**QUESTION?: **Does anyone know of a way to mirror a BTRFS root file system (including subvolumes) 1) without modifying the source partition, and 2) in such a way that source and dest can both be mounted?

(Just FYI, the reason I’m barking up this tree is I installed OpenSUSE 42.2 on a server at home, and the root partition is BTRFS and has *21 subvolumes! *Ordinary partition mirroring tricks (rsync, cpio, etc.) just don’t cut it. So far, it seems like letting OpenSUSE 42.2 use BTRFS on the root partition may not have been a good idea…)

Well use dd but change the boot to use by-id rather then UUID. This symbology uses the disk ID thus keeps cloned partition separate since there is no chance for duplicate symbols on partitions in the boot process with the cloned partitions.


You must NEVER present original and cloned btrfs at the same time. It has absolutely nothing to do with what link in user space you use to access individual device.

Don’t mount the cloned partition you don’t need to make cloned backup.

to educate my ignorance, can btrfs send receive not be used for this? (since it sends diffs, it would be absurdly fast if it matched your requirements)

from a brief google:
this guy has a script using it also here + many others