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 newfileNOTE: Add the 'v' option if verbose output is desired. The same
information applies to the 'u' option also. See also
man page tar(C)