Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm running the latest version of Ubuntu, and have mounted a SMB share via a line in rc.local.

The share mounts correctly, and I can browse files freely, create new files, and then delete them without problems.

But when I try and rsync a directory onto the mounted share:

rsync -a --delete /MySource/ /SharedMountPoint/

I get lots of errors:

rsync: failed to set times on "/SharedMountPoint/SomeDir": Operation not permitted (1)

and similar errors about being unable to create temp files.

All the files and directories on the share are listed with numeric uid/guid - which I suppose is reasonable, as they were originally created via a sync from a windows box.

I have no great need for access control - its just a box on a LAN that me and my family use as a dropbox - I'd basically just like anyone to be able to access it (provided they've done basic authentication).

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

When mounting, use -o uid=youruid. Then, all files on that cifs share will be owned by you so that you can edit/remove them.
E.g.:

mount -o uid=1000 //nas/share /SharedMountPoint

You can find your numeric uid in /etc/passwd

grep `whoami` /etc/passwd | cut -d : -f 3

or:

id -u `whoami`
share|improve this answer
    
Ahh - that did it. I did try setting the uid in the mount, but I thought it had to be the uid associated with the target files. Thanks –  Visage Dec 30 '11 at 10:31
add comment

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.