About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
A GNU tar incremental archive is not a self-contained copy. It holds the files that changed since an earlier run, plus a list of what existed in each directory when it was made. To get back the exact state of a given day you extract the level 0 archive first and then every later archive, in the order it was created. Extracting only the newest archive gives you only the newest changes, and extracting onto a live folder also deletes files.
If you came here after a restore that left files missing, or removed files you wanted, the cause is one of the six in the table below.
What the error means
A restore that ran in the wrong order, or onto the wrong folder, finishes without an error and leaves a wrong result. That is why this fault is easy to miss until the day you need the data.
The GNU tar manual (version 1.35.90) explains the design. With --listed-incremental=snapshot-file, tar uses a standalone snapshot file to decide which files changed, were added or were deleted since the last run. If that snapshot file does not exist, tar creates it and the archive "will then be a level 0 backup". If it exists, only the changes go into the archive.
Two details decide how many archives a restore needs.
First, tar updates the snapshot file on every run. The manual says that "if you plan to create more 'level 1' backups, it is necessary to create a working copy of the snapshot file before running tar". If you copy the level 0 snapshot file before each run, every archive is a level 1 that covers everything since level 0, and a restore needs two archives. If you let one snapshot file run on, each archive is relative to the previous run, and a restore needs all of them.
Second, extraction restores state, not just content. The manual says that "when extracting from the incremental backup GNU tar attempts to restore the exact state the file system had when the archive was created. In particular, it will delete those files in the file system that did not exist in their directories when the archive was created." For the chain, it says: "in order to restore the exact contents the file system had when the last level was created, you will need to restore from all backups in turn."
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| Only the newest archive was extracted | Most of the tree is missing; only recent changes are present | The archive list shows a level 0 and several later archives you did not extract |
| Archives were extracted out of order | Old versions of files, or files that should be gone are back | Check the archive creation times against your extraction order |
| Extraction ran against the live directory | Files created since the backup disappeared | The files existed after the backup time and are absent from the archive's directory listing |
| The snapshot file was lost or removed before a run | A "level 1" archive that is as large as a full backup | The manual says a missing snapshot file produces a level 0 archive |
| The snapshot file was reused or copied inconsistently | Gaps: a change appears in no archive, or in two | Compare which snapshot file each run used |
| Device numbers changed between runs | Large archives full of unchanged files | The manual links this to cases such as LVM snapshot volumes; --no-check-device is its remedy. (For NFS, the manual says tar already treats all NFS devices as equal.) |
Prove the cause before changing anything
Reading archives does not change anything. List each archive with the incremental listing the manual describes, which needs two --verbose options:
tar --list --incremental --verbose --verbose --file archive.2.tar
The manual says this prints, for each directory in the archive, the files in it at the time the archive was created, each marked with a letter: "Y" if the file is in the archive, "N" if it is not in the archive, and "D" for a directory included in the archive. A good result for a level 0 archive is "Y" against nearly everything. A good result for a later archive is "N" against most files and "Y" against the few that changed. If the newest archive shows "N" against files you expected to be restored, they live in an earlier archive.
To see how much an archive contains, list it with a plain --list and compare member counts across your archives. A level 1 or later archive whose size matches a full backup points to a lost snapshot file or to device numbers.
Then check the list of archives you have against the order in which they were created. Use file modification times on the archive files, or your job's log. If your jobs keep a copy of the snapshot file for each run, check that too.
Fix
Restore in order, into an empty folder. Create an empty directory and extract each archive into it in creation order, level 0 first. The manual's own pattern gives /dev/null as the snapshot argument on extraction, because "tar does not need to access snapshot file, since all the data necessary for extraction are stored in the archive itself":
tar --extract --listed-incremental=/dev/null --file archive.0.tar --directory=/srv/restore-test
tar --extract --listed-incremental=/dev/null --file archive.1.tar --directory=/srv/restore-test
tar --extract --listed-incremental=/dev/null --file archive.2.tar --directory=/srv/restore-test
--directory=dir (-C dir) makes tar change to that folder before it acts. Each pass applies that archive's changes and its deletions, so after the last one the folder holds the state at the time of the last archive.
Disruptive step: the same commands run against the live directory delete every file there that was not in the directory when the archive was created. The GNU restore script carries the same warning: "The script will delete files from the active file system if they were not in the file system when the archive was made." There is no way back for those files unless you have another copy. Restore into an empty folder first, then copy what you want across.
Only part of the history is needed. To restore to the state of a particular day, stop after the archive for that day. The later archives hold later states.
Snapshot file lost. The next run will be a full backup. Keep a copy of the snapshot file off the host, and treat a sudden jump in archive size as a signal. You can also force a level 0 deliberately. The manual says to remove the snapshot file or give --level=0, and that "as of GNU tar version 1.35.90, the option --level=0 truncates the snapshot file". The manual adds that in 1.35.90 other values of --level are "effectively ignored", so do not depend on --level=1 to choose a base.
Risk: removing or truncating the snapshot file drops the record of the last full, and the next run is a full. Copy the file first; to back out, put the copy back before the next run.
Pick the layout you want. For a restore of two archives, copy the level 0 snapshot file before each daily run and give tar the copy:
cp /var/log/usr.snar-0 /var/log/usr.snar-1
tar --create --file=archive.2.tar --listed-incremental=/var/log/usr.snar-1 /usr
This mirrors the manual's example. It costs more space each day, because every archive repeats earlier changes. For one snapshot file that runs on, each archive is small, and the restore needs every archive.
Device numbers. If archives contain unchanged files, add --no-check-device to the create command, as the manual advises for cases such as LVM snapshot volumes.
Risk: --no-check-device changes how tar decides which files changed: the manual says it makes tar "not rely on device numbers when preparing a list of changed files". To back out, remove the option; the next run uses device numbers again and may dump unchanged files again.
Timestamps and the clock. The manual warns that incremental dumps "depend crucially on time stamps", so results are unreliable if timestamps are changed during dumping or if the clock is set backwards. Do not use --atime-preserve=replace with incremental dumps.
Example (illustrative): fs01 makes a level 0 archive of /srv/data on Sunday, 120 GB. Each day a different 3 GB of files changes. With one snapshot file running on, the archives are 3 GB each, so through Thursday you store 120 + 3 × 4 = 132 GB, and restoring Thursday's state extracts five archives in order. With a copy of the Sunday snapshot file used each day, Monday is 3 GB, Tuesday 6 GB, Wednesday 9 GB and Thursday 12 GB. Through Thursday you store 120 + 3 + 6 + 9 + 12 = 150 GB, and restoring Thursday's state needs only two archives: Sunday and Thursday.
Confirm the fix
- The restored folder is the state of the day you wanted. Compare file counts, and sizes of a few directories, against the source from that day.
- A file that was deleted between two archives is absent after the later archive has been extracted. If so, the extraction applied the deletion records, as the manual describes.
- Files that live only in earlier archives are present. If they are not, an archive was skipped or extracted out of order.
- For ownership, mode bits, ACLs and extended attributes, the neighbouring article on what tar preserves covers the options. Check a sample before you rely on it.
- Run the whole restore once, from backup media, on a different host, and time it.
What to watch afterwards
- Archive sizes. A level 1 or later archive close to the size of level 0 means a lost snapshot file or changing device numbers.
- The snapshot file itself: keep it with the archives, with a copy per run if you use the copy layout.
- The exit status of every tar run. A non-zero status can mean a file changed while being read, which the neighbouring article explains.
- Clock changes on the host. Moving the clock backwards makes the next incremental unreliable.
- The version of tar on the restore host. The manual notes incremental archives use GNU extensions and "may not be readable by non-GNU versions of the tar program".
Read next
Related articles you may want next.
- Backup & Recoverytar: 'file changed as we read it' and exit status 1 in backup scriptstar prints 'file changed as we read it' and exits 1. What it means for your backup, why muting the warning is risky, and how to archive a stable copy.Read article
- Backup & RecoveryWhat a Linux file backup should leave out, and how exclusions quietly lose dataWhich Linux directories a file-level backup should exclude, how CACHEDIR.TAG and one-file-system options work, and the exclusions that lose data.Read article
- Backup & RecoveryPOSIX ACLs and extended attributes: what tar, rsync and cp actually preserveWhat GNU tar, rsync and cp preserve of POSIX ACLs and extended attributes by default, the options that change it, and how to verify a Linux file restore.Read article
Risks and limits
- The behaviour described is from the GNU tar 1.35.90 manual. The manual ties
--level=0truncating the snapshot file to that version ("as of"), so earlier versions may behave differently. - No repair steps for a damaged snapshot file are given here; the manual has a separate appendix on fixing snapshot files. If yours is damaged, start a new level 0 and keep the old archives and the old snapshot file untouched.
- Incremental archives made with
--incremental(-G) alone create no snapshot file, so you cannot make several levels with it. - Extracting archives restores state, so any mistake in order or target directory can remove files. Always start with an empty target.
- Test an archive by restoring it into an empty folder before you rely on it. A listing shows what is recorded in the archive; a test restore catches problems that a listing does not.
- These commands have not been run or lab-tested.
Sources
- GNU tar manual, version 1.35.90 (11 June 2026): Using tar to Perform Incremental Dumps, Levels of Backups, --level, --listed-incremental, Using the Restore Script — GNU Project, version 1.35.90, 11 June 2026, accessed 17 November 2026
This article was originally published on .