3

I encountered the error when attempting to transfer source files from a remote Linux web server to a local HP dt1000i Desktop Hard Drive connected to an Ubuntu 12.10 box via USB.

A Samba share is configured for the HP drive to enable the Windows machines on my LAN to access the files. Samba was set up using the built-in graphical folder sharing functionality within Ubuntu. I can modify the files fine in Windows, but problems occur using rsync.

When the error occurred, I was trying to use rsync to backup files from my web space to the HP drive. I executed the rsync command in PuTTY from a Windows 8 machine on my LAN:

rsync -avz --progress --partial -e 'ssh -p 2222' user@www.example.com:/home/user/ /media/HPDesktopDrive/Backup/HostGator/

This resulted in the following error: rsync: failed to set permissions on "/path/to/file.txt": Operation not permitted (1).

I thought the source of the error was the mount options for the HP drive in the /etc/fstab file: both the user_id and group_id options were set to zero so I tried change them to 1000 as per the advice in NAS box mounted via CIFS - problem with permissions.

An ls -la of the Samba share reports that the user and group are recursively set to root:root. I tried to address this by executing sudo chown -R mike:mike /media/HPDesktopDrive/, but the files are still set to root:root.

What is the correct command to change the permissions from my Windows machine via PuTTY and will this address the problem?

  • Related: http://unix.stackexchange.com/questions/10044/why-do-i-get-an-rsync-failed-to-set-times-on-operation-not-permitted-1 – slm Feb 04 '14 at 19:55

1 Answers1

3

Chances are, this falls into one of the following:

  • There is an ACL that the webhost supports, which the Samba drive does not support.
  • You are rsync'ing files from the webhost to the Samba share as a user, which does not have rights to chown files.
  • A mounted filesystem will not necessarily allow all permissions/acl/ownership details to be available for change.

As for the Samba share, you may need to setup the share to allow for unique ownership of files, which may mean a need to add additional accounts to HP unit.

  • 1
    Thanks for your reply. For what it's worth, the problem was caused by incorrect syntax in the /etc/fstab file: user_id and group_id as opposed to uid and gid. The drive is now mounted with mike:mike permissions and the problem is resolved. – unpossible Apr 14 '13 at 10:14
  • Nice. Glad you found the root cause! – Wing Tang Wong Apr 15 '13 at 04:51