Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm backing up a linux server to a windows share. I'm currently mounting the windows share with cifs and using rsync for incremental backups. File permissions and ownership are not being preserved, as should be expected after reading this samba document:

The core CIFS protocol does not provide unix ownership information or mode for files and directories. Because of this, files and directories will generally appear to be owned by whatever values the uid= or gid= options are set, and will have permissions set to the default file_mode and dir_mode for the mount.

How can I achieve my goal of preserving unix file permissions while writing to a windows share? Is there another network file system that would allow me to do this?

Thanks.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

The CIFS protocol has an extension to add support for POSIX file permissions (not sure about ACLs), which is already part of Samba. If you install Services for Unix (or whatever Microsoft calls it now), it should add this feature to Windows too. In addition, SfU comes with both server and client for NFSv3, which has been designed for Unix filesystems.

share|improve this answer

Edit: As grawity points out MS has an add on package for this. Read his answer first.


It's not just the network file sharing protocol that doesn't save that kind of permission data, the windows file system itself doesn't have places for that data to go*. The only way to do this would be to add some kind of layer on top of windows to both have a file system and network protocol with those capabilities. This could be a virtual machine with a disk image, or crazy magic with cygwin, or special windows drivers, but it's all going to require some measure of work.

If your use case is really simple you like backups, you might consider using tar for instead. Or rsnap. These can make single file objects of your data with all the file permission data embedded inside, then you can compress them and send them across the network to whatever file system you like. There are even ways to deal with incremental data updates. This might be a low-tech way to solve your issue.

* unless you add in their Services for Unix toolset which sets up a comparability layer and stores the extra permission data ... somwhere.

share|improve this answer
    
If I switched to a unix share and mounted it over NFS, would I have this issue? –  weberwithoneb Jun 22 '11 at 18:35
1  
@weberwithoneb: No. If the remote file system has POSIX permission abilities and you share it with NFS, you would not have this issue. –  Caleb Jun 22 '11 at 18:36
1  
Furthermore, you wouldn't have to mount it at all however, rsync is capable of using several network protocols (it's own, ssh, etc) to send files. The real problem is that the target file system has to support permissions and magic like that. –  Caleb Jun 22 '11 at 18:39
    
Thanks for the info. –  weberwithoneb Jun 22 '11 at 18:47
    
@Caleb: CIFS does support Unix permissions, and Windows has "Services for Unix" to add support for the extension. –  grawity Jun 23 '11 at 8:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.