Technical article 110417

Appending with tar results in an archive with directory checksum errors.

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6

Written · Last revised

Problem

Appending to an archive with tar option 'r' or 'u' results in an archive with directory checksum errors. For example:

# tar cnf tar_archive datafiles
# tar rnf tar_archive newfile
# tar tnf tar_archive
tar: blocksize = 20
rw------- 0/3 295464 Jul 21 15:44 1999 datafiles
tar: directory checksum error

Solution

As a workaround, a blocksize of 1 or 2 can be specified throughout the tar append process. For example of 'r' option:

- Initialize the archive with blocksize of '1':

# tar cnbf 1 tar_archive datafiles

- Append to the archive also using a blocksize of '1':

# tar rnbf 1 tar_archive newfile

- List the archive also using blocksize of '1':

# tar tnbf 1 tar_archive
tar: blocksize = 1
rw------- 0/3 295464 Jul 21 15:44 1999 datafiles
rw------- 0/3 295464 Jul 21 17:24 1999 newfile
#

- Extract from the archive also using a blocksize of '1':

# tar xnbf 1 tar_archive newfile
NOTE:     Add the 'v' option if verbose output is desired.  The same
          information applies to the 'u' option also.

See also

man page tar(C)

From the Xinuos technical article database, record 110417. Reproduced with permission. The original is at www.sco.com/ta/110417, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.