Fact-checked by Grok 2 weeks ago

SquashFS

SquashFS is a compressed, read-only filesystem for that enables efficient storage of files, inodes, and directories by applying compression algorithms such as zlib, LZ4, LZO, , or . It supports block sizes up to 1 MiB (with a default of 128 KiB) and is designed for scenarios requiring low overhead, such as systems and archival applications. of SquashFS began in 2002 under the leadership of Phillip Lougher, initially as a highly compressed filesystem for tiny and Linux systems. The project saw releases like version 3.0 in 2006, which introduced support for larger block sizes. By 2008, a rewritten version was submitted for inclusion in the Linux kernel mainline, and it was merged into kernel version 2.6.29 in early 2009. Subsequent versions added support for additional compression methods and improved performance, with tools maintained on as of the latest release 4.7.4 in November 2025. Key features of SquashFS include support for sparse files, hard links, directory indexes, and extended attributes (xattrs), though it lacks lists (ACLs). It accommodates filesystems up to 2^64 bytes in size, individual files up to approximately 2 , and an unlimited number of files and directories. is highly optimized, with inodes averaging just 8 bytes, and internal caching mechanisms for metadata and file fragments enhance read performance. SquashFS is widely used in embedded devices for filesystems where write access is unnecessary, as well as in live distributions and bootable media to reduce image sizes. For example, it serves as an alternative to traditional archives like tarballs by providing mountable, compressed storage with better flexibility and speed. Its read-only nature makes it suitable for images and systems prioritizing space efficiency over modifiability.

Overview

Definition and Purpose

SquashFS is a highly compressed, read-only filesystem designed for , enabling the storage of entire file hierarchies within a single file or block device. It compresses not only files but also such as inodes and directories to maximize space efficiency, supporting block sizes from 4 KiB to 1 MiB (default 128 KiB) and various compression algorithms. This structure allows SquashFS images to be mounted directly as filesystems, providing transparent access to the compressed data without extraction. The primary purpose of SquashFS is to facilitate space-efficient in environments where write operations are not required, such as archival systems, distribution like live CDs, and resource-constrained embedded devices. By generating a compact, mountable image of a directory hierarchy, it reduces footprints significantly—often achieving ratios superior to traditional archives while maintaining filesystem semantics. This makes it ideal for scenarios demanding minimal disk or memory usage, including bootable and images where immutability enhances reliability. Unlike read-write filesystems such as , which support dynamic modifications and journaling for , read-only filesystems like SquashFS prioritize and immutability over mutability, eliminating the need for write buffers or consistency checks during operation. SquashFS originated in 2002, developed by Phillip Lougher to address the need for a low-overhead, highly compressed alternative to earlier read-only filesystems like CramFS, particularly for reducing the size of distributions and enabling efficient archival and embedded applications.

Key Features

SquashFS is a highly compressed, read-only filesystem designed for , offering compliance to ensure compatibility with standard Unix file operations, including support for regular files, directories, symbolic links, device nodes, and other . It also includes extended attributes (xattrs) to store additional , such as security labels for SELinux; ACLs can be stored but are not enforced by the filesystem. The filesystem accommodates large-scale storage with a maximum size of 16 EiB (2^64 bytes) and individual file sizes up to approximately 2 TiB, while supporting configurable block sizes ranging from 4 KiB to 1 MiB to optimize compression and performance. For compression, SquashFS supports multiple algorithms—gzip (via zlib) for balanced performance, LZMA2 (via xz) for high compression ratios at the cost of slower decompression, LZO for moderate compression with fast processing, LZ4 for rapid compression and decompression with lower ratios, and Zstandard (Zstd) for efficient ratios and speeds suitable for modern hardware—allowing users to trade off space savings against access times. Additional capabilities include duplicate file detection for automatic deduplication during image creation, which reduces by storing identical files only once, and support for sparse files to efficiently represent files with large gaps of empty space. Filenames are case-sensitive and limited to 255 characters, aligning with common Unix conventions. As a strictly read-only filesystem, SquashFS does not support write operations, journaling for crash recovery, or built-in ; instead, modifications require recreating the with tools like mksquashfs, and security features such as must rely on external mechanisms like .

Technical Details

File System Layout

