sqfstar - tool to create a squashfs filesystem from a tar
archive
cat xxx.tar | sqfstar [OPTIONS] FILESYSTEM [exclude files]
zcat xxx.tgz | sqfstar [OPTIONS] FILESYSTEM [exclude files]
xzcat xxx.tar.xz | sqfstar [OPTIONS] FILESYSTEM [exclude files]
zstdcat xxx.tar.zst | sqfstar [OPTIONS] FILESYSTEM [exclude files]
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. Inodes in the system are very small and all blocks are
packed to minimise data overhead. Block sizes greater than 4K are supported
up to a maximum of 1Mbytes (default block size 128K).
Squashfs is intended for general read-only filesystem use, for
archival use (i.e. in cases where a .tar.gz file may be used), and in
constrained block device/memory systems (e.g. embedded systems) where low
overhead is needed.
- -comp COMP
- select COMP compression. Compressors available: gzip (default), lzo, lz4,
xz, zstd, lzma.
- -b BLOCK_SIZE
- set data block to BLOCK_SIZE. Default 128 Kbytes. Optionally a suffix of K
or M can be given to specify Kbytes or Mbytes respectively.
- -reproducible
- build filesystems that are reproducible (default).
- -not-reproducible
- build filesystems that are not reproducible.
- -mkfs-time
TIME
- set filesystem creation timestamp to TIME, which is an unsigned 32-bit int
indicating seconds since the epoch (1970-01-01).
- -fstime
TIME
- synonym for mkfs-time.
- -all-time TIME
- set all file timestamps to TIME, which is an unsigned 32-bit int
indicating seconds since the epoch (1970-01-01).
- -exports
- make the filesystem exportable via NFS.
- -no-sparse
- don't detect sparse files.
- -no-xattrs
- don't store extended attributes.
- -xattrs
- store extended attributes (default).
- -noI
- do not compress inode table.
- -noId
- do not compress the uid/gid table (implied by -noI).
- -noD
- do not compress data blocks.
- -noF
- do not compress fragment blocks.
- -noX
- do not compress extended attributes.
- -no-fragments
- do not use fragments.
- -no-tailends
- don't pack tail ends into fragments.
- -no-duplicates
- do not perform duplicate checking.
- -no-hardlinks
- do not hardlink files, instead store duplicates.
- -all-root
- make all files owned by root.
- -root-time
TIME
- set root directory time to TIME.
- -root-mode
MODE
- set root directory permissions to octal MODE.
- -root-uid
UID
- set root directory owner to UID.
- -root-gid
GID
- set root directory group to GID.
- -force-uid
UID
- set all file uids to UID.
- -force-gid
GID
- set all file gids to GID.
- -ef EXCLUDE_FILE
- list of exclude dirs/files. One per line.
- -regex
- Allow POSIX regular expressions to be used in exclude dirs/files.
- -version
- print version, licence and copyright message.
- -force
- force Sqfstar to write to block device or file.
- -exit-on-error
- treat normally ignored errors as fatal.
- -quiet
- no verbose output.
- -info
- print files written to filesystem.
- -no-progress
- don't display the progress bar.
- -progress
- display progress bar when using the -info option.
- -throttle
PERCENTAGE
- throttle the I/O input rate by the given percentage. This can be used to
reduce the I/O and CPU consumption of Mksquashfs.
- -limit
PERCENTAGE
- limit the I/O input rate to the given percentage. This can be used to
reduce the I/O and CPU consumption of Mksquashfs (alternative to
-throttle).
- -processors
NUMBER
- Use NUMBER processors. By default will use number of processors
available.
- -mem SIZE
- Use SIZE physical memory. Optionally a suffix of K, M or G can be given to
specify Kbytes, Mbytes or Gbytes respectively.
- -nopad
- do not pad filesystem to a multiple of 4K.
- -offset
OFFSET
- Skip OFFSET bytes at the beginning of FILESYSTEM. Optionally a suffix of
K, M or G can be given to specify Kbytes, Mbytes or Gbytes respectively.
Default 0 bytes.
- -o OFFSET
- synonym for -offset.
- -Xhc
- Compress using LZ4 High Compression.
- -Xbcj
filter1,filter2,...,filterN
- Compress using filter1,filter2,...,filterN in turn (in addition to no
filter), and choose the best compression. Available filters: x86, arm,
armthumb, powerpc, sparc, ia64.
- -Xdict-size
DICT-SIZE
- Use DICT-SIZE as the XZ dictionary size. The dictionary size can be
specified as a percentage of the block size, or as an absolute value. The
dictionary size must be less than or equal to the block size and 8192
bytes or larger. It must also be storable in the xz header as either 2^n
or as 2^n+2^(n+1). Example dict-sizes are 75%, 50%, 37.5%, 25%, or 32K,
16K, 8K etc.
- (no options) (deprecated - no kernel support)
- SOURCE_DATE_EPOCH
- If set, this is used as the filesystem creation timestamp. Also any file
timestamps which are after SOURCE_DATE_EPOCH will be clamped to
SOURCE_DATE_EPOCH. See
https://reproducible-builds.org/docs/source-date-epoch/ for more
information.
Written by Phillip Lougher <phillip@squashfs.org.uk>
Copyright © 2022 Phillip Lougher
<phillip@squashfs.org.uk>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
mksquashfs(1), unsquashfs(1), sqfscat(1)
The README for the Squash-tools 4.5.1 release, describing the new
features can be read here
https://github.com/plougher/squashfs-tools/blob/master/README-4.5.1
The Squashfs-tools USAGE guide can be read here
https://github.com/plougher/squashfs-tools/blob/master/USAGE