Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.