The SquashFS file system is organized into a sequence of up to nine byte-aligned components: the superblock, compression options, inode table, directory table, fragment table, lookup table, export table, UID/GID table, and extended attribute (xattr) table, followed by data blocks and fragments. This layout enables efficient random access to compressed data by storing metadata before file contents, with all elements except data blocks compressed in 8 KiB blocks using algorithms such as zlib, LZ4, LZO, XZ, or Zstd. The , a fixed 96-byte at the beginning of the image, encodes essential filesystem parameters including the magic number sqsh (0x73717368), major and minor version numbers, inode count, modification time, default size (a power of 2 between 4 KiB and 1 ), method identifier, flags for features like uncompressed inodes or directories, and 64-bit offsets to the starts of the inode table, directory table, fragment table, , and extended attribute table. These offsets facilitate navigation to sections, while additional fields specify inode location and options presence. The inode table follows the superblock and consists of compressed 8 KiB blocks, each prefixed by a 2-byte length field indicating the uncompressed size (with the high bit set if uncompressed). Inodes are variable-length records averaging 8 bytes, identified by a 48-bit of block and within it; each includes type (e.g., , , symlink), permissions, /GID indices, modification time, and type-specific data such as , block list pointers for regular files (up to four direct 64-bit addresses plus an indirect for larger files), or start and parent inode for directories. Directory tables are stored in similarly compressed 8 KiB blocks and employ a two-level structure for efficient lookup: a header block containing the directory inode number, entry count (off-by-one), and start offset, followed by sorted entries in subsequent blocks, where each entry comprises a 2-byte offset, inode reference, type, name length (off-by-one), and null-terminated name string. For larger directories, an optional index table provides binary search acceleration by listing up to 31 header locations with hash values. The , located after the directory table, handles the tail ends of regular s or entire small files smaller than the block size by packing them into shared 8 KiB compressed blocks; it comprises a sequence of blocks with 12-byte entries per fragment, including a 64-bit start offset, 32-bit uncompressed size (high bit set if uncompressed), and padding. inodes reference fragments via a 32-bit index into this global table (with each file using at most one entry), allowing efficient without wasting full blocks. The table itself consists of multiple metadata blocks, each holding up to 512 entries. Version 3 of SquashFS, introduced earlier, supports filesystems up to 2^ bytes and files up to approximately 2 but uses 32-bit fields in some places, limiting certain offsets. In contrast, version 4, released in , enhances the layout with full -bit support throughout for offsets and sizes, enabling filesystems up to 2^ bytes and theoretical file sizes up to 2^ bytes (though practical limits due to index caching restrict files to approximately 2 ), larger sizes up to 1 , and integrated extended attributes via a dedicated table referenced by inode offsets. These changes in v4 also introduce compressor options as a separate and refine metadata packing for better compression ratios.

Compression Mechanisms

SquashFS employs block-based to store file data efficiently, dividing files into fixed-size s that are compressed individually using selected algorithms. This approach allows for to file contents without decompressing the entire filesystem, as each can be decompressed . Block sizes range from 4 KiB to 1 , with the default being 128 KiB, enabling trade-offs between compression density and access overhead. For files smaller than the block size or with tail data not filling a full block, SquashFS uses compressed fragment blocks to pack multiple such remnants, referenced via a 32-bit index into the global fragment table (with each file using at most one entry). The filesystem supports multiple compression algorithms integrated into its storage model: gzip (using zlib, the default for balanced performance), LZ4 (prioritizing fast suitable for resource-constrained environments), LZO (offering speed similar to LZ4 with slightly better ratios), XZ and LZMA (providing high ratios at the cost of slower ), and Zstd (delivering a strong balance of ratio and speed). Each compressed block is prefixed with a two-byte header indicating its compressed length, and blocks that do not shrink upon are stored uncompressed to avoid overhead. The algorithm is specified globally in the and applied uniformly to all data and . such as inodes and directories is also compressed in 8 KiB blocks using the same algorithm. To reduce , SquashFS implements file-level deduplication by detecting identical files during creation and sharing their blocks, storing the only once while multiple inodes reference the same blocks. This occurs before , enhancing space savings across duplicate like libraries or binaries in distributions. Per-block headers add minimal overhead—typically 2 bytes per block—while the overall structure keeps inode sizes around 8 bytes on average, packed efficiently to minimize padding. In terms of performance, typically achieves approximately 3:1 ratios on mixed filesystem , reducing ext3-sized images to about one-third their original size. LZ4 excels in speed, often matching or exceeding uncompressed read rates on embedded hardware, though with lower ratios around 1.5:1 to 2:1. provides competitive ratios of 2:1 to 3:1 on typical binaries while supporting multi-threaded for up to 2 threads per core, making it ideal for modern applications balancing storage and access speed.

Metadata Management

SquashFS manages file metadata through a highly compact and compressed structure designed for read-only storage efficiency. , including inodes, directories, and extended attributes, is stored in dedicated blocks that are compressed using algorithms such as zlib, LZ4, LZO, , or , allowing for significant space savings while enabling fast access in kernel space. This approach packs on byte boundaries and optimizes formats based on types to minimize overhead. Inodes in SquashFS are the core structures representing files, directories, symlinks, and devices, stored in compressed 8 KiB prefixed by a 2-byte length field (with the top bit indicating if uncompressed). Each inode is identified by a 48-bit number comprising a block location and , facilitating precise retrieval. Basic inodes, optimized for common cases, are approximately 8 bytes and include essential fields like , UID/GID, timestamps, and block pointers for regular files. Extended inodes provide additional details, such as ACL support or extended attributes, with formats varying by type: regular files include fragment and extended timestamp fields (with 64-bit size for theoretical support up to 2^64 bytes, though practical limits are ~2 ), directories reference entry tables, symlinks store target paths, and devices hold numbers. These size-optimized formats ensure compact representation tailored to each file type. Directory entries are organized within compressed 8 KiB blocks forming a , using a two-level structure for efficiency: a shared header block followed by an entry list. Entries are sorted alphabetically and include name offsets (up to 28 bits for ) and inode references, enabling compact . To accelerate lookups, SquashFS employs hashed indexing through index —one per block—that allow the to identify and decompress only the relevant , avoiding full scans and supporting fast pathname resolution even in large . Extended attributes in SquashFS are handled via a separate compressed 8 KiB table, where each inode references a 32-bit xattr ID for lookup. This ID maps to attribute entries that support both inline storage (for small values directly in the entry) and out-of-line storage (referencing deduplicated values in the table to reduce redundancy). The system accommodates security contexts, such as SELinux labels, by encoding prefixes like "security." in the type field, and user-defined data, enabling flexible attachment without bloating inode sizes. Metadata compression occurs in fixed 8 KiB blocks, similar to data blocks, but with options like -noI during image creation to store inodes uncompressed if beneficial. While general-purpose compressors are used, the packing and byte-aligned design inherently provides high ratios; blocks exceeding the compressed size may remain uncompressed for performance. This balances storage efficiency with quick decompression during access. For access, the kernel resolves pathnames by iteratively reading and decompressing metadata blocks using inode and directory identifiers. Upon mount, metadata blocks are cached as needed, with directory indexes scanned linearly to locate entries, and inode details fetched via offsets for attribute retrieval, ensuring efficient in-memory representation without full filesystem loading.

Usage and Tools

Creating Images

SquashFS images are generated using the mksquashfs command-line utility, part of the squashfs-tools package developed and maintained by the SquashFS project. This tool compresses a source directory or set of files into a single, read-only SquashFS filesystem image, suitable for embedding in larger systems or archival purposes. The basic syntax for creating an image is mksquashfs [options] source1 [source2 ...] output, where sources can be directories or files, and output specifies the target filesystem file or block device. For example, to create a compressed image from a source directory, the command mksquashfs /path/to/source /path/to/target.sqsh produces a file named target.sqsh containing the SquashFS image with default settings, including gzip compression and a 128 KB block size. Key options allow customization of the image creation process. Compression can be specified with -comp {gzip|lzo|xz|lz4|zstd|lzma}, where is the default; for instance, -comp [zstd](/page/Zstd) enables Zstandard compression for potentially better ratios and speed. The block size is set via -b BLOCK_SIZE (e.g., -b 1M for 1 MB blocks, up to a maximum of 1 MB), which influences efficiency and memory usage during creation—larger blocks generally improve ratios for sequential data but may increase overhead for . Files or directories can be excluded using -ef exclude_file, where the file lists patterns to skip (e.g., temporary files like *.tmp), or multiple -e flags for inline lists, reducing image size by omitting unnecessary content. Progress tracking is enabled with -info, which displays each file as it is processed, aiding in monitoring long operations. Advanced features enhance performance and optimization. Multithreaded compression is controlled by -processors N, where N specifies the number of CPU cores to use (defaulting to all available cores), significantly speeding up creation on multi-core systems—for example, -processors 4 limits to four threads. For better ratios, files can be sorted prior to processing using -sort sort_file, where the sort_file contains paths with priority values (-32768 to 32767, default 0) to group similar files together, such as by type or modification time via a pre-generated list. Output can be directed to a regular file for portability or directly to a block device (e.g., /dev/sdb1) for in-place filesystem creation, though writing to devices requires appropriate permissions and caution to avoid . When targeting partitions or embedded storage, images should be padded to align with device block sizes, typically 1 MiB boundaries, as the requires this for mounting; this can be achieved post-creation using tools like dd to append zero bytes (e.g., dd if=/dev/zero of=target.sqsh bs=1M count=1 >> target.sqsh adjusted for size). The resulting layout follows the standard SquashFS structure, with selectable compression algorithms applied to data blocks. Common error handling during image creation includes issues like permission denied (ensure read access to sources and write access to output), insufficient disk space (verify target location has enough free space, often several times the uncompressed source size during temporary operations), and invalid options such as unsupported block sizes or compression algorithms (). Out-of-memory errors may occur with very large sources or high block sizes on resource-constrained systems, resolvable by reducing parallelism or block size.

Mounting and Extraction

SquashFS images are accessed in a running system primarily through ing, which integrates the compressed filesystem into the directory hierarchy as a read-only view. The standard method uses the mount command with the -t squashfs option; for -based images not on a block device, the -o [loop](/page/Loop) option enables mounting to treat the as a block device. For example, mount -t squashfs -o loop image.sqsh /mnt/point attaches the image at the specified mount point, assuming the SquashFS module is loaded via [modprobe](/page/Modprobe) squashfs or compiled into the . Once mounted, SquashFS operates with strict read-only semantics, where the handles all and reads by blocks, inodes, and on-the-fly using supported algorithms such as Zlib, LZ4, LZO, , or . This occurs transparently during access, with mount options like threads=multi allowing multi-threaded processing to distribute the workload across CPU cores for better . To optimize repeated accesses, the maintains fixed caches for (64 KiB), fragments (1 MiB), and block indexes (64 KiB), reducing overhead for frequently used . For full extraction of SquashFS contents outside of a mounted view, the unsquashfs utility from the official squashfs-tools package unpacks the image to a target directory, decompressing all files, directories, and extended attributes. By default, it preserves original file permissions, timestamps, and xattrs via the -xattrs option, directing output to a subdirectory named squashfs-root unless overridden with -d /path/to/extract. Selective extraction is possible by specifying files or directories as arguments, and the -f flag forces overwrites of existing targets. To enable writable modifications atop a SquashFS image without altering the original, union mounts combine it with overlay filesystems such as or AUFS, using the SquashFS mount as the read-only lower layer and a writable directory (e.g., on or disk) as the upper layer. For , this is achieved via mount -t overlay overlay -o lowerdir=/squashfs/mnt,upperdir=/writable/dir,workdir=/work/dir /merged/point, allowing changes to appear persistent in the merged view while leaving the base image intact. Key limitations of SquashFS access include its inherent read-only nature, prohibiting direct writes or modifications to the mounted image, which requires extraction or overlays for any changes. introduces performance overhead, particularly for random reads or large uncompressed files, though caching and threaded options mitigate this; for instance, single-threaded mode may on multi-core systems, while per-CPU threading can scale better but increases use.

Supporting Software

The SquashFS ecosystem relies on a suite of core user-space tools known as squashfs-tools, which are licensed under GPLv2 or later and include utilities such as mksquashfs for creating compressed filesystem images, unsquashfs for extracting them, and sqfstar for generating self-extracting archives. These tools have been actively maintained on since 2015 by developer Phillip Lougher. In the , SquashFS is supported as a built-in read-only filesystem module since version 2.6.29, configurable via the CONFIG_SQUASHFS kernel option, which enables support for various compression algorithms including . Cross-platform compatibility extends beyond , with ports available for through the sysutils/squashfs-tools package in its ports collection, allowing creation and extraction of SquashFS images. On Windows, SquashFS images can be opened and extracted using , while custom builds of squashfs-tools provide native support; environments leverage squashfs-tools from the Android Open Source Project for image handling. For programmatic access, libraries such as libsquash provide a portable user-space of SquashFS that can be embedded in applications for reading and writing images without kernel dependencies. SquashFS also integrates with tools like genisoimage, commonly used to embed SquashFS images within ISO files for bootable media. Development remains active, with the latest squashfs-tools release, version 4.7.4 (November 2025), a bug-fix release following version 4.7.3 which incorporated optimizations for reading (up to 1500× speed improvement) and bug fixes addressing compression corruptions in iterative workflows.

Applications

Embedded Systems

SquashFS plays a pivotal role in embedded systems, particularly in resource-constrained environments such as routers and (IoT) devices, where storage efficiency and reliability are paramount. Its compressed, read-only nature makes it ideal for firmware images stored on limited , allowing developers to pack essential system components into small footprints without sacrificing accessibility. By leveraging compression algorithms like LZ4, LZO, or , SquashFS achieves significant space savings in size, enabling deployment on smaller flash storage ranging from 4 to 16 MB. For instance, in a , a root filesystem uncompressed to 121 MB was reduced to just 7.8 MB using SquashFS, demonstrating substantial efficiency for mixed content including binaries and configuration files. This reduction is particularly beneficial for kernel modules and binaries, which often exhibit good depending on the algorithm and block size, as larger blocks enhance ratios for repetitive binary data while maintaining quick . Prominent examples include distributions for routers, where SquashFS serves as the default root filesystem to fit within constrained NOR or flash on devices like those with 8-32 MB storage. In applications, such as smart home gateways or industrial sensors, SquashFS is commonly used for immutable to minimize storage demands and ensure consistent operation across deployments. Key benefits in these contexts include fast times enabled by , which avoids loading the entire into upfront, and inherent immutability that enhances system reliability by preventing runtime modifications that could lead to on hardware. This read-only design aligns well with the persistent, non-volatile needs of embedded hardware, reducing wear on through minimized write cycles. However, SquashFS's read-only limitation presents challenges for embedded systems requiring updates; changes necessitate either full firmware image flashes, which can be time-consuming on low-bandwidth connections, or the use of overlay filesystems like to provide a writable layer atop the compressed base. In practice, many setups combine SquashFS for the base rootfs with an overlay for configuration and logs, balancing immutability with flexibility.

Live Media

SquashFS serves a critical role in live and DVDs by enabling the creation of compact, bootable ISO images for operating system installations and rescue environments, where the bulk of the filesystem is stored as a compressed, read-only archive. Distributions such as employ SquashFS to package the root filesystem into a single filesystem.squashfs file within the ISO, achieving significant size reductions—for instance, compressing multi-gigabyte OS trees to under 2 GB, which fits on standard optical media while preserving fast access times. The boot process for these live media typically starts with an initial RAM disk (initrd or initramfs) that loads a minimal along with essential drivers and boot scripts. Once hardware detection is complete, the SquashFS image is mounted in loopback mode as the read-only root filesystem, overlaid with a instance in to provide writable layers for session-specific changes, leveraging techniques for seamless read-write functionality. Prominent examples include Live, which uses SquashFS for its hybrid ISO images and offers persistence options through dedicated partitions or filesystems labeled "persistence" to retain user data and configurations across reboots. Fedora LiveOS similarly relies on a squashfs.img file containing the compressed root, with the Media Writer tool streamlining the process of writing these images to USB drives for portable booting. Key advantages of SquashFS in this context include high portability, as the media can boot and run the OS without any host or disk modifications, and its efficiency, which permits inclusion of extensive software suites on media limited to 700 MB or 4.7 GB DVDs. Over time, live media has shifted from earlier compressed formats like CramFS to SquashFS, driven by the latter's improved .

