Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xattrs are not copied #29

Open
rzlourenco opened this issue May 31, 2020 · 3 comments
Open

xattrs are not copied #29

rzlourenco opened this issue May 31, 2020 · 3 comments

Comments

@rzlourenco
Copy link

First of all, thank you! Very handy tool. I am attempting to convert from XFS to ext4 (to allow shrinking) and noticed that xattrs are not preserved. What are your thoughts on this matter?

@cosmos72
Copy link
Owner

I have never used xattrs, and fstransform does not copy them...
It's surely worth adding, in the next weeks I will try to extract the relevant from GNU 'cp'

@YihaoPeng
Copy link

There is another problem here, xattr +i will prevent the file from moving, thus interrupting the conversion.

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

@cosmos72
Copy link
Owner

cosmos72 commented Apr 17, 2021

Commit c1bd8c5 adds initial support to copy xattrs using ioctl(FS_IOC_FSSETXATTR)

Among other things, it correctly manages both xattr +i (immutable) and xattr +a (append-only), which must be handled specially because:

  • immutable files cannot be deleted or truncated: the immutable xattr must be removed first
  • append-only files may not be truncated: append-only xattr must be removed first

Truncate is required if filesystem is almost full: fsmove copies the file backward and progressively truncates it to preserve space.

It does not yet manage xattrs on directories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants