When creating tiny-sized and embedded Linux systems, every byte of the storage device (floppy, flash disk, etc.) is very important, so compression is used everywhere possible. Also, compressed file systems are frequently needed for archiving purposes. For huge public archives, as well as for personal media archives, this is essential.
SquashFS brings all this to a new level. It is a read-only file system that lets you compress whole file systems or single directories, write them to other devices/partitions or to ordinary files, and then mount them directly (if a device) or using a loopback device (if it is a file). The modular, compact system design of SquashFS is bliss. For archiving purposes, SquashFS gives you a lot more flexibility and performance speed than a .tar.gz archive.
SquashFS is distributed as a Linux kernel source patch (which enables SquashFS read support in your kernel), and the mksquashfs tool, which creates squashed file systems (in a file or on a block device).
Data, inodes and directories are compressed
SquashFS stores full uid/gids (32 bits), and file creation time
Files up to 2^32 bytes are supported; file systems can be up to 2^32 bytes
Inode and directory data are highly compacted, and packed on byte boundaries; each compressed inode is on average 8 bytes in length (the exact length varies on file type, i.e. regular file, directory, symbolic link, and block/character device inodes have different sizes)
SquashFS can use block sizes up to 32K, which achieves greater compression ratios than the normal 4K block size
File duplicates are detected and removed
Both big and little endian architectures are supported; SquashFS can mount file systems created on different byte-order machines
To make further chapters clear, the basic steps of getting SquashFS working that we will discuss are:
Patching and recompiling the Linux kernel to enable SquashFS support
Compiling the mksquashfs tool
Creating a compressed file system with mksquashfs
Testing: mounting a squashed file system to a temporary location
Modifying the fstab or startup scripts of your Linux system to mount the squashed file system at boot time