Modern Packaging Formats

SquashFS has been integrated into several modern packaging formats for , leveraging its compressed read-only nature to bundle applications and dependencies efficiently. In , a format for creating portable applications, the file system image is built using SquashFS to encapsulate the application's binaries, libraries, and other dependencies within a single executable file. This allows users to run the application directly without installation, as the runtime component mounts the SquashFS image via to access the bundled contents on demand. Snap packages, developed by , employ SquashFS as the core of their read-only assertion layer, where the entire snap is stored as a compressed SquashFS archive mounted at /snap/<snap name>/<revision>/. This design ensures immutable content delivery, preventing modifications to the core files while supporting writable overlays for user data and configuration through paths like $SNAP_USER_DATA. The combination facilitates secure, versioned updates without risking system integrity. In container technologies adhering to the (OCI) standards, SquashFS is utilized in formats like OCI-SIF to compress root filesystems into a single layer, enhancing compatibility with tools such as and Podman. For instance, when pulling an OCI image with Apptainer (formerly ), the multi-layer structure is squashed into a SquashFS-based single file, reducing storage overhead while maintaining OCI for base layers. This approach is particularly beneficial for environments where compressed roots minimize transfer times and disk usage. Android's over-the-air (OTA) update mechanism supports as an alternative filesystem for A/B seamless updates, where it can be used to create compressed read-only images for the /system and /vendor partitions. This enables efficient delivery of updates by shipping pre-optimized artifacts directly in the image, equivalent in storage efficiency to ext4-based setups but with added compression benefits for bandwidth-constrained devices. The adoption of SquashFS in these formats provides key advantages, including atomic updates through its immutable read-only structure, which ensures that changes are applied entirely or not at all, minimizing partial failure risks. Compression significantly reduces bandwidth requirements for distribution, as seen in snap and AppImage downloads, while the read-only enforcement enhances security by limiting runtime tampering opportunities, often complemented by extended attributes for access controls.

History and Development

Origins and Early Releases

SquashFS was created by Phillip Lougher as a user-space tool for to provide a highly compressed, read-only filesystem alternative to existing options like CramFS. The initial version 1.0 was released on October 23, 2002, along with the first iteration of the mksquashfs tool for creating SquashFS images. This early release focused on basic compression using (via zlib), supporting block sizes up to 8 and imposing 32-bit limits on filesystem and file sizes, capping volumes at 4 GB. The development of SquashFS was motivated by the need for improved compression ratios and larger file support compared to CramFS, particularly for embedded projects and distributions like where space efficiency was critical for read-only storage. Version 2.0, released in July 2004, introduced fragment blocks for better small file compression and increased block sizes to 64 KB, while retaining the core compression and 32-bit architecture constraints. These versions emphasized simplicity and performance for constrained environments, with inodes and directories also compressed to maximize space savings. From 2003 onward, SquashFS garnered community interest through discussions on mailing lists and dedicated forums, where developers explored its potential as an out-of-tree module. Licensed under the GNU General Public License (GPL) version 2, it encouraged open contributions and adoption in user-space applications. By 2005, prior to its , SquashFS had become a staple in userland for building live CDs, enabling compact, bootable media for distributions like through mounting and union filesystems.

Kernel Integration

SquashFS was accepted into the mainline as part of version 2.6.29, released in March 2009, following several years of development as an out-of-tree patch set. This integration marked the end of a prolonged effort to upstream the filesystem, which had been widely used in distributions despite lacking official kernel support. The merge included support for the SquashFS 4.0 on-disk format, which introduced 64-bit addressing to handle filesystems and individual files larger than 4 GB, along with increased limits such as block sizes up to 1 MB for improved efficiency. These enhancements addressed key limitations in prior versions, enabling broader applicability in resource-constrained environments. Subsequent kernel releases built upon this foundation with targeted improvements to and handling. In Linux 2.6.34, released in May 2010, support for LZMA and LZO compression algorithms was added, expanding beyond the original method to offer better trade-offs in compression ratios and decompression speeds. This was followed in Linux 2.6.36, released in October 2010, by the addition of extended attributes (xattrs), allowing storage of additional such as security labels and user-defined properties, which enhanced compatibility with -like semantics for file operations. By this point, SquashFS achieved fuller alignment with standard filesystem expectations, including support for symbolic links, device nodes, and other inode types necessary for compliance in read-only contexts. Further refinements came in Linux 2.6.38, released in March 2011, with the introduction of LZMA2 (via ) compression, providing superior compression densities while maintaining reasonable performance for read-heavy workloads. These developments were driven primarily by demands from the distribution, which had long packaged SquashFS for live media and installation images, and the embedded Linux community, where space efficiency is paramount for devices with limited flash storage. The cumulative effect by the 2.6.35 milestone solidified SquashFS as a mature, kernel-native option for compressed, read-only storage up to the 4.14 kernel series in 2017.

