]> wimlib.net Git - wimlib/blob - doc/imagex-capture.1.in
Print each file or directory excluded
[wimlib] / doc / imagex-capture.1.in
1 .TH IMAGEX "1" "March 2013" "@IMAGEX_PROGNAME@ @VERSION@" "User Commands"
2 .SH NAME
3 @IMAGEX_PROGNAME@-capture, @IMAGEX_PROGNAME@-append \- Create or append a WIM image
4
5 .SH SYNOPSIS
6 \fB@IMAGEX_PROGNAME@ capture\fR \fISOURCE\fR \fIWIMFILE\fR [\fIIMAGE_NAME\fR] \
7 [\fIDESCRIPTION\fR] [\fIOPTION\fR]...
8 .br
9 \fB@IMAGEX_PROGNAME@ append\fR \fISOURCE\fR \fIWIMFILE\fR [\fIIMAGE_NAME\fR] \
10 [\fIDESCRIPTION\fR] [\fIOPTION\fR]...
11
12 .SH DESCRIPTION
13 .PP
14
15 The \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR commands create a Windows
16 Imaging (WIM) image from a directory tree.  The \fB@IMAGEX_PROGNAME@ capture\fR command
17 creates a new WIM file containing the captured image, while the \fB@IMAGEX_PROGNAME@
18 append\fR command appends the captured image to an existing WIM file.
19
20 Note: this man page primarily documents the UNIX behavior.  See \fBWINDOWS
21 VERSION\fR for information specific to the Windows build of wimlib.
22
23 A WIM image is an independent directory tree in the WIM file.  A WIM file may
24 contain any number of separate images.  However, files are stored only one time
25 in the entire WIM, regardless of how many images the file appears in.
26
27 \fISOURCE\fR specifies the location of the files to create the new WIM image
28 from.  If \fISOURCE\fR is a directory, the WIM image is captured from that
29 directory.  Alternatively, if \fISOURCE\fR is a regular file or block device, it
30 is interpreted as a NTFS volume from which a WIM image is to be captured.  Still
31 alternatively, if the \fB--source-list\fR option is given, \fISOURCE\fR is
32 interpreted as a file that itself provides a list of files and directories to
33 include in the new WIM image.
34
35 \fIIMAGE_NAME\fR and \fIDESCRIPTION\fR specify the name and description of the
36 new image.  If \fIIMAGE_NAME\fR is not given, it is taken to be the same as the
37 base name of \fISOURCE\fR.  If \fIDESCRIPTION\fR is not given, no description is
38 given to the new image.
39
40 .SH NORMAL MODE
41
42 The normal image capture mode is entered when \fISOURCE\fR specifies a
43 directory.  The WIM image will be captured from the directory tree rooted at
44 this directory.  The directory may be on any type of filesystem.
45
46 In this mode, the following information is captured from the directory tree:
47
48 .IP \[bu] 4
49 The "normal" name and contents of each file and directory
50 .IP \[bu]
51 File and directory creation, access, and modification timestamps to the nearest
52 100 nanoseconds, if supported by the underlying filesystem
53 .IP \[bu]
54 Hard links and symbolic links
55
56 .PP
57
58 However, in this mode, the following information is \fInot\fR captured from the
59 directory tree:
60
61 .IP \[bu] 4
62 File permissions.  The resulting WIM image will not contain any security
63 descriptors because the format of the security descriptors is Windows-specific,
64 and they cannot contain UNIX file modes.  (Exception: see the \fB--unix-data\fR
65 option.)
66
67 .IP \[bu]
68 No alternate data streams will be captured, since these do not exist on
69 POSIX-compliant filesystems.  The resulting WIM image will not contain any
70 alternate data streams.  (Exception: see the \fB--unix-data\fR option.)
71
72 .SH NTFS MODE
73
74 A special image capture mode is entered when \fISOURCE\fR is a regular file or
75 block device.  \fISOURCE\fR is interpreted as an NTFS volume and opened using
76 libntfs-3g.  If successful, a WIM image is captured containing the contents of
77 the NTFS volume, including NTFS-specific data.
78
79 Please note that the NTFS image capture mode is \fInot\fR entered if
80 \fISOURCE\fR is a directory, even if a NTFS filesystem is mounted on
81 \fISOURCE\fR.  You must specify the NTFS volume itself (and it must be
82 unmounted, and you must have permission to read from it).
83
84 More specifically, in this mode, the following types of information are captured
85 from the NTFS volume:
86
87 .IP \[bu] 4
88 All data streams of all files, including the un-named data stream as well as all
89 named data streams.
90 .IP \[bu]
91 Reparse points, including symbolic links, junction points, and other reparse
92 points.
93 .IP \[bu]
94 File and directory creation, access, and modification timestamps from NTFS
95 inodes (these have a resolution of 100 nanoseconds).
96 .IP \[bu]
97 The security descriptor for each NTFS inode.
98 .IP \[bu]
99 File attribute flags.
100 .IP \[bu]
101 All names of all files, including names in the Win32 namespace, DOS namespace,
102 Win32+DOS namespace, and POSIX namespace.  This includes hard links.
103
104 .SH SOURCE LIST MODE
105
106 Yet another capture mode is entered when the \fB--source-list\fR option is
107 given.  It is essentially an extension of the \fBNORMAL MODE\fR that allows
108 multiple files or directories to be incorporated into a WIM image using a single
109 \fB@IMAGEX_PROGNAME@ capture\fR or \fB@IMAGEX_PROGNAME@ append\fR command.  See the documentation for
110 \fB--source-list\fR below.
111
112 .SH WINDOWS VERSION
113
114 This section documents the differences between \fB@IMAGEX_PROGNAME@ capture\fR and
115 \fB@IMAGEX_PROGNAME@ append\fR in the Windows builds of wimlib versus the rest of this man
116 page, which is written to document UNIX build.
117
118 \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR do not have separate "normal" and
119 "NTFS" modes on Windows.  There is simply one mode, and it uses the Windows API
120 to capture NTFS-specific information, including alternate data streams, reparse
121 points, hard links, and file attributes.  So, you essentially get the advantages
122 of the "NTFS mode" documented above, but you can capture a WIM image from any
123 directory, not just an entire NTFS volume.  This is essentially the same
124 behavior as Microsoft's ImageX.
125
126 The \fB--source-list\fR option is supported on Windows, but the
127 \fB--dereference\fR option is not.
128
129 Except for the differences documented in this section, the Windows build of
130 \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR should be essentially equivalent to
131 the UNIX build.  However, one additional thing to note is that wimlib's Windows
132 ImageX is NOT written to be command-line compatible with Microsoft's ImageX,
133 although they are very similar.
134
135 .SH OPTIONS
136 .TP 6
137 \fB--boot\fR
138 Specifies that the new image is to be made the bootable image of the WIM archive.
139 .TP
140 \fB--check\fR
141 Include an integrity table in the new WIM file or the modified WIM file.  If
142 this option is not specified, no integrity table is included in \fIWIMFILE\fR,
143 even if there was one before in the case of \fB@IMAGEX_PROGNAME@ append\fR.
144 .TP
145 \fB--compress\fR=\fITYPE\fR
146 Specifies the compression type for the new WIM file.  This flag is only valid
147 for \fB@IMAGEX_PROGNAME@ capture\fR, since the compression mode for \fB@IMAGEX_PROGNAME@ append\fR
148 must be the same as that of the existing WIM.  \fITYPE\fR may be "none",
149 "maximum", or "fast".  By default, it is "fast".
150
151 You may also specify the actual names of the compression algorithms, "XPRESS"
152 and "LZX", instead of "fast" and "maximum", respectively.
153 .TP
154 \fB--threads\fR=\fINUM_THREADS\fR
155 Number of threads to use for compressing data.  Default: autodetect (number of
156 processors).  Note: if creating or appending to an uncompressed WIM, additional
157 threads will not be used, regardless of this parameter, since no compression
158 needs to be done in this case.
159 .TP
160 \fB--rebuild\fR
161 For \fB@IMAGEX_PROGNAME@ append\fR: rebuild the entire WIM rather than appending the new
162 data to the end of it.  Rebuilding the WIM is slower, but will save a little bit
163 of space that would otherwise be left as a hole in the WIM.  Also see \fB@IMAGEX_PROGNAME@
164 optimize\fR.
165 .TP
166 \fB--flags\fR=\fIEDITIONID\fR
167 Specify a string to use in the <FLAGS> element of the XML data for the new
168 image.
169 .TP
170 \fB--verbose\fR
171 Print the names of files and directories as they are captured, as well as a few
172 other informational messages.
173 .TP
174 \fB--dereference\fR
175 Follow symlinks; archive and dump the files they point to.  (The default is to
176 archive the symlinks themselves.)  This flag is only valid in the normal image
177 capture mode.
178 .TP
179 \fB--config\fR=\fIFILE\fR
180 Specifies a configuration file for capturing the new image.  The configuration
181 file specifies files that are to be treated specially during the image capture.
182
183 The format of the configuration file is a number of sections containing file
184 globs one per line, where each section begins with the tag [ExclusionList],
185 [ExclusionException], [CompressionExclusionList], or [AlignmentList].
186 Currently, only the [ExclusionList] and [ExclusionException] sections are
187 implemented.  The [ExclusionList] section specifies a list of file globs to
188 exclude from capture, while the [ExclusionException] section specifies a list of
189 file globs to include in the capture even if the matched file or directory name
190 also appears in the [ExclusionList].
191
192 Relative globs with only one path component match against a filename in any
193 directory.  Relative globs with multiple path components, as well as absolute
194 globs, are treated as paths starting at the root directory of capture, or the
195 root of the NTFS volume for NTFS capture mode.  If a directory is matched by a
196 glob in the [ExclusionList], the entire directory tree rooted at that directory
197 is excluded from the capture, unless \fB--dereference\fR is specified and there
198 is another path into that directory through a symbolic link.
199
200 For compatibility with Windows, the path separators in the globs may be either
201 forward slashes or backslashes, and the line separators may be either UNIX-style
202 or DOS-style.  However, globs with spaces in them currently must not be quoted.
203 Empty lines are ignored.
204
205 On UNIX, drive letters are stripped from all patterns.  On Windows, drive
206 letters are allowed, but must specify absolute paths and are treated as such.
207
208 If this option is not specified the following default configuration file is
209 used:
210
211 .RS
212 .RS
213 .PP
214 .nf
215 [ExclusionList]
216 \\$ntfs.log
217 \\hiberfil.sys
218 \\pagefile.sys
219 \\System Volume Information
220 \\RECYCLER
221 \\Windows\\CSC
222 .RE
223 .RE
224
225 .TP
226 \fB--unix-data\fR
227 Store the UNIX owner, group, and mode of regular files, symbolic links, and
228 directories.  This is done by adding a special alternate data stream to each
229 directory entry that contains this information.  Please note that this flag is
230 for convenience only, in case you want to use \fB@IMAGEX_PROGNAME@\fR to archive files on
231 UNIX.  Microsoft's software will not understand this special
232 information.
233 .TP
234 \fB--no-acls\fR
235 In the NTFS capture mode, do not capture security descriptors.  This flag is
236 also available in the native Win32 build of wimlib.
237 .TP
238 \fB--strict-acls\fR
239 In the Win32 native build of wimlib, fail immediately if the full security
240 descriptor of any file or directory cannot be read.  The default behavior
241 without this option is to first try omitting the SACL from the security
242 descriptor, then to try omitting the security descriptor entirely.  The purpose
243 of this is to capture as much data as possible without always requiring
244 Administrator privileges.  However, if you desire that all security descriptors
245 be captured exactly, you may with to provide this option, although the
246 Administrator should have permission to read everything anyway.
247 .TP
248 \fB--source-list\fR
249 \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR, as of wimlib 1.3.0, support a new
250 option to create a WIM image from multiple files or directories.  When
251 \fB--source-list\fR is specified, the \fISOURCE\fR argument specifies the name
252 of a text file, each line of which is either 1 or 2 whitespace separated
253 filenames.  The first filename, the source, specifies the path to a file or
254 directory to capture into the WIM image.  It may be either absolute or relative
255 to the current working directory.  The second filename, if provided, is the
256 target and specifies the path  in the WIM image that this file or directory will
257 be saved as.  Leading and trailing slashes are ignored.  "/" indicates that
258 the directory is to become the root of the WIM image.  If not specified, the
259 target string defaults to the same as the source string.
260
261 An example is as follows:
262
263 .RS
264 .RS
265 .PP
266 .nf
267 # Make the WIM image from the 'winpe' directory
268 winpe   /
269
270 # Send the 'overlay' directory to '/overlay' in the WIM image
271 overlay /overlay
272
273 # Overlay a separate directory directly on the root of the WIM image.
274 # This is only legal if there are no conflicting files.
275 /data/stuff     /
276 .RE
277
278 Subdirectories in the WIM are created as needed.  Multiple source directories
279 may share the same target, which implies an overlay; however, an error is issued
280 if the same file appears in different overlays to the same directory.
281
282 Filenames containing whitespace may be quoted with either single quotes or
283 double quotes.  Quotes may not be escaped.
284
285 Lines consisting only of whitespace and lines beginning with '#' preceded by
286 optional whitespace are ignored.
287
288 As a special case, if \fISOURCE\fR is "-", the source list is read from standard
289 input rather than an external file.
290
291 The NTFS capture mode cannot be used with \fB--source-list\fR, as only capturing
292 a full NTFS volume is supported.
293
294 .SH NOTES
295
296 \fBimage append\fR does not support appending an image to a split WIM.
297
298 The different capture modes only specify the data that is captured and don't
299 specify a special WIM format.  A WIM file can contain images captured using
300 different modes.  However, all images in a WIM must have the same compression
301 type, and \fB@IMAGEX_PROGNAME@\fR always enforces this.
302
303 \fB@IMAGEX_PROGNAME@\fR writes WIMs having the version number 0x10d00 and a compressed
304 stream chunk size of 32768.  The only WIMs I've seen that are different from
305 this are some pre-Vista WIMs that had a different version number.
306
307 Unless \fB--rebuild\fR is specified, aborting an \fB@IMAGEX_PROGNAME@ append\fR command
308 mid-way through has a small chance of corrupting the WIM file.  However, a
309 precaution is taken against this, so it should be very unlikely.  In the event
310 of an aborted \fB@IMAGEX_PROGNAME@ append\fR, \fB@IMAGEX_PROGNAME@ optimize\fR may be run to remove
311 extra data that may have been partially appended to the physical WIM file but
312 not yet incorporated into the structure of the WIM.
313
314 Capturing or appending an image happens in two main phases: (1) scanning the
315 directory or NTFS volume to checksum all the files and determine the streams to
316 be written, and (2) writing the new streams to the WIM file.  Streams are not
317 stored in memory after (1), since there could easily be gigabytes of data;
318 instead, they are read again during step (2); however, duplicate streams in the
319 image, and streams already existing in any other image in the WIM, are not read
320 again.  In the future, it may be possible to introduce the ability to capture an
321 image with reading each file only one time, although this mode would have some
322 limitations--- for example, a stream might be compressed only to be thrown away
323 as a duplicate once it's been checksummed.
324
325 \fISOURCE\fR may be a symbolic link to a directory rather than a directory
326 itself.  However, additional symbolic links in subdirectories, or in additional
327 source directories not destined for the WIM image root (with
328 \fB--source-list\fR), are not dereferenced unless \fB--dereference\fR is
329 specified.
330
331 .SH EXAMPLES
332 Create a new WIM 'mywim.wim' from the directory 'somedir', using LZX compression and
333 including an integrity table:
334 .RS
335 .PP
336 @IMAGEX_PROGNAME@ capture somedir mywim.wim --compress=maximum --check
337 .RE
338 .PP
339 Append an image to the WIM we just captured, but do it from a NTFS volume on the
340 partition /dev/sda2 and name the image "Windows 7".  You do not need to specify
341 the compression type, because the WIM already is using LZX compression and this
342 cannot be changed.  You need to specify \fB--check\fR if you don't want the
343 integrity table to be discarded.
344 .RS
345 .PP
346 @IMAGEX_PROGNAME@ append /dev/sda2 mywim.wim --check "Windows 7"
347 .RE
348 .PP
349
350 .SH SEE ALSO
351 .BR @IMAGEX_PROGNAME@ (1)
352