rsync from linux host to fat32
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/. &
Solution 1:
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.
Solution 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.