Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a btrfs device mounted, it is composed of 2 partitions and it is in single mode (the partitions does not have the same size so I can't use raid 0 ).

I have another disk formatted in ext4, I know I can convert it to btrfs without data loss but Can I add it (once converted) to the first btrfs without losing data on both ?

And even if this is possible, is this a good solution over backing up and restoring all datas ? (about fragmentation)

share|improve this question

I wanted to know the same. I think you can probably do it using btrfs send and btrfs receive to send the data from the first to the second. You can then delete the first filesystem and add the device to the second filesystem as a new device.

This assumes that there is enough space on the second device to hold all the data during the transfer.

You'd have to make a read-only snapshot of the first filesystem (as you can only send read-only subvolumes), send it to the second filesystem and then make a read-write copy into the desired destination.

UNTESTED but something like:

btrfs subvolume snapshot -r /first/ /first/snapshot
btrfs send /first/snapshot | btrfs receive /second/
btrfs subvolume snapshot /second/snapshot /second/whatever
btrfs subvolume delete /second/snapshot

[then delete the first filesystem and reuse the device in the second filesystem]

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .