rsync --xattrs w/ nfs

kitepilot at kitepilot.com kitepilot at kitepilot.com
Sat Apr 24 12:20:11 MST 2010


sshfs is a fuse filesystem implementation over SSH.
All you need is the "Subsystem sftp" line on the receiving end 
/etc/ssh/sshd_config (which most everyone has) and to load the sshfs kernel 
modules (apt-get install sshfs in *Debian) 

Then you (need no root privileges):
sshfs user at remote_system:/path/to/mount /my/local/path 

And you are done...   :) 

You umount it with
fusermount -u /my/local/path 

It is almost always true that "if you can SSH into, you can mount".
If you need to access the mount as "root" you need to do some simple sorcery 
(as you would need on NFS too), but for the most part, it is brain dead.
YMMV...
ET 

PS: If you have any question you will get any answer...   :) 

 

Eric Shubert writes: 

> I haven't tried sshfs. Don't know much at all about that.
> rsync over ssh worked fine though.
> I agree, NFS suuuux. I might look into NFS4 at some point, but I can't say 
> I'm looking forward to it. 
> 
> kitepilot at kitepilot.com wrote:
>> Just wondering...
>> Can you ditch NFS and do sshfs?
>> NFS suuucks...
>> ET 
>> 
>> 
>> Eric Shubert writes:
>>> Eric Shubert wrote:
>>>> Eric Shubert wrote:
>>>>> I could use a little help.
>>>>> I'm trying to rsync w/ --xattrs to a mounted nfs filesystem, and get 
>>>>> the following error on each file:
>>>>> rsync_xal_set: lsetxattr user.DOSATTRIB failed: Operation not 
>>>>> supported
>>>>> The rsync works fine w/out the --xattrs option. This appears to 
>>>>> indicate that xattr isn't enabled on the destination side.
>>>>> Both hosts are running current CentOS5.4, and I'm running as root 
>>>>> (just for testing).
>>>>> The source files contain the user.DOSATTRIB attributes from samba:
>>>>>         map archive = no
>>>>>         map hidden = no
>>>>>         map read only = no
>>>>>         map system = no
>>>>>         store dos attributes = yes
>>>>>         dos filemode = yes
>>>>> and the source filesystem (ext3) has xattr enabled:
>>>>> # tune2fs -l /dev/mapper/VolGroup00-LogVol00 | grep attr
>>>>> Filesystem features:      has_journal ext_attr resize_inode dir_index 
>>>>> filetype needs_recovery sparse_super large_file
>>>>> Default mount options:    user_xattr acl
>>>>> The remote host has xattr enabled as well:
>>>>> # tune2fs -l /dev/md7 | grep attr
>>>>> Filesystem features:      has_journal ext_attr resize_inode dir_index 
>>>>> filetype needs_recovery sparse_super large_file
>>>>> Default mount options:    user_xattr acl
>>>>> I've added user_xattr specifically to the fstab entry on the 
>>>>> destination side, in case the default mount option wasn't taking:
>>>>> # cat /etc/fstab | grep md7
>>>>> /dev/md7       /udat       ext3    user_xattr,acl  1 2
>>>>> Autofs mounts nfs with the following options:
>>>>> -async,auto,rw,suid,user_xattrs,acl,fstype=nfs,rsize=32768,wsize=32768 
>>>>> ,i ntr  
>>>>> 
>>>>> I'm guessing that nfs is likely the problem, but from googling a bit, 
>>>>> it appears that nfs should pass xattr values just fine. Perhaps this 
>>>>> is incorrect.
>>>>> Does anyone have an idea why I'm getting this error?
>>>>> Solution?
>>>>> TIA.
>>>> 
>>>> On further review, it appears that nfs on COS5.4 doesn't support 
>>>> xattrs. I'll try mounting with cifs and see how that works. I'm 
>>>> guessing it'll work better, given that rsync and samba come from the 
>>>> same place for the most part. ;)
>>> 
>>> Just for the record, mounting with cifs didn't work either. /proc/mounts 
>>>  did not show the xattrs option in either case. So I'm guessing that 
>>> xattrs on a remote cifs is just not supported yet, although I'm not 
>>> quite certain what is missing. The kernel appears to have xattr enabled:
>>> # grep -i attr /boot/config-2.6.18-128.2.1.el5
>>> CONFIG_RAID_ATTRS=m
>>> CONFIG_SCSI_SPI_ATTRS=m
>>> CONFIG_SCSI_FC_ATTRS=m
>>> CONFIG_SCSI_ISCSI_ATTRS=m
>>> CONFIG_SCSI_SAS_ATTRS=m
>>> CONFIG_EXT2_FS_XATTR=y
>>> CONFIG_EXT3_FS_XATTR=y
>>> CONFIG_EXT4DEV_FS_XATTR=y
>>> # CONFIG_JFFS2_FS_XATTR is not set
>>> CONFIG_CIFS_XATTR=y
>>> Anyone know why xattrs on a (mounted) remote fs (nfs and/or cifs) 
>>> wouldn't work? I think the code for NFS isn't in the COS5 kernel, but I 
>>> really expected cifs would work.
>>> Anyhow, I just rsync'd w/ --xattr over ssh and that worked fine.
>>> Moving on. :)
>>> -- 
>>> -Eric 'shubes'
>>> ---------------------------------------------------
>>> PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
>>> To subscribe, unsubscribe, or to change your mail settings:
>>> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>  
> 
> -- 
> -Eric 'shubes' 
> 
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


More information about the PLUG-discuss mailing list