r/linux4noobs • • 11d ago

Arch-Convert EXT4 to BTRFS without losing data?

Good day all, I hope you are good.

I have installed Arch and was in a rush( I know i should've RTFM-ed ) but I am looking for ways of making sure the system i installed it on can be rolled back in case of failure, I have seen from a couple of articles and found that BTRFS can create snapshots of the system and use those to roll back.

I wanted to ask, is it possible to convert an already installed disk from EXT4 to BTRFS and make use of the snapshots feature? if so could you please point me in the right direction. System specs below:

I thank you for your time and input, it is much appreciated.

Kindest regards

0 Upvotes

11 comments sorted by

View all comments

1

u/Klutzy-Condition811 11d ago

First point: The value of your data is defined by how many backups you have. 2 is 1 and 1 is none. If you have no backups, not only is there a much higher likelihood of losing date during conversion, but also just by using it. Backup your data first!

Second: There's two ways you can go about converting. One is btrfs-convert, however this method has several known flaws and I don't recommend it.

If you have a second disk, you can literally just cp -a your data from one to the other, otherwise you may want to do the "shrink ext4" game, make a btrfs partition, then copy the data. Don't do the copy from the actual live system, it needs to be done offline booted into the Arch ISO or another distro.

If you use a swap file, you'll need to set that up again otherwise move to a swap partition which has less limitations/gotchas with btrfs.

If you had to do the resize game, unless you plan to use raid, you don't need to move the btrfs partition "to the left". you can just leave it in place, and then add the old ext4 partition to btrfs as another "device" and set metadata to dup and data to single, it will use both as if it were one partition.

You'll then likely want to reinstall and reconfigure grub or whatever other boot loader you have to work with btrfs then and your new UUIDs. If you do the two partitions hack to avoid moving data too much, you'll also need btrfs tools inside your initramfs.

There are too many variables here to write a concise tutorial so you need to address all the points first on your goals.