9

I am trying to so a simple rsync to a USB hard disc, the command is

rsync -az --modify-window=2 /home /mnt/exthd/tmp/

I am running this as root.

but I get a lot of errors that all seem to relate to insufficient permissions :

rsync: chown "/mnt/exthd/tmp/home/someuser" failed: Operation not permitted (1)
rsync: chown "/mnt/exthd/tmp/home/someuser/.bash_logout" failed: Operation not permitted (1)
rsync: chown "/mnt/exthd/tmp/home/someuser/.bash_profile" failed: Operation not permitted (1)
rsync: chown "/mnt/exthd/tmp/home/someuser/.bashrc" failed: Operation not permitted (1)
rsync: chown "/mnt/exthd/tmp/home/guest" failed: Operation not permitted (1)
rsync: chown "/mnt/exthd/tmp/home/guest/.bash_logout" failed: Operation not permitted (1)
rsync: chown "/mnt/exthd/tmp/home/guest/.bash_profile" failed: Operation not permitted (1)
rsync: chown "/mnt/exthd/tmp/home/guest/.bashrc" failed: Operation not permitted (1)
rsync: symlink "/mnt/exthd/tmp/home/guest/fred2" -> "fred" failed: Operation not permitted (1)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1042) [sender=3.0.7]

This is version 3.0.7. I have tried using the --super option to no effect. Any ideas?

  • What is the file system on the USB disk? – Caleb Aug 2 '11 at 9:25
  • Is the external disk formatted as FAT(32)? That wouldn't work as FAT doesn't know file ownership attributes. – Sven Aug 2 '11 at 9:25
  • @Caleb I would guess that it is FAT, though how do I tell? – Tim the Enchanter Aug 2 '11 at 9:31
  • Running mount | grep /mnt/exthd should tell you. – Caleb Aug 2 '11 at 9:33
  • @Caleb is says vfat – Tim the Enchanter Aug 2 '11 at 9:49
14

The FAT file system (which Linux's mount calls vfat) is not able to store some of the permission and ownership data that is stored about your files on the Linux side.

Your options seem to be:

  • Format the disk with ext3/4 or some other file system that supports these attributes. I think even NTFS would do the job if you are sharing with Windows.
  • Store those extra properties using the --fake-super option so rsync writes xattrs in the file instead of using the file system attributes
  • Ignore the error, those properties will just be lost.
  • Wrap your data set in a tar file and put the tar file on FAT system. All the attributes are maintained and will be present if you ever extract it.
  • --fake-super doesn't work either, though the error changes from Operation not permitted (1) to Operation not supported (95) – Tim the Enchanter Aug 2 '11 at 10:12
  • Hm. You could use --no-owner to not try to set the owner to match. (FAT has no owner property) and possible --no-perms as well. – Caleb Aug 2 '11 at 10:15
  • thanks for your help, really good, still doesn't work though the error has changed again, each error line now has rsync: failed to write xattr user.rsync.%stat at the beginning. – Tim the Enchanter Aug 2 '11 at 10:19
3

Rsync is trying an operation (chown and symlink) that the filesystem doesn't allow, or cannot perform. I'm guessing your external HD has a FAT filesystem.

If you want to make a proper backup, you might want to use tar.

  • 1
    Or a decent filesystem. – womble Aug 2 '11 at 9:47
  • FAT is more like a file repository, not filesystem. :-) – Janne Pikkarainen Aug 2 '11 at 10:11
  • Personally - I hate rsync. I've seen too many errors of different types when using it to copy files and directories from my MAC to a network share on my router that uses the NFS file system. I've also had to reformat that drive multiple times because rsync created files that were locked and could not be deleted. The reason I kept trying to use rsync vs cp was that it supports exclude filters and it is supposed to be faster. In the end, I wrote a couple of very simple Java classes - Copy.java and CopyJob.java which is a Runnable to support multi-threading and added support for filters...:) – jrobertsz66 Aug 3 '16 at 15:21

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.