|
|
Subscribe / Log in / New account

tar for outer wrapper - wasted space

tar for outer wrapper - wasted space

Posted May 31, 2019 23:40 UTC (Fri) by brouhaha (subscriber, #1698)
Parent article: Improving .deb

Using tar for the outer wrapper is not going to waste much space for block padding, because the outer wrapper only contains three files. Tar defaults to 512B internal blocks and 10KiB I/O blocks. If I understand the modern tar format (ustar) correctly, at most the waste from partial blocks and the ends of the three files will be 1533 bytes (3 partial 512-byte blocks of 1 byte each, leaving 511 bytes wasted in each partial block). There will also be waste to round the entire archive to a 10KiB length, so that will be at most 10239 bytes, for a maximum total padding of 11,772 bytes. Assuming that the average file size mod 512 is uniformly distributed (which admittedly might not be a valid assumption), the average waste for the entire outer tarball wrapper should be around 6.5 KiB. There is also a 512B header for each file, which could perhaps be considered largely wasted space, in which case the average waste for the entire outer tarball wrapper should be around 8 KiB.

This seems like a problem only if the format changes include having a significant number of files nested directly in the outer wrapper, rather than in an inner compressed archive.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds