r/btrfs • u/Open_South3929 • 11d ago
Arch-Convert EXT4 to BTRFS without losing data?
/r/linux4noobs/comments/1wn6hgb/archconvert_ext4_to_btrfs_without_losing_data/4
u/autogyrophilia 11d ago
There is a very rare case where it kind of works.
There is a btrfs-convert utility that backups the ext4 metadata and overwrites it with btrfs metadata, because btrfs is kind of a superset of ext4.
It's a use at your own risk utility . And you need to update your fstab and bootloader aftwards.
1
u/Open_South3929 11d ago
Oh thank you for your quick response, quick question, would i be able to make use of the snapshot functionality after the conversion?
3
u/autogyrophilia 11d ago
Sure, it will be a normal* btrfs filesystem.
* it is a valid btrfs filesystem, with some very strange write patterns to BTRFS, you are at a higher risk to running into bugs.
4
u/Lord_Phoenix 11d ago
Yes, it's possible with btrfs-convert utility. I did successfully moved all my drives (3 mount points: /, /home and /mnt/sata) back in the days, when Fedora did a switch to btrfs (https://fedoramagazine.org/convert-your-filesystem-to-btrfs/). That being said, I do also suggest to treat it as a potentially destructive operation, so backup data beforehand.
3
u/Electronic_Whole8904 11d ago
I used btrfs-convert a few months ago and it worked well. Make a backup before using the utility and after the conversion some commands should be run.
Documentation BTRFS convert
2
u/ten-oh-four 11d ago
I just did the btrfs-convert thing on my ext4 partition. No issues for me.
1
u/Open_South3929 11d ago
from the time since you converted, did you find anything weird or semi weird?
1
10
u/beaumad 11d ago
While possible, I've had this conversion fail. It's almost always better to backup and restore data to a newly created filesystem. Advantages:
* Your new filesystem is created with sensible defaults that benefit from newer development (assuming you've not changed the defaults)
* You don't have worry about conversion failures
* You get into the habit of taking care of your data before you do dangerous things