Recent Enhancements

Since its integration into the , SquashFS has seen ongoing optimizations to its compression algorithms, particularly for and LZ4, enhancing decompression efficiency in resource-constrained environments. Although support was initially added in 4.14, subsequent updates to the Zstd library in kernel 5.13 improved SquashFS decompression performance by approximately 15%, benefiting applications like embedded systems where rapid access to compressed data is critical. Similarly, LZ4 compression, introduced earlier in kernel 3.19, received continued refinements in squashfs-tools releases, including better handling of sparse files to reduce overhead during extraction. Security enhancements post-2020 have focused on addressing vulnerabilities in both the implementation and user-space tools. For instance, squashfs-tools 4.5 was affected by CVE-2021-41072, a directory traversal flaw in the unsquashfs utility that could allow arbitrary file overwrites during extraction; this was patched in subsequent updates to prevent exploitation. In the , fixes for issues like uninitialized value reads in metadata parsing were incorporated into versions 6.12 and later, improving robustness against malformed images. These patches, driven by tools like syzkaller, ensure integrity without introducing significant performance penalties. Extended attribute (xattr) support has been significantly bolstered to accommodate larger and more complex needs. The squashfs-tools 4.6 in March 2023 introduced major improvements in xattr handling, enabling better preservation of labels and user-defined attributes during filesystem and , which is essential for modern containerized workloads. This builds on earlier xattr , allowing SquashFS to store up to 2^48 bytes of compressed xattr data per inode while maintaining efficiency. Recent versions in the 6.x series have delivered and efficiency gains, particularly relevant for ARM-based devices common in applications. 6.14 reduced SquashFS memory usage during mounting by optimizing cache allocation and using folios, lowering peak consumption in high-compression scenarios. Additionally, squashfs-tools 4.7, released in June 2025, accelerated filesystem creation by 20% to over 10x through parallel I/O support tailored for SSDs and network storage, with further optimizations in 4.7.3 yielding up to 1500x speedups in specific copy operations. Ongoing development includes experimental userland implementations for limited write support, such as the libsquash library, which enables in-memory modifications and repacking without kernel remounting, facilitating dynamic updates in non-embedded contexts. Looking ahead, integration with via projects like squashfuse offers potential for user-space enhancements, allowing seamless mounting and overlay-based modifications to support more flexible, read-write-like behaviors in future iterations.

