gzが悪いんではなくて

d:id:rubikitch:20071031#1193764291

tar.gzのバックアップの信頼性がやばい原因は、tarでひとまとめにしたものを圧縮しているから。だから、解凍途中でエラーが出てしまえば続行不可能になる。だからおそらくtar.bz2やtar.7zも同様の結果だろう。
afio+gzipの損害が最小限なのは、gzipしてからafioでまとめているから。分裂したひとつの細胞が破壊されても残りが生き残って伸長される。

一般に圧縮ファイルに傷がつくと一大事になる。tar.gzは圧縮ファイルだが、afzそのものは圧縮ファイルではない。圧縮ファイルをまとめているアーカイブファイルに過ぎない。順番大事。

気まぐれにぐぐってみたら同じこと書いてあるサイトを発見。

http://danielwebb.us/software/backup/

afio is an archiver that uses the cpio format, but has the advantage that it can transparently compress files. The difference between afio and tar with compression is critical: tar -j creates an archive then bzip2s it, while afio bzip2s files and adds them to the archive. With tar -j, you're likely lose the whole archive past the first corruption, but with afio you just lose the files that are corrupted. It is best not to use compression, because compression always amplifies corruption loss. If you must use compression, use bzip2 combined with afio. Give bzip2 the -1 option, and you will only lose 100K of your archive surrounding each area of corruption. Bzip2 also has recovery tools in the standard distribution, while gzip does not.

なになに、bzip2は標準で修復ツールがついているが、gzipにはついてないだとよ。標準ではないがgzrtが修復ツールらしい。