Live data from Hacker News

Xz format inadequate for long-term archiving (2017)

nongnu.org

131–138 of 138 posts

Re: Xz format inadequate for long-term archiving (2017)

#131
post #20
post #8

Earlier quoted context omitted.

For long-term archival I think relying on your compression software to protect data integrity is a fool's errand, protecting against bit-rot should be a function of your storage layer as long as you have control over it (in contrast to say, Usenet, where multiple providers have copies of data and you can't trust them to not lose part of it - hence the inclusion of .par files for everything under alt.binaries).

I keep seeing recommendations for par/par2 but it seems like as software, the project isn't actively maintained? As an aside, that makes me think of dead languages and the use of latin for scientific names because it isn't changing anymore... but do you want that out of archival formats and software?

Yes. Learn from what we have already experienced in the world of computing.

* https://www.theguardian.com/uk/2002/mar/03/research.elearnin...

Re: Xz format inadequate for long-term archiving (2017)

#132
post #65

I fail to see why integrity checking is the file format's responsibility. Is this historical? Like when you just dd a tar file directly onto a tape and there is no filesystem? Anyway seems like it should be handled by the filesystem and network layers. I can understand the concerns about versioning and fragmented extension implementations though.

> you just dd a tar file directly onto a tape

Actually, one uses the tape archive utility, tar, to write directly to the tape. (-:

Re: Xz format inadequate for long-term archiving (2017)

#133

The purpose of a compression format is not to provide error recovery or integrity verification. The author seems to think the xz container file format should do that. When you remove this requirement, nearly all his arguments become moot.

> The purpose of a compression format is not to provide error recovery or integrity verification.

On the contrary. People archive files to save space, exchange files with each other over unreliable networks able to corrupt data, store them in corrupted ram and corrupted disks, even if just temporary. Compression formats are there to help with that, this is their main purpose. This is why fast and proper checksumming is expected, but not cryptographic, like sha256, that adds nothing to this goal but overhead.

Re: Xz format inadequate for long-term archiving (2017)

#134
post #56

Earlier quoted context omitted.

You'd have to ask the guy who wrote the code in the first place. I think he saw "'best' compression" and stopped looking there.

I didn't mean to ask why the defaults are defaults, but rather why anyone would use the defaults rather than settings more appropritate to their use case? It's not like xz is unable to be lighter on memory, if that's what you want. It's an option setting away.

To clarify: you'd have to ask the guy who wrote our code.

Re: Xz format inadequate for long-term archiving (2017)

#135
post #122

Earlier quoted context omitted.

> To say 3 levels of headers is "unsafe complexity"... I don't agree. Indirection is fundamental to design. 3 individual headers for one file format is unnecessary complexity. > To say padding is "useless" Padding in general is not useless, but padding in a compression format is very counterproductive. > And it's pure FUD to say "Xz implementations may choose what subset of the format they support. They may even choo…

> 3 individual headers for one file format is unnecessary complexity. So all these file formats are unnecessarily complex? - all OpenDocument formats - all MS office formats - all multimedia container formats - deb/rpm packages etc?

It depends on how you count headers, but yes.

Multimedia containers, while too complicated, don't really qualify for a position on that list. These containers are basically just special purpose file containers, and thus the headers of the "files" within should not contribute to the header count.

deb/rpm is also a good example for old and quite obnoxious formats. Deb is an AR archive of two GZIP compressed TAR archives (control and data) and a single file (debian-binary). TAR replaced AR for all but a few ancient tasks long ago, but for some reason, Deb uses both. A tar.gz with 3 files/folders that were not tar'd or compressed would have been much simpler. I believe RPM goes that route, but rather than TAR they use CPIO, and rather than embedding the metadata inside the archive, the RPM package has its own header.

Both RPM and DEB have given support for using a bunch of compression formats, meaning that not only do the content of the DEB/RPM package have dependencies, but there each package can now basically end up having its own dependencies that need to be satisfied before you can even read the package in the first place. Oh, and one of the supported compression formats is XZ now, adding an extra dependency as your version of XZ might not support the contained XZ archive at all.

Re: Xz format inadequate for long-term archiving (2017)

#136

Earlier quoted context omitted.

Are you using the small business version of CrashPlan? I was using CP too until they discontinued their B2C.

Same here - I'm currently still migrating from CrashPlan B2C to using Arq backing up to Backblaze B2. (Being able to access B2 from Panic's Transmit Mac app made B2 really attractive to me as well, and it looks like I'll save a lot of money compared with CrashPlan.)

I'll look into this. Thanks for the info!

Re: Xz format inadequate for long-term archiving (2017)

#137
post #64

Earlier quoted context omitted.

> compressing things to smaller sizes. ...relative to ... ? Is it better than lzip? lzip sounds like it would also use LZMA-based compression, right? This [1] sounds like an interesting and more detailed/up-to-date comparison. Also by the same author BTW. [1] https://www.nongnu.org/lzip/lzip_benchmark.html#xz

Relative to the compression formats people were aware of at the time (which didn't include lzip.) People began using xz because mostly because they (e.g. distro maintainers like Debian) had started seeing 7z files floating around, thought they were cool, and so wanted a format that did what 7z did but was an open standard rather than being dictated by some company. xz was that format, so they leapt on it. As it turns…

7z, xz, and lzip all use the same compression algorithm (LZMA). The differences between them are in the container format that stores the data, not in the compression of the data. 7z is akin to zip in that it functions as an archive in addition to the compressed data. xz and lzip both accomplish the same goal, which is to store the LZMA-compressed stream while letting some other tool handle archival if desired, as is traditional on unixy systems, where archival is usually handled by tar (though you will sometimes fun into cpio or ar archives) while compression is handled by gzip (same compression algorithm as zip) or bzip2 or whatever else.

Thus, the proposed benefits of the compression ratio apply equally to lzip as they do to 7z and xz. When the article talks about shortcomings of the xz file format compared to the lzip file format, it's talking about file structure and metadata, not compression algorithm. Just running some informal comparisons on my machine, an empty (zero byte) file results in a 36 byte lzip file and a 32 byte xz file, while my hosts file of 1346 bytes compresses to a 738 byte lzip file and a 772 byte xz file. An mtree file listing my home directory comes to 268 Mbytes uncompressed, resulting in an 81M lzip file and an 80M xz file (a difference of 720 Kbytes, less than 0.9% overhead). Suffice it to say, the compression of the two files is comparable. Yet, the lzip file format also has the advantages discussed in the article.

That said, for long-term archival I wouldn't use any of the above: I prefer zpaq, which offers better compression than straight LZMA, along with dedup, journaling, incremental backup, append-only archives, and some other desirable features for archival. Together with an mtree listing (to capture some metadata that zpaq doesn't record) and some error recovery files (par2 or zfec), this makes a good archival solution, though I hesitate to call it perfect.

Re: Xz format inadequate for long-term archiving (2017)

#138
post #98

Earlier quoted context omitted.

xz has substantially better compression than gz or bz2, especially if using the flags -9e. You can use all your cores with -T0 or set how many cores to use. I find it to be on par with 7-zip. Perhaps folks are trying to stick with packages that are in their base repo. p7zip is usually outside of the standard base repos.

Substantially is a relative term. There are niche cases but how many people really care, or need to care, about the last bytes that can be compressed? Packing a bunch of files together as .tgz is a quite universal format and compresses most of the redundancy out. It has some pathological cases but those are rare, and for general files it's still in the same ballpark with other compressors. I remember using .tbz2 in t…

> zip is just as good

A major problem of zip is the "codepage hell" (it has been almost eradicated in browsers but still lives in zip archives, e-mails and non-.Net Windows programs). With 7z you just always know nobody is going to have problems decoding the names of the files inside it, whatever languages those are in, regardless to the system locale.

Post reply on HN