fstransform
fstransform copied to clipboard
BTRFS Support
Hi,
As it is clear from the title, I am looking to convert my home XFS partition to something else, that can be shrunk without data loss. The choice has fallen to BTRFS so I would like to ask if this is supported or if it is intended to be, at some point in the future.
As a workaround, perhaps it might be possible to do two rounds, i.e. XFS -> EXT4 and then EXT4 -> BTRFS. I believe I have seen something about online conversion of EXT4 to BTRFS.
Edit: btrfs-convert
is available for the potential workaround of converting ext4 to btrfs.
Last time I tested fstransform with btrfs, I got kernel errors. But that was some years ago... let's hope btrfs is more solid now.
The alternative to use fstransform for xfs -> ext4, followed by dedicated tool for ext4 -> btrfs is more complex but very probably safer
There have been some decent improvements lately. I've had only positive experiences so far, but it's just a desktop PC. I'm running the conversion to ext4 at the moment. Thanks for a great tool and the consideration! I thought I was screwed with this drive due to openSuse defaults.
My friends and I have done the conversion from ext4
to btrfs
several times, and it successfully completed every time.
The only problem is the file with the prohibiting modification flag (chattr +i
), it will interrupt fsmove
and require manual operation.
Like this:
09:32:18 fsmove: progress: 1.9% done, 110.6 gigabytes still to move
09:32:34 fsmove: progress: 3.8% done, 108.5 gigabytes still to move, estimated 10 minutes left
09:32:36 fsmove: ERROR: failed to open source file `/tmp/fstransform.mount.14309/var/lib/deepin/deepin_security_verify.whitelist': Operation not permitted
09:32:36 ERROR! fstransform: command '/usr/sbin/fsmove -- /tmp/fstransform.mount.14309 /tmp/fstransform.loop.14309 --exclude /tmp/fstransform.mount.14309/.fstransform.loop.14309' failed (exit status 255)
this is potentially a problem.
you can either quit now by pressing ENTER or CTRL+C,
or, if you know what went wrong, you can fix it yourself,
then manually run the command '/usr/sbin/fsmove -- /tmp/fstransform.mount.14309 /tmp/fstransform.loop.14309 --exclude /tmp/fstransform.mount.14309/.fstransform.loop.14309'
(or something equivalent)
and finally resume this script by typing CONTINUE and pressing ENTER: CONTINUE
10:33:21 fstransform: unmounting and running '/usr/sbin/fsck' (disk check) on loop file '/tmp/fstransform.mount.14309/.fstransform.loop.14309'
10:33:22 fsck: fsck from util-linux 2.33.1
I have to run the following command to continue:
sudo chattr -i /tmp/fstransform.mount.14309/var/lib/deepin/deepin_security_verify.whitelist
sudo rm /tmp/fstransform.loop.14309/var/lib/deepin/deepin_security_verify.whitelist
sudo /usr/sbin/fsmove -f -- /tmp/fstransform.mount.14309 /tmp/fstransform.loop.14309 --exclude /tmp/fstransform.mount.14309/.fstransform.loop.14309
The -f
parameter is required for fsmove
, otherwise it will exit because the folder already exists.
In addition, fsremap: clearing xxx gigabytes free-space from device ...
is also very slow. But it can finally be done.
10:33:54 fsremap: starting in-place remapping. this may take a LONG time ...
10:35:21 fsremap: progress: 3.2% done, 110.4 gigabytes still to relocate
11:11:06 fsremap: progress: 83.8% done, 21.3 gigabytes still to relocate, estimated 7 minutes left
11:18:23 fsremap: clearing 1.49 gigabytes free-space from device ...
11:56:59 fsremap: job completed.
11:56:59 fstransform: running again '/usr/sbin/fsck' (disk check) on device '/dev/sda4'
11:56:59 fsck: fsck from util-linux 2.33.1
11:56:59 fstransform: completed successfully. device '/dev/sda4' now contains 'btrfs' file-system