bugrdiff-backup - Bugs: bug #26796, Hardlinked files not backed up...

 
 

bug #26796: Hardlinked files not backed up because of UpdateError/Updated mirror temp file does not match source

Submitter:  Joe Steele <j_steele>
Submitted:  Sat 13 Jun 2009 08:23:55 PM UTC
Votes: 3
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Duplicate
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 24 Feb 2020 10:28:12 AM UTC, comment #2: 

Closing because handled in GitHub (see previous comment).

Eric L. <ericzolf>
Group administrator
Sun 19 Jan 2020 05:40:03 AM UTC, comment #1: 

I have now submitted the attached patch as part of this GitHub pull request:

https://github.com/rdiff-backup/rdiff-backup/pull/241

Joe Steele <j_steele>
Sat 13 Jun 2009 08:23:55 PM UTC, original submission:  

When I attempted to back up a CentOS-4 system to a CentOS-5 system using rdiff-backup v. 1.2.8, all of the hard-linked files were omitted from the backup with errors saying "Updated mirror temp file does not match source".

A couple specific examples of the errors:

| UpdateError bin/gzip Updated mirror temp file /var/lib/safekeep/lan3/bin/rdiff-backup.tmp.40 does not match source
| UpdateError bin/zcat Updated mirror temp file /var/lib/safekeep/lan3/bin/rdiff-backup.tmp.101 does not match source

Looking at the source system (CentOS-4), I see that gunzip, gzip, and zcat are hardlinked:


| [root@lan3 ~]# stat /bin/{gunzip,gzip,zcat}
|   File: `/bin/gunzip'
|   Size: 56080           Blocks: 128        IO Block: 4096   regular file
| Device: fd07h/64775d    Inode: 61202       Links: 3
| Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
| Access: 2009-06-13 04:02:12.000000000 -0400
| Modify: 2007-07-14 17:37:33.000000000 -0400
| Change: 2008-12-02 17:58:06.000000000 -0500
|   File: `/bin/gzip'
|   Size: 56080           Blocks: 128        IO Block: 4096   regular file
| Device: fd07h/64775d    Inode: 61202       Links: 3
| Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
| Access: 2009-06-13 04:02:12.000000000 -0400
| Modify: 2007-07-14 17:37:33.000000000 -0400
| Change: 2008-12-02 17:58:06.000000000 -0500
|   File: `/bin/zcat'
|   Size: 56080           Blocks: 128        IO Block: 4096   regular file
| Device: fd07h/64775d    Inode: 61202       Links: 3
| Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
| Access: 2009-06-13 04:02:12.000000000 -0400
| Modify: 2007-07-14 17:37:33.000000000 -0400
| Change: 2008-12-02 17:58:06.000000000 -0500
|


On the destination system (CentOS-5), the only file backed up (of these 3) was /bin/gunzip.  The other 2 were omitted because of the errors above. In all, there were 17,706 of these errors during the backup, all resulting from hardlinked files (as best I can tell -- I didn't do an exhaustive review of them).  The backup was made using LVM snapshot devices, so it wasn't a case of errors caused by files being changed during the backup.

Upon further investigation, I found that this bug is triggered by a difference in the way selinux attributes are saved under CentOS-4 vs. CentOS-5 (and yes, the backup included extended attributes and both systems use selinux).  Here's an example of the attributes on each system:

On CentOS-4:
| [root@lan3 ~]# getfattr -d -m '' /bin/gunzip
| getfattr: Removing leading '/' from absolute path names
| # file: bin/gunzip
| security.selinux="system_u:object_r:bin_t\000"

On CentOS-5:
| [root@lan3b ~]# getfattr -d -m '' /bin/gunzip
| getfattr: Removing leading '/' from absolute path names
| # file: bin/gunzip
| security.selinux="system_u:object_r:bin_t:s0\000"

As shown, CentOS-5 adds ":s0" to all of its selinux attributes.  This was triggering a bug in rdiff-backup, making it conclude that the source and destination hardlinks didn't match (which technically is true, but shouldn't matter since the attributes and other metadata are saved separately by rdiff-backup).

I am attaching a patch for backup.py (v. 1.2.8) that seemed to fix this bug for me.  With it, I could back up hardlinked files without error, and I could restore them with their original attributes intact.  I am not expert in the ways of rdiff-backup (or python in general), so this patch should be scrutinized by others with more expertise than me.  I have not, for example, investigated whether regressions of failed backups work properly.

This bug is triggered regardless of which direction the backup is made, and regardless of which system is the initiator of the backup.  I have also triggered the bug by putting phony security.selinux attributes on a couple hardlinked files on a non-selinux system (e.g., a sysrecuecd live CD), and then backed up the files to a selinux system (e.g., CentOS-4 or CentOS-5).

Joe Steele <j_steele>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #18258:  backup.py.patch.txt added by j_steele (616B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ericzolf (Posted a comment)
  • -email is unavailable- added by error (Voted in favor of this item)
  • -email is unavailable- added by libove (I have the same problem, rdiff-backup'ing between two CentOS 5.7 systems! A fix committed to the released codebase would be very nice. Thanks.)
  • -email is unavailable- added by nbecker (Voted in favor of this item)
  • -email is unavailable- added by j_steele (Submitted the item)
  •  

    There are 3 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-02-24 ericzolf StatusNone Duplicate
        Open/ClosedOpen Closed
    2013-04-24 error Carbon-Copy- Added error
    2011-09-24 libove Carbon-Copy- Added libove
    2010-09-07 nbecker Carbon-Copy- Added nbecker
    2009-06-13 j_steele Attached File- Added backup.py.patch.txt, #18258

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code