9

i like to backup my linux based NAS (small files like picutres) to an attached USB Disk with FAT32. For this i like to use rsync.

I know, that this will not work correct per default. rsync will sync the files again and again. I found this question and answers: How can I use rsync with a FAT file system?

But, even if I use the --modify-window=1 and --size-only option, all files are processed again. The log looks like, rsync tries to set permission/ownership on fat32, which will fail. rsync: chown "<filename>" failed: Operation not permitted (1)

Question is: is there a way to disable the "chown" command?

//Edit:

currently I use the following command: rsync -a --modify-window=1 --size-only /data/ /mnt/backup/. &

The Bndr
  • 274
  • 3
  • 8

2 Answers2

9

Just don't use the options for syncing owner/group. If you are using the --archive/-a option this includes those two, so instead specify the flags individually and leave those out. Check the man page for a list of what --archive implies.

David Spillett
  • 22,534
  • 42
  • 66
  • 7
    Thank you. `-a` stands for `-rlptgoD` looking at the man-pages, so I have to remove `p`for permissions `g` for group and `o` for ownership. So `-rltD` are the options, I have to use. And it works. – The Bndr Jan 17 '13 at 15:55
  • in my case it says that symlinks are not supported either on FAT, so `-l` has to be excluded as well – Dima Lituiev Jul 05 '17 at 16:37
2

I've been trying to figure out how to keep rsync from copying every file every time, for a long time, with no success. But I've just stumbled across the answer. It's a FAT32 short-filename issue; apparently, by default, Linux converts them to all lower case, which messes up rsync's ability to see that it's the same file on the source & destination.

The solution is to mount the FAT32 device with the 'shortname=mixed' option. I believe you also need to use utf8 charset, e.g. 'iocharset=utf8'. Then run rsync with params: -rtv --modify-window=1

On Debian with Trinity, I can right-click the FAT32 partition's icon on the desktop, Properties / Mounting, set Short Names to mixed, and make sure UTF-8 Charset is checked. Hopefully there's a way to make those the defaults for all FAT32 partitions, but I haven't looked for that yet.

  • I did not have that problem, because I changed later from FAT32 to NTFS. But your answer is an interesting point. Thank you! +1 – The Bndr Feb 19 '15 at 08:23