FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Fri May 14, 2021 15:48



Post new topic Reply to topic  [ 3 posts ] 
rsync and ntfs-3g mapped xattr 
Author Message

Joined: Wed Jun 29, 2011 09:41
Posts: 2
Post rsync and ntfs-3g mapped xattr
Hello,

I am trying to use the feature documented in [1] for backup ntfs filesystems via Backuppc,
in a proxmox virtualization environment using LVM snapshots.

Currently i use SetACL[3] on windows for backup and restore of ACLs, but i would like
to leverage on the features in ntfs-3g.

I have setup the .NTFS-3G with the mapping file inside, and I can successfully rsync from the NTFS snapshot to
an ext4 filesystem mounted with the "user_xattr" option.

My problem is that if I rsync back from ext4 to ntfs-3g (or even if the source is ntfs-3g), rsync fails to copy the user.ntfs_dos_name attribute,
*only on files* (directories are fine).

rsync and ntfs-3g are the latest stable versions:

rsync --version
rsync version 3.0.8 protocol version 30

ntfs-3g --version
ntfs-3g 2011.4.12 integrated FUSE 27

cp -av is working fine.
Am I right to ask here or better to direct my requests to rsync support?

Thanks,
rob

[1] http://www.tuxera.com/community/ntfs-3g ... ttributes/


Wed Jun 29, 2011 13:45
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: rsync and ntfs-3g mapped xattr
Hi,

Quote:
My problem is that if I rsync back from ext4 to ntfs-3g (or even if the source is ntfs-3g), rsync fails to copy the user.ntfs_dos_name attribute,
*only on files* (directories are fine).

Well, I have been able to replicate the issue. You have used an extended attribute mapping of system.ntfs_dos_name to user.ntfs_dos_name on your work ntfs directory, but not on your backup ntfs directory (and obviously not on your ext4 backup directory). Your backup is probably correct both on ext4 and ntfs.

What happens is that rsync first creates a temporary file and attaches all attributes to the temporary file, then it renames the file to the expected name.

But, in ntfs-3g, renaming a file means linking the new name, and unlinking the old one, including its DOS variant. So the latter is lost in the process.

Keeping the DOS name when renaming would be difficult with the current design of ntfs-3g. It would also break the similarity of long name and DOS name which may be desirable in some situations.

Luckily rsync has an option "--inplace" to create the files without renaming :
Code:
# on source computer (10.0.0.30) :
[linux@pavilion2 doc]$ rm -f test-file
[linux@pavilion2 doc]$ touch test-file
[linux@pavilion2 doc]$ ls -l test-file
-rw-r--r-- 1 linux linux 0 Jun 29 16:27 test-file
[linux@pavilion2 doc]$ setfattr -n user.ntfs_dos_name -v DOS-NAME test-file
[linux@pavilion2 doc]$ getfattr -n user.ntfs_dos_name test-file
# file: test-file
user.ntfs_dos_name="DOS-NAME"

# on target computer :
[linux@dimension ntfs-3g]$ cat /media/tmp/.NTFS-3G/XattrMapping
system.ntfs_dos_name:user.ntfs_dos_name
[linux@dimension ntfs-3g]$ rm -f /media/tmp/testwrite/test-file
[linux@dimension ntfs-3g]$ rsync --inplace -tX 10.0.0.30:/shared/doc/test-file /media/tmp/testwrite/test-file
[linux@dimension ntfs-3g]$ getfattr -n user.ntfs_dos_name /media/tmp/testwrite/test-file
getfattr: Removing leading '/' from absolute path names
# file: media/tmp/testwrite/test-file
user.ntfs_dos_name="DOS-NAME"
[linux@dimension ntfs-3g]$ getfattr -n system.ntfs_dos_name /media/tmp/testwrite/test-file
getfattr: Removing leading '/' from absolute path names
# file: media/tmp/testwrite/test-file
system.ntfs_dos_name="DOS-NAME"
[linux@dimension ntfs-3g]$ ls -li /media/tmp/testwrite/test-file /media/tmp/testwrite/DOS-NAME
82 -rw-r--r-- 2 linux linux 0 Jun 29 16:27 /media/tmp/testwrite/DOS-NAME
82 -rw-r--r-- 2 linux linux 0 Jun 29 16:27 /media/tmp/testwrite/test-file


Quote:
Am I right to ask here or better to direct my requests to rsync support?

I hope the above solves your issue with no need to bother rsync support

Regards

Jean-Pierre


Wed Jun 29, 2011 16:41
Profile

Joined: Wed Jun 29, 2011 09:41
Posts: 2
Post Re: rsync and ntfs-3g mapped xattr
jpa wrote:

...

Quote:
Am I right to ask here or better to direct my requests to rsync support?

I hope the above solves your issue with no need to bother rsync support

Regards

Jean-Pierre


This is just *great*.

I was able to replicate your tests with --inplace, doing an rsync restore with not only ACLs, but also dos names, and NTFS attribs in place. Now I have only to verify that --inplace does not harms backuppc functionality (but I don't think so, since I will enable it only for restore operations, which are usually targeted to empty temporary folders.)

Many thanks and congratulations also for pushing forward this wonderful ntfs-3g.

bye,
rob

_________________
- rob


Thu Jun 30, 2011 16:27
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.