Fix for UpdateError when backing up to NFS which doesn't preserve chown
This is just to document a repeated error I was getting with rdiff-backup in
the hope that it will be useful to someone, and to let you know I produced a
small patch to correct it. Fix can be found attached to the bug report.
After an OS upgrade, all changed files with multiple hard links failed to be
backed up reporting "Update mirror temp file ... does not match".
UpdateError bin/red Updated mirror temp file
/mnt/autofs/backup/bin/rdiff-backup.tmp.1 does not match source
UpdateError lib/terminfo/v/vt100-am Updated mirror temp file
/mnt/autofs/backup/lib/terminfo/v/rdiff-backup.tmp.341 does not match
UpdateError lib/terminfo/v/vt220 Updated mirror temp file
/mnt/autofs/backup/lib/terminfo/v/rdiff-backup.tmp.342 does not match
UpdateError sbin/dmevent_tool Updated mirror temp file
/mnt/autofs/backup/sbin/rdiff-backup.tmp.345 does not match source
UpdateError sbin/fsck.ext2 Updated mirror temp file
/mnt/autofs/backup/sbin/rdiff-backup.tmp.346 does not match source
UpdateError sbin/fsck.ext3 Updated mirror temp file
/mnt/autofs/backup/sbin/rdiff-backup.tmp.347 does not match source
UpdateError sbin/fsck.ext4 Updated mirror temp file
/mnt/autofs/backup/sbin/rdiff-backup.tmp.348 does not match source
UpdateError sbin/fsck.ext4dev Updated mirror temp file
/mnt/autofs/backup/sbin/rdiff-backup.tmp.349 does not match source
It is because I was backing up to an NFS share which didn't preserve uid and
gids. Instead they were all mapped to nobody.
# cd /backup
# touch foo
# chown bin:bin foo
# ls -l foo
-rw-r--r--. 1 nobody nobody 0 May 7 20:52 foo
Chown reports succcess but, but on querying the uid and gid it always
reported 99, 99 (nobody, nobody). For single linked changed files I assume
that rdiff-backup gets the uid/gid from the source. However for an updated
file with multiple hard links rdiff-backup creates the hard link on the
destination and checks the uid/gid match the metadata. This fails resulting
in the "Updated mirror temp file" error message.
Fix by making rdiff-backup confirm the uid/gid actually changes when testing
the backup destination before enabling the ownership changing ability.