3.15. Compression Formats

File compression formats are supported because they can occur on Linux installation disks and ramdisks, but also for convenience. The test images in the file system sampler are gzip-compressed for storage.

When disktype identifies compressed data, it spawns an external decompressor programs and analyzes the decompressed data. Compressed data may start at a sector (i.e. 512 byte) boundary up to 4096 bytes into the disk or partition. This is especially useful for installation disks.

3.15.1. compress

The traditional Unix compress format uses the moderately efficient (by today's standards) LZW algorithm. It can be identified by a two-byte magic signature. Decompression is done using the external gzip program.

3.15.2. gzip

The gzip format uses a LZ77 derivative with adaptive Huffmann compression. It is both reasonably compact and reasonably fast, and used in many places. Amongst them are the ZIP archive format, the zlib compression library, and the cramfs and squashfs file systems. The Linux kernel natively supports gzip compression for initial ramdisks.

The gzip file format can be identified by a two-byte magic signature. Decompression is done using the external gzip program.

3.15.3. bzip2

The bzip2 format uses the Burrows-Wheeler transform, a relatively recent compression algorithm. It is more efficient than gzip, but takes a lot of memory and time to decompress. It is supported in disktype more for the sake of completeness.

The file format can be identified by a two-byte magic signature. Decompression is done using the external bzip2 program.