I finally converted my desktop machine from Windows Vista to Lubuntu 13.04. I am having trouble getting the unison file sync program (version 2.40.65) to work on the Lubuntu machine, despite trying very hard all afternoon googling through various forums.

Here is the basic setup: Lubuntu desktop machine (DTM); Dlink Network accessed storage device (NAS), which is mounted on DTM as /mnt/nas (in fstab, cifs, defaults).

Unison works going from NAS to DTM. However if a file is created or updated on DTM, unison fails to propagate over to NAS. It creates a new file .unison.newfile.XXXX.unison.tmp with the correct size in the NAS destination directory, but unable to rename it. The exact error message is Failed: error in digesting .unison.newfile.XXXX.unison.tmp .unison.newfile.XXXX.unison.tmp: permission denied. If I run Unison under sudo, then changes from DTM do propagate over to the NAS. However, changes from the NAS side get copied to DTM as root, which causes endless trouble for m

By the way, on my old Windows Vista, I ran Unison under Cygwin without having any problem.

Your answer is greatly appreciated. Thank you.


I figured out the answer. it turns out to be not Unison related, but has every thing to do with how the NAS is mounted on the local Linux machine.

In /etc/fstab, I used

// /mnt/nas cifs defaults   0   0

Now I am mounting using

// /mnt/nas cifs guest,rw,uid=1000,gid=1000,nounix,iocharset=utf8,file_mode=0644,dir_mode=0755 0 0

Unison is working smoothly now. The key is that the mounted uid and gid should match the uid and gid on the local machine, which is NOT the case when using the defaults option. Therefore Unison was running into all kinds of permission related problems.

I hope this is helpful to others encountering similar problems.


There's an alternate solution that is probably worth sharing: If you call unison with -dontchmod it runs fine for me.

Note that you cannot sync permissions as direct consequence, though, and need to additionally specify -perms 0, at least for my version of unison.

Furthermore, your solution seems to fail for me if I specify the nounix flag. Could be due to my setup, though. (I would like to put this last part as a comment, but I don't have enough rep)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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