Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1184697 - RHEL7 tar doesn't restore incremental backup correctly.
RHEL7 tar doesn't restore incremental backup correctly.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tar (Show other bugs)
7.0
All Linux
medium Severity medium
: rc
: ---
Assigned To: Tomas Repik
Robin Hack
Lenka Kimlickova
: Patch
Depends On:
Blocks: 1298243 1400961 1393868
  Show dependency treegraph
 
Reported: 2015-01-21 22:46 EST by kyoneyama
Modified: 2017-08-01 13:01 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Release Note
Doc Text:
"tar" now restores incremental backup correctly Previously, the "tar" command did not restore incremental backup correctly. Consequently, a file removed in the incremental backup was not removed when restoring. The bug has been fixed, and "tar" now restores incremental backup correctly.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-01 13:01:03 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
backpatched fix (11.26 KB, patch)
2015-02-09 07:41 EST, Pavel Raiskup
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2012 normal SHIPPED_LIVE tar bug fix update 2017-08-01 14:01:19 EDT

  None (edit)
Description kyoneyama 2015-01-21 22:46:35 EST
Description of problem:

When RHEL7 tar restoring incremental backup, it doesn't remove a file that removed from previous backup.


Version-Release number of selected component (if applicable):

  tar-1.26-29.el7

How reproducible:

  Always

Steps to Reproduce:

1. Get files ready for archive.

  # pwd
  /var/tmp
  # ls tmp
  1.txt  2.txt

2. Creating a full backup archive.

  # tar Jcfg file.tar.xz file.snar tmp
  # tar Jtf file.tar.xz 
  tmp/
  tmp/1.txt
  tmp/2.txt

2. Creating an incremental backup archive.

  # echo 3 > tmp/3.txt
  # rm tmp/2.txt
  # tar Jcfg file2.tar.xz file.snar tmp

3. Restore files from full backup archive.

  # mkdir file
  # tar JxfCg file.tar.xz ./file/ file.snar 
  # find file/
  file/
  file/tmp
  file/tmp/1.txt
  file/tmp/2.txt

4. Restore files from incremental backup archive.

  # tar JxfCg file2.tar.xz file/ file.snar


Actual results:

RHEL7 tar does not remove file "2.txt".

  # tar JxfCg file2.tar.xz file/ file.snar 
  # find file/
  file/
  file/tmp
  file/tmp/1.txt
  file/tmp/2.txt
  file/tmp/3.txt


Expected results:

tar can remove file "2.txt" like RHEL6.

  # tar JxfCg file2.tar.xz file/ file.snar 
  # find file/
  file/
  file/tmp
  file/tmp/1.txt
  file/tmp/3.txt
Comment 2 Pavel Raiskup 2015-02-09 05:09:47 EST
Thanks for the report and sorry for the delay.  Yes, that was/is bug in
upstream release 1.26, fixed in 1.27 by upstream commit:

  http://git.savannah.gnu.org/cgit/tar.git/commit/?id=738fb9c2f44e

More concretely, it is a bug in -C option (not the first one relevant to *at()
change).  You can work-around that by wrapping tar into 'cd file/' and 'cd -',
the following example should work for your concrete example:

  Old command:
     $ tar JxfCg file.tar.xz ./file/ file.snar

  New cmomands:

     $ cd file \
     && tar Jxfg ../file.tar.xz ../file.snar \
     && cd -

Pavel
Comment 3 Pavel Raiskup 2015-02-09 07:41:07 EST
Created attachment 989672 [details]
backpatched fix
Comment 4 Pavel Raiskup 2016-08-25 07:08:43 EDT
I see the customer case is closed now, and I don't know whether this is still
expected to be fixed (and I'm considering closing this bug).

Was the workaround helpful so we don't need to have this fixed?
Comment 6 Karel Volný 2016-12-01 03:42:45 EST
(In reply to Pavel Raiskup from comment #4)
> I see the customer case is closed now, and I don't know whether this is still
> expected to be fixed (and I'm considering closing this bug).
> 
> Was the workaround helpful so we don't need to have this fixed?

IMHO we should fix this anyways, this is minimal effort as tar will have an erratum anyways, the patch is ready and there's complete reproducer available for QA
Comment 15 errata-xmlrpc 2017-08-01 13:01:03 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2012

Note You need to log in before you can comment on or make changes to this bug.