1SQFS2TAR(1) User Commands SQFS2TAR(1)
2
3
4
6 sqfs2tar - turn a SquashFS image into a tar archive
7
9 sqfs2tar [OPTIONS...] <sqfsfile>
10
12 Quickly and painlessly turn a SquashFS filesystem image into a tar ar‐
13 chive that can then be examined and processed by any tool that can work
14 on tar archives. The resulting archive is written to stdout.
15
16 Possible options:
17
18 --compressor, -c <name>
19 By default the result is a raw, uncompressed tar ball. Using
20 this option it is possible to select a stream compression format
21 (such as gzip, xz, zstd or bzip2) to use for the output archive.
22
23 Run sqfs2tar --help to get a list of all available compressors.
24
25 --root-becomes, -r <dir>
26 Prefix all paths in the tarball with the given directory name
27 and add an entry for this directory that receives all meta data
28 (permissions, ownership, extended attributes, et cetera) of the
29 root inode.
30
31 The special value . can be used since many tar archivers them‐
32 selves pack the attributes of the root directory that way and
33 naturally support this.
34
35 If this option is not used, all meta data from the root inode IS
36 LOST!
37
38 --subdir, -d <dir>
39 Unpack the given sub directory instead of the filesystem root.
40 Can be specified more than once to select multiple directories.
41 If only one is specified, it becomes the new root of the archive
42 filesystem tree.
43
44 --keep-as-dir, -k
45 If --subdir is used only once, don't make the subdir the archive
46 root, instead keep it as prefix for all unpacked files. Using
47 --subdir more than once implies --keep-as-dir.
48
49 --no-xattr, -X
50 Discard extended attributes from the SquashFS image. The default
51 behavior is to copy all xattrs attached to SquashFS inodes into
52 the resulting tar archive.
53
54 --no-hard-links, -L
55 Normally, sqfs2tar runs hard link detection and generates hard
56 links for entries that refer to the same inode. If this flag is
57 set, hard link detection is not performed and duplicate data
58 records are generated instead.
59
60 --no-skip, -s
61 Abort if a file cannot be stored in a tar archive. For instance,
62 the tar format does not support socket files, but SquashFS does.
63 The default behaviour of sqfs2tar is to emit a warning to stderr
64 and skip the entry. If this flag is set, processing is aborted
65 and sqfs2tar exits with an error status.
66
67 --help, -h
68 Print help text and exit.
69
70 --version, -V
71 Print version information and exit.
72
74 The output format is pre-POSIX ustar using GNU extensions where neces‐
75 sary. Experimentation determined that this is most widely supported by
76 activeley used tar implementations (besides GNU tar), even more than
77 the newer POSIX format with PAX extensions.
78
79 If any file or directory is encountered that cannot be converted, it is
80 skipped and a warning is written to stderr. Unless the --no-skip option
81 is set, which aborts processing if a file cannot be converted.
82
83 This mainly affects socket files which are supported by SquashFS but
84 not by POSIX tar, GNU tar or PAX.
85
86 Since the tar format contains a sequence of files with absolute names,
87 it has no direct concept of a tree or an unnamed root node. Conse‐
88 quently, meta data from the SquashFS root inode is lost, unless the
89 --root-becomes option is used.
90
91 The output archive can optionally be compressed. Default settings are
92 used for the supported compressors and there is currently no intention
93 to expose finer grained control over them. To set custom compressor
94 flags, create an uncompressed archive and pipe it into a dedicated com‐
95 pressor process.
96
97
99 Turn a SquashFS image into a tar archive:
100
101 sqfs2tar rootfs.sqfs > rootfs.tar
102
103 Creating a compressed archive with gzip headers:
104
105 sqfs2tar --compressor gzip rootfs.sqfs > rootfs.tar.gz
106
107 Compressing the output archive, but using custom compressor flags:
108
109 sqfs2tar rootfs.sqfs | xz -9e > rootfs.tar.xz
110
112 rdsquashfs(1), tar2sqfs(1)
113
115 Written by David Oberhollenzer.
116
118 Copyright © 2019 David Oberhollenzer License GPLv3+: GNU GPL version 3
119 or later <https://gnu.org/licenses/gpl.html>.
120 This is free software: you are free to change and redistribute it.
121 There is NO WARRANTY, to the extent permitted by law.
122
123
124
125sqfs2tar June 2019 SQFS2TAR(1)