mksquashfs
creates and appends to squashfs filesystems
TLDR
SYNOPSIS
mksquashfs source1 [source2...] filesystem [-comp method] [-b blocksize] [-e excludes] [options]
DESCRIPTION
mksquashfs creates and appends to squashfs filesystems. Squashfs is a highly compressed, read-only filesystem commonly used for live CDs, embedded systems, and application packaging (AppImage, snap).
The tool compresses files, inodes, and directories using configurable algorithms. It supports deduplication, extended attributes, and efficient storage of sparse files. Block compression allows random access to compressed data.
PARAMETERS
-comp _method_
Compression algorithm: gzip (default), lzo, lz4, xz, zstd, lzma-b _size_
Data block size; default 128 Kbytes, maximum 1 Mbyte. K/M suffixes supported-e _items_
Exclude specified files and directories-wildcards
Enable glob pattern matching for exclusions-regex
Use POSIX regular expressions for exclusions-all-root
Make all files owned by root-force-uid _user_
Override file owner user-force-gid _group_
Override file owner group-processors _num_
Number of compression threads-mem _size_
Set cache memory size-noI
Disable inode compression-noD
Disable data compression-noF
Disable fragment compression-noX
Disable extended attribute compression-no-compression
Disable all compression-noappend
Do not append to existing filesystem; create a new one-info
Print files written to filesystem-no-recovery
Do not generate a recovery file-recover _file_
Recover filesystem using a recovery file-xattrs
Store extended attributes (default)-no-xattrs
Do not store extended attributes-tar
Read uncompressed tar archive from stdin-quiet
Suppress verbose output-progress
Display progress bar
CAVEATS
Squashfs filesystems are read-only and require the squashfs kernel module. Appending to existing archives may increase fragmentation. Very high compression levels significantly increase creation time. Maximum file size depends on block size configuration.
HISTORY
Squashfs was created by Phillip Lougher and first released in 2002. It was merged into the Linux kernel mainline in version 2.6.29 (2009). The filesystem is widely used in Linux distributions for live media, container images, and read-only root filesystems.
SEE ALSO
unsquashfs(1), sqfscat(1), mount(8)
