Software⏱️ 3 min read📅 2026-06-11

How to Fix: Add error correction information to piped tar stream

Error correction for tar streams in Ubuntu with Amazon S3 Glacier Deep Archive

Quick Answer: Use a tool like par2 or add error correction information to the stream using tools like checksums or digital signatures.

Error adding error correction information to piped tar stream affects users who need to store large archives (1TB+) on Amazon S3 Glacier Deep Archive. This issue is frustrating because it requires manual processing of the archive, which can be time-consuming and prone to errors.

To resolve this issue, we will explore two methods to add error correction information to a piped tar stream without saving it to a file first.

💡 Why You Are Getting This Error

  • The primary reason for this error is that most error correction tools require the data to be written to disk before adding redundancy. This can lead to issues with available disk space and processing time.
  • An alternative reason is that some error correction tools are not designed to handle piped streams of data, making it difficult to implement a solution.

🔧 Proven Troubleshooting Steps

Using PAR2 with piped tar stream

  1. Step 1: Install the PAR2 library and its dependencies using apt-get: `sudo apt-get install par2`.
  2. Step 2: Create a par2 file for your tar archive by running `tar --verify -c -f - | par2 --create --verify` in the same command line as your original pipeline. This will create a separate file containing error correction information that you can then use to verify and correct your original archive.
  3. Step 3: Upload the PAR2 file along with your tar archive to Amazon S3 Glacier Deep Archive.

Using liblzma's built-in redundancy

  1. Step 1: Use the `--lzma` option with `tar` to enable LZMA compression, which includes built-in error correction. This will add redundancy to your tar archive without requiring a separate par2 file.
  2. Step 2: Run your pipeline as usual: `tar cf - $FILES | gzip -3 --stdout | aws s3 cp - $TARGET`. The LZMA compression will include error correction information in the archive.

💡 Conclusion

Both methods can be used to add error correction information to a piped tar stream without saving it to a file first. By using PAR2 with piped tar streams or enabling LZMA's built-in redundancy, you can reduce the risk of data loss and ensure that your archives remain usable even in the event of errors.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions