1SQFSTAR(1) User Commands SQFSTAR(1)
2
3
4
6 sqfstar - tool to create a squashfs filesystem from a tar archive
7
9 cat xxx.tar | sqfstar [OPTIONS] FILESYSTEM [exclude files]
10 zcat xxx.tgz | sqfstar [OPTIONS] FILESYSTEM [exclude files]
11 xzcat xxx.tar.xz | sqfstar [OPTIONS] FILESYSTEM [exclude files]
12 zstdcat xxx.tar.zst | sqfstar [OPTIONS] FILESYSTEM [exclude files]
13
15 Squashfs is a highly compressed read-only filesystem for Linux. It
16 uses either gzip/xz/lzo/lz4/zstd compression to compress both files,
17 inodes and directories. Inodes in the system are very small and all
18 blocks are packed to minimise data overhead. Block sizes greater than
19 4K are supported up to a maximum of 1Mbytes (default block size 128K).
20
21 Squashfs is intended for general read-only filesystem use, for archival
22 use (i.e. in cases where a .tar.gz file may be used), and in con‐
23 strained block device/memory systems (e.g. embedded systems) where low
24 overhead is needed.
25
27 Filesystem build options:
28 -comp COMP
29 select COMP compression. Compressors available: gzip (default),
30 lzo, lz4, xz, zstd, lzma.
31
32 -b BLOCK_SIZE
33 set data block to BLOCK_SIZE. Default 128 Kbytes. Optionally a
34 suffix of K or M can be given to specify Kbytes or Mbytes re‐
35 spectively.
36
37 -reproducible
38 build filesystems that are reproducible (default).
39
40 -not-reproducible
41 build filesystems that are not reproducible.
42
43 -mkfs-time TIME
44 set filesystem creation timestamp to TIME, which is an unsigned
45 32-bit int indicating seconds since the epoch (1970-01-01).
46
47 -fstime TIME
48 synonym for mkfs-time.
49
50 -all-time TIME
51 set all file timestamps to TIME, which is an unsigned 32-bit int
52 indicating seconds since the epoch (1970-01-01).
53
54 -exports
55 make the filesystem exportable via NFS.
56
57 -no-sparse
58 don't detect sparse files.
59
60 -no-xattrs
61 don't store extended attributes.
62
63 -xattrs
64 store extended attributes (default).
65
66 -noI do not compress inode table.
67
68 -noId do not compress the uid/gid table (implied by -noI).
69
70 -noD do not compress data blocks.
71
72 -noF do not compress fragment blocks.
73
74 -noX do not compress extended attributes.
75
76 -no-fragments
77 do not use fragments.
78
79 -no-tailends
80 don't pack tail ends into fragments.
81
82 -no-duplicates
83 do not perform duplicate checking.
84
85 -no-hardlinks
86 do not hardlink files, instead store duplicates.
87
88 -all-root
89 make all files owned by root.
90
91 -root-time TIME
92 set root directory time to TIME.
93
94 -root-mode MODE
95 set root directory permissions to octal MODE.
96
97 -root-uid UID
98 set root directory owner to UID.
99
100 -root-gid GID
101 set root directory group to GID.
102
103 -force-uid UID
104 set all file uids to UID.
105
106 -force-gid GID
107 set all file gids to GID.
108
109 Filesystem filter options:
110 -ef EXCLUDE_FILE
111 list of exclude dirs/files. One per line.
112
113 -regex Allow POSIX regular expressions to be used in exclude
114 dirs/files.
115
116 Sqfstar runtime options:
117 -version
118 print version, licence and copyright message.
119
120 -force force Sqfstar to write to block device or file.
121
122 -exit-on-error
123 treat normally ignored errors as fatal.
124
125 -quiet no verbose output.
126
127 -info print files written to filesystem.
128
129 -no-progress
130 don't display the progress bar.
131
132 -progress
133 display progress bar when using the -info option.
134
135 -throttle PERCENTAGE
136 throttle the I/O input rate by the given percentage. This can be
137 used to reduce the I/O and CPU consumption of Mksquashfs.
138
139 -limit PERCENTAGE
140 limit the I/O input rate to the given percentage. This can be
141 used to reduce the I/O and CPU consumption of Mksquashfs (alter‐
142 native to -throttle).
143
144 -processors NUMBER
145 Use NUMBER processors. By default will use number of processors
146 available.
147
148 -mem SIZE
149 Use SIZE physical memory. Optionally a suffix of K, M or G can
150 be given to specify Kbytes, Mbytes or Gbytes respectively.
151
152 Expert options (these may make the filesystem unmountable):
153 -nopad do not pad filesystem to a multiple of 4K.
154
155 -offset OFFSET
156 Skip OFFSET bytes at the beginning of FILESYSTEM. Optionally a
157 suffix of K, M or G can be given to specify Kbytes, Mbytes or
158 Gbytes respectively. Default 0 bytes.
159
160 -o OFFSET
161 synonym for -offset.
162
163 Miscellaneous options:
164 -root-owned
165 alternative name for -all-root.
166
167 -noInodeCompression
168 alternative name for -noI.
169
170 -noIdTableCompression
171 alternative name for -noId.
172
173 -noDataCompression
174 alternative name for -noD.
175
176 -noFragmentCompression
177 alternative name for -noF.
178
179 -noXattrCompression
180 alternative name for -noX.
181
182 -help output this options text to stdout.
183
184 -h output this options text to stdout.
185
186 -Xhelp print compressor options for selected compressor.
187
189 gzip (default):
190 -Xcompression-level COMPRESSION-LEVEL
191 COMPRESSION-LEVEL should be 1 .. 9 (default 9).
192
193 -Xwindow-size WINDOW-SIZE
194 WINDOW-SIZE should be 8 .. 15 (default 15).
195
196 -Xstrategy strategy1,strategy2,...,strategyN
197 Compress using strategy1,strategy2,...,strategyN in turn and
198 choose the best compression. Available strategies: default, fil‐
199 tered, huffman_only, run_length_encoded and fixed.
200
201 lzo:
202 -Xalgorithm ALGORITHM
203 Where ALGORITHM is one of: lzo1x_1, lzo1x_1_11, lzo1x_1_12,
204 lzo1x_1_15, lzo1x_999 (default).
205
206 -Xcompression-level COMPRESSION-LEVEL
207 COMPRESSION-LEVEL should be 1 .. 9 (default 8) Only applies to
208 lzo1x_999 algorithm.
209
210 lz4:
211 -Xhc Compress using LZ4 High Compression.
212
213 xz:
214 -Xbcj filter1,filter2,...,filterN
215 Compress using filter1,filter2,...,filterN in turn (in addition
216 to no filter), and choose the best compression. Available fil‐
217 ters: x86, arm, armthumb, powerpc, sparc, ia64.
218
219 -Xdict-size DICT-SIZE
220 Use DICT-SIZE as the XZ dictionary size. The dictionary size
221 can be specified as a percentage of the block size, or as an ab‐
222 solute value. The dictionary size must be less than or equal to
223 the block size and 8192 bytes or larger. It must also be
224 storable in the xz header as either 2^n or as 2^n+2^(n+1). Exam‐
225 ple dict-sizes are 75%, 50%, 37.5%, 25%, or 32K, 16K, 8K etc.
226
227 zstd:
228 -Xcompression-level COMPRESSION-LEVEL
229 COMPRESSION-LEVEL should be 1 .. 22 (default 15).
230
231 lzma:
232 (no options) (deprecated - no kernel support)
233
235 SOURCE_DATE_EPOCH
236 If set, this is used as the filesystem creation timestamp. Also
237 any file timestamps which are after SOURCE_DATE_EPOCH will be
238 clamped to SOURCE_DATE_EPOCH. See https://repro‐
239 ducible-builds.org/docs/source-date-epoch/ for more information.
240
242 sqfstar IMAGE.SQFS < archive.tar
243 Create a Squashfs filesystem from the uncompressed tar file "ar‐
244 chive.tar". Sqfstar will use the default compressor (normally
245 gzip), and block size of 128 Kbytes.
246
247 zcat archive.tgz | sqfstar IMAGE.SQFS
248 Create a Squashfs filesystem from the compressed tar file "ar‐
249 chive.tgz". Sqfstar will use the default compressor (normally
250 gzip), and block size of 128 Kbytes.
251
252 sqfstar -b 1M -comp zstd IMAGE.SQFS < archive.tar
253 Use a block size of 1 Mbyte and Zstandard compression to create
254 the filesystem.
255
256 sqfstar -root-uid 0 -root-gid 0 IMAGE.SQFS < archive.tar
257 Tar files do not supply a definition for the root directory, and
258 the default is to make the directory owned/group owned by the
259 user running Sqfstar. The above command sets the owner‐
260 ship/group ownership to root.
261
262 sqfstar -root-mode 0755 IMAGE.SQFS < archive.tar
263 The default permissions for the root directory is 0777 (rwxr‐
264 wxrwx). The above command sets the permissions to 0755 (rwxr-
265 xr-x).
266
267 sqfstar IMAGE.SQFS file1 file2 < archive.tar
268 Exclude file1 and file2 from the tar file when creating filesys‐
269 tem.
270
271 sqfstar IMAGE.SQFS "*.gz" < archive.tar
272 Exclude any files in the top level directory which matches the
273 wildcard pattern "*.gz".
274
275 sqfstar IMAGE.SQFS "... *.gz" < archive.tar
276 Exclude any file which matches the wildcard pattern "*.gz" any‐
277 where within the tar file. The initial "..." indicates the
278 wildcard pattern is "non-anchored" and will match anywhere.
279
280 Note: when passing wildcarded names to Sqfstar, they should be quoted
281 (as in the above examples), to ensure that they are not processed by
282 the shell.
283
285 Written by Phillip Lougher <phillip@squashfs.org.uk>
286
288 Copyright © 2022 Phillip Lougher <phillip@squashfs.org.uk>
289
290 This program is free software; you can redistribute it and/or modify it
291 under the terms of the GNU General Public License as published by the
292 Free Software Foundation; either version 2, or (at your option) any
293 later version.
294
295 This program is distributed in the hope that it will be useful, but
296 WITHOUT ANY WARRANTY; without even the implied warranty of MER‐
297 CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
298 Public License for more details.
299
301 mksquashfs(1), unsquashfs(1), sqfscat(1)
302
303 The README for the Squash-tools 4.5.1 release, describing the new fea‐
304 tures can be read here
305 https://github.com/plougher/squashfs-tools/blob/master/README-4.5.1
306
307 The Squashfs-tools USAGE guide can be read here
308 https://github.com/plougher/squashfs-tools/blob/master/USAGE
309
310
311
312sqfstar version 4.5.1 March 2022 SQFSTAR(1)