MKSQUASHFS(1) MKSQUASHFS(1) (NAME) mksquashfs - squashfs (SYNOPSIS) mksquashfs source1 source2 ... FILESYSTEM [OPTIONS] [-e list of exclude dirs/files] (DESCRIPTION) Squashfs . gzip/xz/lzo/lz4/zstd inode . Inode . 4K 1Mbytes ( 128K ). Squashfs ( .tar.gz ) / ( ) . (OPTIONS) : -b BLOCK-SIZE BLOCK-SIZE. 128 Kbytes . K KB Kbytes M MB Mbytes . -comp COMP COMP. COMP -help-comp COMP ALL . : gzip () lzo lz4 xz zstd lzma. -noI inode . -noId uid/gid ( -noI ). -noD . -noF (fragment) . -noX . -no-compression . -noI -noD -noF -noX . : -tar tar (stdin). -no-strip tar . -tarstyle -no-strip. -cpiostyle cpio (stdin) . -cpiostyle0 -cpiostyle null . -print0 find. -no-exports NFS (exportable) ( -tar). -exports NFS (). -no-sparse (sparse) . -no-tailends (tail ends) (). -tailends . -no-fragments (fragments) . -no-duplicates . -no-hardlinks (hardlink) . -keep-as-directory . : -mkfs-time TIME TIME. TIME "inode" ( inode) (1970-01-01) "date" . date "now" "last week" "Wed Feb 15 21:02:39 GMT 2023". -inode-time TIME TIME. TIME "inode" ( inode) "date" "now" "last week" "Wed Feb 15 21:02:39 GMT 2025". -root-time . -root-time TIME TIME. TIME "inode" ( inode) "date" "now" "last week" "Wed Feb 15 21:02:39 GMT 2025". -repro (reproducible). -mkfs-time inode inode . . -repro-time TIME . -mkfs-time TIME -inode-time TIME TIME . -repro . : -all-root root . -root-mode MODE MODE. MODE (octal) ( ). ugo=rwx 0777 . -root-uid USER USER . USER uid . -root-gid GROUP GROUP . GROUP gid . -force-file-mode MODE ( ) MODE. MODE ( ). -force-dir-mode MODE MODE. MODE ( ). -force-uid USER uid USER . USER uid . -force-gid GROUP gid GROUP . GROUP gid . -uid-gid-offset VALUE uid gid VALUE. VALUE . : -p PSEUDO-DEFINITION . () . " " . -pd "d mode uid gid" . . . -pd "D time mode uid gid" . D mode uid gid . -pf PSEUDO-FILE PSEUDO-FILE stdin - . . -pseudo-override uid gid -all-root -force-uid -force-gid . : -sort SORT-FILE SORT-FILE. . -32768 32767 0 . -ef EXCLUDE-FILE / ( ). . -wildcards (globbing) / . -regex POSIX / . -max-depth LEVELS LEVELS . -one-file-system . (mount point) . . -one-file-system-x . -one-file-system . (xattrs) : -no-xattrs . -xattrs (). -xattrs-exclude REGEX xattr REGEX. REGEX POSIX -xattrs-exclude '^user.' . -xattrs-include REGEX xattr REGEX. REGEX POSIX -xattrs-include '^user.' . -xattrs-add NAME=VAL NAME VAL . xattr ( man 7 xattr ). . VAL ( ) 0s base64 0x . 0t ASCII . xattr . Mksquashfs: -version . -exit-on-error (fatal) . -quiet . -info (stdout). . -info-file . -info-file FILE FILE. . -no-progress . -progress -info. -percentage . dialog --gauge . -throttle PERCENTAGE I/O . I/O Mksquashfs . -limit PERCENTAGE I/O . I/O CPU Mksquashfs ( -throttle). -processors NUMBER NUMBER . . -mem SIZE SIZE (). K M G . -mem-percent PERCENT PERCENT . 25% . -mem-default . -single-reader (thread) . () . -small-readers N N ( ) () ( 4). -block-readers N N ( ) () ( 4). -overcommit PERCENT PERCENT . CPU . 0% overcommit (thrashing) . . : -noappend . -root-becomes NAME / NAME . -no-recovery (recovery) . -recovery-path NAME NAME . -recover NAME NAME. : -action ACTION@EXPRESSION EXPRESSION ACTION TRUE. -log-action ACTION@EXPRESSION -action . -true-action ACTION@EXPRESSION -action TRUE . -false-action ACTION@EXPRESSION -action FALSE . -action-file FILE action FILE. -log-action-file FILE -log-action FILE. -true-action-file FILE -true-action FILE. -false-action-file FILE -false-action FILE. Tar: -default-mode MODE tar . MODE . MODE ( ). u=rwx,go=rx 0755 . . -default-uid VALUE tar uid . Mksquashfs VALUE . VALUE uid . uid . -default-gid VALUE tar gid . Mksquashfs VALUE . VALUE gid . gid . -ignore-zeros tar Mksquashfs. tar (EOF) Mksquashfs tar . Mksquashfs . -numeric-owner uid gid tar . Mksquashfs uid gid . ( ): -stream (STDOUT) . (pipe) ssh . Squashfs (super block) . -fix Unsquashfs 4.7.3 . FILESYSTEM - . -stream . -fix FILESYSTEM FILESYSTEM -stream. -nopad 4K (pad) . -offset OFFSET OFFSET FILESYSTEM. K M G . 0 . -o OFFSET -offset. : -help ( ). -help-option REGEX REGEX ( stdout). -help-section SECTION SECTION ( stdout). SECTION . "list" . -help-comp COMP COMP. "list" "all" . -help-all Mksquashfs ( stdout). -Xhelp . -h -help. -ho REGEX -help-option. -hs SECTION -help-section. -ha -help-all. -no-pager . -cols WIDTH WIDTH . . : -fstime TIME -mkfs-time. -always-use-fragments -tailends. -root-owned -all-root. -noInodeCompression -noI. -noIdTableCompression -noId. -noDataCompression -noD. -noFragmentCompression -noF. -noXattrCompression -noX. -pseudo-dir -pd. (PSEUDO FILE DEFINITION FORMAT) -p "filename d mode uid gid" . -p "filename m mode uid gid" filename. -p "filename b mode uid gid major minor" . -p "filename c mode uid gid major minor" . -p "filename f mode uid gid command" (stdout) command. -p "filename s mode uid gid symlink" . -p "filename i mode uid gid [s|f]" (s) FIFO (f). -p "filename x name=val" . -p "filename h linkname" linkname . -p "filename l linkname" linkname. -p "filename L pseudo_filename" . -p "filename D time mode uid gid" time. -p "filename M time mode uid gid" time. -p "filename B time mode uid gid major minor" time. -p "filename C time mode uid gid major minor" time. -p "filename F time mode uid gid command" time. -p "filename S time mode uid gid symlink" time. -p "filename I time mode uid gid [s|f]" /fifo time. (SYMBOLIC MODE SPECIFICATION) [ugoa]*[[+-=]PERMS]+ . PERMS [rwxXst]+ [ugo] () . ugoa u (user) g (group) o (other) a (all ugo). + - = . + - = . (PERMS) [rwxXst] ugoa r w x . X x . s (SUID/SGID) t (sticky bit) (sticky) . u g o . (EXIT STATUS) 0 Mksquashfs . 1 Mksquashfs ( ). (COMPRESSORS AVAILABLE AND COMPRESSOR SPECIFIC OPTIONS) gzip (): -Xcompression-level COMPRESSION-LEVEL COMPRESSION-LEVEL 1 .. 9 ( 9). -Xwindow-size WINDOW-SIZE WINDOW-SIZE 8 .. 15 ( 15). -Xstrategy strategy1,strategy2,...,strategyN strategy1,strategy2,...,strategyN . : default filtered huffman_only run_length_encoded fixed. lzo: -Xalgorithm ALGORITHM ALGORITHM : lzo1x_1 lzo1x_1_11 lzo1x_1_12 lzo1x_1_15 lzo1x_999 (). -Xcompression-level COMPRESSION-LEVEL COMPRESSION-LEVEL 1 .. 9 ( 8). lzo1x_999 . lz4: -Xhc LZ4 (High Compression). xz: -Xbcj filter1,filter2,...,filterN filter1,filter2,...,filterN ( ) . : x86 arm armthumb arm64 powerpc sparc ia64 riscv. -Xdict-size DICT-SIZE DICT-SIZE XZ. . . xz 2^n 2^n+2^(n+1) . 75% 50% 37.5% 25% 32K 16K 8K . zstd: -Xcompression-level COMPRESSION-LEVEL COMPRESSION-LEVEL -131072 .. -1 1 .. 22 ( 15). --fast zstd . lzma: ( ) ( - ) (ENVIRONMENT) SQFS_CMDLINE sqfs_cmdline Mksquashfs . . . SOURCE_DATE_EPOCH . SOURCE_DATE_EPOCH SOURCE_DATE_EPOCH . https://reproducible-builds.org/docs/source-date-epoch . PAGER . . /usr/bin/pager . (EXAMPLES) mksquashfs DIRECTORY IMAGE.SQFS Squashfs DIRECTORY IMAGE.SQFS. Mksquashfs ( gzip) 128 Kbytes . mksquashfs DIRECTORY FILE1 FILE2 IMAGE.SQFS Squashfs DIRECTORY FILE1 FILE2. . mksquashfs DIRECTORY IMAGE.SQFS -b 1M -comp zstd 1 Mbyte Zstandard . mksquashfs DIRECTORY IMAGE.SQFS -all-time now "now" ( ) . mksquashfs DIRECTORY IMAGE.SQFS -force-uid phillip -force-gid phillip "phillip". mksquashfs DIRECTORY IMAGE.SQFS -force-file-mode ugo+r,go-w . mksquashfs DIRECTORY IMAGE.SQFS -e file1 file2 file1 file2 DIRECTORY . . mksquashfs DIRECTORY IMAGE.SQFS -wildcards -e "*.gz" DIRECTORY "*.gz" . mksquashfs DIRECTORY IMAGE.SQFS -wildcards -e "... *.gz" "*.gz" DIRECTORY . "..." " " (non-anchored) . : Mksquashfs ( ) . mksquashfs DIRECTORY IMAGE.SQFS -p "build_dir d 0644 0 0" "build_dir" . mksquashfs DIRECTORY IMAGE.SQFS -p "version.txt l /tmp/build/version" "version.txt" DIRECTORY "/tmp/build/version" Mksquashfs . mksquashfs DIRECTORY IMAGE.SQFS -p "date.txt f 0644 0 0 date" "date.txt" (stdout) "date" . mksquashfs DIRECTORY IMAGE.SQFS -p "\"hello world\" f 0644 0 0 date" . . mksquashfs - IMAGE.SQFS -p "input f 0644 root root dd if=/dev/sda1 bs=1024" -p "/ d 0644 0 0" /dev/sda1. Mksquashfs fifo Squashfs . "-" . (/) . unsquashfs -pf - IMAGE.SQFS | mksquashfs - NEW.SQFS -pf - (Transcode) IMAGE.SQFS NEW.SQFS Unsquashfs Mksquashfs stdout stdin. Squashfs . : ( ) Mksquashfs . mksquashfs DIRECTORY IMAGE.SQFS -no-xattrs Squashfs. . mksquashfs DIRECTORY IMAGE.SQFS -xattrs-include "^user." Squashfs. mksquashfs DIRECTORY IMAGE.SQFS -xattrs-exclude "^user." Squashfs. mksquashfs DIRECTORY IMAGE.SQFS -xattrs-add "user.comment=hello world" "user.comment" "hello world" Squashfs. mksquashfs DIRECTORY IMAGE.SQFS -xattrs-add "user.comment=0thello world\012" "user.comment" "hello world" (012 ) . mksquashfs DIRECTORY IMAGE.SQFS -xattrs-add "user.comment=0saGVsbG8gd29ybGQ=" "user.comment" base64 "hello world" . mksquashfs DIRECTORY IMAGE.SQFS -action "-xattrs-include(^user.) @ type(f)" ( f) . mksquashfs DIRECTORY IMAGE.SQFS -p "hello_world x user.comment=0tsalve mundi\012" "user.comment" "hello_world" "salve mundi" (012 ). (Actions) mksquashfs DIRECTORY IMAGE.SQFS -action "uncompressed @ (name(*.jpg) || name(*.mpg) ) || (name(*.img) && filesize(>=1G))" "*.jpg" "*.mpg" . "*.img" . . mksquashfs DIRECTORY IMAGE.SQFS -action "chmod(o+r)@! perm(o+r)" DIRECTORY "" Squashfs . mksquashfs DIRECTORY IMAGE.SQFS -action "uid(phillip)@! perm(o+r)" "" Squashfs "phillip" . mksquashfs DIRECTORY IMAGE.SQFS -action "prune @ type(l) && ! exists" DIRECTORY DIRECTORY Squashfs () . mksquashfs DIRECTORY IMAGE.SQFS -action "exclude @ depth(3)" Squashfs ( DIRECTORY ) . mksquashfs DIRECTORY IMAGE.SQFS -action "-xattrs-include(^user.) @ type(f)" ( f) . : (actions) ( ) Mksquashfs . (AUTHOR) Phillip Lougher (COPYRIGHT) (C) 2026 Phillip Lougher << >> ( ) . . << >> . (SEE ALSO) unsquashfs(1), sqfstar(1), sqfscat(1) README 4.7.5 Squashfs-tools : https://github.com/plougher/squashfs-tools/blob/master/Documentation/4.7.5/README.md MKSQUASHFS : https://github.com/plougher/squashfs-tools/blob/master/Documentation/4.7.5/USAGE-MKSQUASHFS.md (CHANGELOG) Squashfs : https://github.com/plougher/squashfs-tools/blob/master/CHANGES.md ACTIONS-README : https://github.com/plougher/squashfs-tools/blob/master/Documentation/4.7.5/ACTIONS-README.md mksquashfs version 4.7.5 March 2026 MKSQUASHFS(1)