On 2015-08-04 00:58, John Ettedgui wrote:
On Mon, Aug 3, 2015 at 8:01 PM, Qu Wenruo <quwen...@cn.fujitsu.com> wrote:
Although the best practice is staying away from such converted fs, either
using pure, newly created btrfs, or convert back to ext* before any balance.

Unfortunately I don't have enough hard drive space to do a clean
btrfs, so my only way to use btrfs for that partition was a
conversion.
If you could get your hands on a decent sized flash drive (32G or more), you could do an incremental conversion offline. The steps would look something like this:

1. Boot the system into a LiveCD or something similar that doesn't need to run from your regular root partition (SystemRescueCD would be my personal recommendation, although if you go that way, make sure to boot the alternative kernel, as it's a lot newer then the standard ones).
2. Plug in the flash drive, format it as BTRFS.
3. Mount both your old partition and the flash drive somewhere.
4. Start copying files from the old partition to the flash drive.
5. When you hit ENOSPC on the flash drive, unmount the old partition, shrink it down to the minimum size possible, and create a new partition in the free space produced by doing so.
6. Add the new partition to the BTRFS filesystem on the flash drive.
7. Repeat steps 4-6 until you have copied everything.
8. Wipe the old partition, and add it to the BTRFS filesystem.
9. Run a full balance on the new BTRFS filesystem.
10. Delete the partition from step 5 that is closest to the old partition (via btrfs device delete), then resize the old partition to fill the space that the deleted partition took up. 11. Repeat steps 9-10 until the only remaining partitions in the new BTRFS filesystem are the old one and the flash drive.
12. Delete the flash drive from the BTRFS filesystem.

This takes some time and coordination, but it does work reliably as long as you are careful (I've done it before on multiple systems).


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to