Squashfs-LZMA.org

make your squashfs filesystems smaller
using lzma compression algorithm
 

Useful links

 

Optimize Your Filesystems with Squashfs + LZMA Compression

Welcome to Squashfs-LZMA.org — your reference point for powerful, space-saving filesystem compression using LZMA and XZ with Squashfs.

Squashfs is one of the most efficient compressed read-only filesystems available today, widely used in embedded systems, live distributions, and data storage. This project was created to combine it with LZMA, a high-ratio compression algorithm known for producing significantly smaller files than traditional gzip.

Thanks to kernel support introduced in Linux 2.6.38, XZ (based on LZMA2) compression is now natively supported in Squashfs. That means you no longer need to apply external patches — the functionality is built-in and ready to use. While the project itself is discontinued, this site remains live for reference, benchmarks, and access to historical Squashfs tools.

Why Choose LZMA for Squashfs?



LZMA can compress data far better than gzip — often reducing Squashfs image sizes by up to 25–30% more. Although compression takes longer, it only needs to be done once. Decompression speeds remain fast, typically reaching 10–20 MB/s on a 2 GHz CPU, making it suitable for performance-critical use cases.



Real-World Results



Compression benchmarks with Slax data show:



  • Gzip (64KB block): 227MB (34% of original size)


  • LZMA (64KB block): 191MB (28%)


  • LZMA (1024KB block): 167MB (25%)




Larger block sizes with LZMA yield the most space-saving results — ideal for live environments or firmware.



Get Started



No patches required. Download Squashfs tools v4.x, enable XZ support in the Makefile, and compile:



mksquashfs .sqfs -comp xz -b 262144



Whether you're building a live OS or compressing data for embedded devices, Squashfs with LZMA gives you the performance and size savings you need.



News

SquashFS version 4 is included in Linux Kernel since 2.6.29 and it supports XZ (LZMA2) compression since 2.6.38. What does it mean for this project (squashfs-lzma.org)? There is no longer any need to use external patches, so this project is discontinued. You can happily mount your newly created squashfs images directly with recent kernel! :) This website will remain with slight updates for reference.

Why Squashfs LZMA?

LZMA is one of the best compression algorithms and Squashfs is one of the best compressed filesystems available nowadays. This project combined both to make something even better. LZMA can compress much better then gzip, which was the only option in squashfs for years. Compressing to LZMA format is very slow, but this is not a problem as the squashfs filesystem needs to be compressed only once. Then it's only read million times; so what we care about is the speed of decompression. LZMA decompression is slower than gzip, but it's even very fast, about 10-20 MB/s on a 2GHz CPU.

Compression benchmarks

method block size Slax data size percent
uncompressed - 668 MB 100%
mksquashfs+gzip 64KB 227 MB 34%
mksquashfs+gzip 1024KB 222 MB 33%
mksquashfs+lzma 64KB 191 MB 28%
mksquashfs+lzma 128KB 184 MB 27%
mksquashfs+lzma 512KB 172 MB 26%
mksquashfs+lzma 1024KB 167 MB 25%

Why the patches existed?

Squashfs' author couldn't support LZMA directly in squashfs source code. He wanted to have the squashfs code included in official Linux Kernel, but Linux Kernel didn't support LZMA/XZ at that time, so adding LZMA to squashfs would decrease the chance for its (squashfs's) inclusion. This was the main reason we had to maintain LZMA support as a separate patch.

How to build squashfs with LZMA support now?

As already said, recent squashfs doesn't need any patches neither to kernel nor to the tools. Simply download squashfs tools v4.x from the link at the top left sidebar, extract, edit Makefile to add XZ support by uncommenting XZ_SUPPORT = 1, and run make && make install. Then you can compress your files using for example:

mksquashfs source1 dest.sqfs -comp xz -b 262144
squashfs4.3 Download
squashfs4.2 Download
squashfs4.1 Download
squashfs4.0 Download
squashfs3.4 Download
squashfs3.0 Download
squashfs2.2 Download
squashfs1.3 Download