References

  1. [1]
    Squashfs 4.0 Filesystem - The Linux Kernel documentation
    Squashfs is a compressed read-only filesystem for Linux. It uses zlib, lz4, lzo, xz or zstd compression to compress files, inodes and directories.
  2. [2]
    Squashfs - Just Solve the File Format Problem
    Aug 20, 2025 · Squashfs is read-only filesystem that features optional compression for Linux. Typically used as a "live image" for booting Linux off a ...
  3. [3]
    squashfs - a compressed fs for Linux / News - SourceForge
    Second release of Squashfs 3.1 to fix a -sort bug in Mksquashfs. If you don't use the -sort option there's no need to upgrade. Posted by Phillip Lougher 2006-08 ...Missing: history | Show results with:history
  4. [4]
    Squashfs submitted for the mainline - LWN.net
    Oct 29, 2008 · According to Lougher, these performance numbers were gathered a number of years ago, with older versions of the code; newer numbers should be ...
  5. [5]
  6. [6]
    Tag: squashfs - Bootlin
    Sep 21, 2023 · SquashFS is a very popular read-only compressed root filesystem, widely used in embedded systems. It has been supported in the Linux kernel for many years.
  7. [7]
    What is SquashFS - The Linux Documentation Project
    For archiving purposes, SquashFS gives you a lot more flexibility and performance speed than a tarball archive. SquashFS is distributed as a Linux kernel source ...
  8. [8]
    SquashFS - ADMIN Magazine
    SquashFS is a compressed read-only filesystem for Linux. It takes data and creates something like a compressed “archive” that can be mounted on Linux systems.
  9. [9]
    4. Creating and using squashed file systems
    With SquashFS, you can compress large file systems that will be used in live CDs (just as an example). For this purpose SquashFS is also used with UnionFS.Missing: definition | Show results with:definition
  10. [10]
    Squashfs released (a highly compressed filesystem)
    ANNOUNCEMENT: Squashfs released (a highly compressed filesystem). Phillip Lougher (phillip@lougher.demon.co.uk) Wed, 30 Oct 2002 02:29:01 +0000.
  11. [11]
    Squashfs Binary Format
    Mar 23, 2024 · SquashFS supports data and metadata compression through zlib, lz4, lzo, lzma, xz or zstd. For fast random access, compressed files are split up ...About · Overview · The Superblock · Inode Table
  12. [12]
    mksquashfs(1) — squashfs-tools — Debian testing
    Squashfs is a highly compressed read-only filesystem for Linux. It uses either gzip/xz/lzo/lz4/zstd compression to compress both files, inodes and directories.
  13. [13]
    mksquashfs(1) — squashfs-tools — Debian unstable
    Squashfs is a highly compressed read-only filesystem for Linux. It uses either gzip/xz/lzo/lz4/zstd compression to compress both files, inodes and directories.
  14. [14]
    Re: [Squashfs-devel] how detect duplicated file work here?
    I played around with this before releasing Squashfs 1.0. In practice > I found the additional overhead of doing block based duplicate > checking was very ...
  15. [15]
    Image Compression Revisited | Pegasus Docs
    Oct 24, 2023 · The uncompressed Squashfs is 99.7% of the original size, since some duplicate files were removed. lz4 is as fast or faster than no compression.<|control11|><|separator|>
  16. [16]
    mount(8) - Linux manual page - man7.org
    The mount command compares filesystem source, target (and fs root for bind mount or btrfs) to detect already mounted filesystems. The kernel table with already ...
  17. [17]
    unsquashfs - tool to uncompress squashfs filesystems
    NAME. unsquashfs - tool to uncompress squashfs filesystems. SYNOPSIS. unsquashfs [OPTIONS] FILESYSTEM [directories or files to extract]. DESCRIPTION. Squashfs ...
  18. [18]
    Overlay Filesystem - The Linux Kernel documentation
    Overlay Filesystem¶. This document describes a prototype for a new approach to providing overlay-filesystem functionality in Linux (sometimes referred to as ...
  19. [19]
    Systemd, read-only rootfs and overlay file system over /etc - Bootlin
    Sep 21, 2023 · We have used systemd with the storage consisting of a read-only root filesystem (SquashFS) and an overlay file system (OverlayFS) mounted on /etc.
  20. [20]
    squashfs-tools 4.7.3-1 (x86_64) - Arch Linux
    Tools for squashfs, a highly compressed read-only filesystem for Linux. Upstream URL: https://github.com/plougher/squashfs-tools. License(s):, GPL-2.0-or-later.
  21. [21]
    CONFIG_SQUASHFS: SquashFS 4.0 - Squashed file system support
    Squashfs is a highly compressed read-only filesystem for Linux. It uses zlib, lz4, lzo, xz or zstd compression to compress both files, inodes and directories.
  22. [22]
    Linux_2_6_29 - Linux Kernel Newbies
    Linux 2.6.29 adds kernel based graphic mode setting, WiMAX support, Access Point support in the wifi stack, the inclusion of the btrfs and squashfs filesystems.Kernel Modesetting · Squashfs · Tuz replaces Tux for this release · NetworkMissing: CONFIG_SQUASHFS | Show results with:CONFIG_SQUASHFS
  23. [23]
    sysutils/squashfs-tools: Set of tools to manipulate ... - FreshPorts
    Squashfs is a compressed read-only filesystem for Linux. Squashfs is intended for general read-only filesystem use, for archival use (i.e. in cases where a ...
  24. [24]
    How to handle squashfs in Windows - Stack Overflow
    Apr 7, 2016 · 7-Zip is capable of opening squashfs images and extracting their files. I tested this on 7-Zip version 15.14 [64-bit] on Windows 10 with a squashfs image which ...Reading a SquashFS archiveInvestigating squashfs compression ratioMore results from stackoverflow.comMissing: WinSquash | Show results with:WinSquash
  25. [25]
    Squashfs Tools for Windows - Erwan's Blog
    Jul 12, 2014 · I've made my own compile of the SquashFS Tools due to LZMA usage. This is v4.3 of the SquashFS Tools with max (de)compressor support!
  26. [26]
    pmq20/libsquash: Portable, user-land SquashFS that can ... - GitHub
    Portable, user-land SquashFS that can be easily linked and embedded within your application. Build status: Linux and Darwin Build status: WindowsMissing: Android | Show results with:Android
  27. [27]
    Building your own customized LiveISO from Scratch - Medium
    May 26, 2019 · We will need to install the syslinux, squashfs-tools and genisoimage packages to built the ISO. The Disk Image: The disk image folder ...Missing: integration | Show results with:integration
  28. [28]
  29. [29]
    Corrupted squashfs when running mksquashfs with zstd ... - GitHub
    Mar 12, 2025 · Hi! We have been using mksquashfs with zstd compression, and after a few iterations of compression + we see a corruption in squashfs file.
  30. [30]
    [OpenWrt Wiki] The OpenWrt Flash Layout
    Oct 18, 2023 · The most common splitting here is kernel, followed by padding, followed by SquashFS root filesystem, followed by padding, followed by free space ...Types of flash memory · Partitioning of NOR flash... · Partitioning of NAND flash...
  31. [31]
    Relation between eMMC Flash partition size and squash rootfs size
    Nov 21, 2017 · From box, using df -h show /dev/root size is 7.8 MB based on squashfs. But du -sh / which returns 121.4 MB. How does 7.8 MB extracted to 121.4 ...<|control11|><|separator|>
  32. [32]
    Embedded Linux: Using Compressed File Systems - LWN.net
    Jan 30, 2007 · Both SquashFS and CramFS use zlib compression. However, CramFS uses a fixed size 4KB block while SquashFS supports from 0.5KB to 64KB. This ...
  33. [33]
    Looking for sophisticated malware in IoT devices - Securelist
    Sep 23, 2020 · For instance, SquashFS is a compressed file system for Linux that is quite common among IoT manufacturers. It's very straightforward to mount or ...
  34. [34]
    LiveCDCustomization - Community Help Wiki - Ubuntu Documentation
    Feb 24, 2024 · There is a guide on how to create a LiveCD from scratch. This guide is based on customisation from an existing Ubuntu 22.04.1 LTS amd64 LiveCD.
  35. [35]
    live-boot(7) — live-boot-doc — Debian trixie — Debian Manpages
    ### Summary of Debian Live Boot Process with SquashFS
  36. [36]
    LiveOS image - Fedora Project Wiki
    Fedora LiveOS images are Live CD/DVD images for their GNU/Linux OS, with file systems in the /LiveOS folder.
  37. [37]
    Fedora Media Writer: The fastest way to create Live USB boot media
    Apr 26, 2016 · Fedora Media Writer is a tool that downloads and writes a Fedora flavor onto a USB drive, which can be used to boot up any system.<|control11|><|separator|>
  38. [38]
    Architecture - AppImage documentation
    An AppImage consists of two parts: a runtime and a file system image. For the current type 2, the file system in use is SquashFS.
  39. [39]
    The snap format | Snapcraft documentation
    When installed, the SquashFS file for the snap is mounted read-only at the following location: /snap/<snap name>/<revision>/. This method delivers fast and ...
  40. [40]
    OCI-SIF Container Images: Unraveling Their Features and Benefits
    Jul 12, 2024 · OCI-SIF images can be pushed to a registry as an OCI image; however, other runtimes do not support the squashFS layer format. The images can ...
  41. [41]
    Frequently asked questions - Android Open Source Project
    Oct 9, 2025 · The actual storage used with ext4 A/B is identical to SquashFS A/B, because if we had used SquashFS we would have shipped the preopted .odex ...
  42. [42]
    Squashfs released (a highly compressed filesystem) [LWN.net]
    Hi, First release of squashfs. Squashfs is a highly compressed read-only filesystem for Linux (kernel 2.4.x). It uses zlib compression to ...
  43. [43]
    squashfs - a compressed fs for Linux / News: squashfs1.2 released
    Three new options "-noappend", "keep-as-directory" and "-root-becomes" have been added. Posted by Phillip Lougher 2003-03-13. Log in to post a comment.Missing: LKML | Show results with:LKML
  44. [44]
    squashfs-announce Mailing List for squashfs - a compressed fs for ...
    Hi, I'm pleased to announce the release of Squashfs tools 4.5. This release marks 20 years since development started on Squashfs, and there are ...Missing: key | Show results with:key
  45. [45]
    2.6.29 merge window, part 2 - LWN.net
    Jan 14, 2009 · Squashfs has been packaged by distributors for years; its merger into the mainline was certainly overdue. There is now kernel support for WiMAX ...
  46. [46]
    Linux_2_6_34 - Linux Kernel Newbies
    Squashfs. Add support for lzma and lzo compression (commit), (commit). FAT. Add support for large disks (commit). 4. Networking. Add a mac-vlan ...
  47. [47]
    Squashfs tools 4.1 released - LWN.net
    Sep 20, 2010 · Extended attribute support is in 2.6.35 and later kernels. File systems with extended attributes can be mounted on 2.6.29 and later kernels ...
  48. [48]
    Linux_2_6_38 - Linux Kernel Newbies
    Mar 14, 2011 · SQUASHFS. Add XZ compression (commit), (commit). NILFS2. Support the fiemap ioctl, used to get extent information for a inode (commit). 8 ...
  49. [49]
    Linux kernel 2.6.29 – New features for embedded users - Bootlin
    Mar 25, 2009 · Squashfs is a block filesystem, but since it is read-only, you can also use it on flash partitions, through the mtdblock driver. It's fine as ...Missing: mainline merge
  50. [50]
    Linux 5.13 To Allow Zstd Compressed Modules, Zstd Update ...
    May 3, 2021 · With this pending Zstd code update for the kernel, Btrfs with Zstd compression is 5~15% faster, SquashFS decompression is ~15% faster, F2FS Zstd ...
  51. [51]
    SquashFS Tools 4.7 Released: "20% To More Than Ten Times Faster"
    Jun 3, 2025 · SquashFS-Tools 4.7 is out today as a big feature update to the user-space utilities for creating/modifying/extracting SquashFS read-only file-system images.
  52. [52]
    CVE-2021-41072 Detail - NVD
    Sep 13, 2021 · squashfs_opendir in unsquash-2.c in Squashfs-Tools 4.5 allows Directory Traversal, a different vulnerability than CVE-2021-40153.
  53. [53]
    squashfs-devel - a compressed fs for Linux - SourceForge
    > block/bdev: lift block size restrictions to 64k ... New -xattrs-exclude option to exclude extended attributes from files using a regular expression.
  54. [54]
    vasi/squashfuse: FUSE filesystem to mount squashfs archives - GitHub
    Squashfuse lets you mount SquashFS archives in user-space. It supports almost all features of the SquashFS format, yet is still fast and memory-efficient.