]> wimlib.net Git - wimlib/blob - doc/man1/imagex-capture.1.in
Update docs for chunk size and compression formats
[wimlib] / doc / man1 / imagex-capture.1.in
1 .TH WIMLIB-IMAGEX "1" "March 2014" "@IMAGEX_PROGNAME@ @VERSION@" "User Commands"
2 .SH NAME
3 @IMAGEX_PROGNAME@-capture, @IMAGEX_PROGNAME@-append \- Create or append a WIM image
4 .SH SYNOPSIS
5 \fB@IMAGEX_PROGNAME@ capture\fR \fISOURCE\fR \fIWIMFILE\fR [\fIIMAGE_NAME\fR \
6 [\fIIMAGE_DESCRIPTION\fR]] [\fIOPTION\fR...]
7 .br
8 \fB@IMAGEX_PROGNAME@ append\fR \fISOURCE\fR \fIWIMFILE\fR [\fIIMAGE_NAME\fR \
9 [\fIIMAGE_DESCRIPTION\fR]] [\fIOPTION\fR...]
10 .SH DESCRIPTION
11 The \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR commands
12 create a Windows Imaging (WIM) image from a directory tree.  The
13 \fB@IMAGEX_PROGNAME@ capture\fR command creates a new WIM file containing the
14 captured image, while the \fB@IMAGEX_PROGNAME@ append\fR command appends the
15 captured image to an existing WIM file.
16 These commands are also available as simply \fBwimcapture\fR and \fBwimappend\fR
17 if the appropriate hard links or batch files are installed.
18 .PP
19 Background information: A WIM image is an independent directory tree in a WIM
20 file.  A WIM file may contain any number of separate images.  WIM files are
21 single-instancing with regards to file data, so a file is stored only one time
22 in the entire WIM, regardless of how many images the file appears in.
23 .PP
24 \fISOURCE\fR specifies the location of the files to create the new WIM image
25 from.  If \fISOURCE\fR is a directory, the WIM image is captured from that
26 directory (see \fBDIRECTORY CAPTURE (UNIX)\fR or \fBDIRECTORY CAPTURE
27 (WINDOWS)\fR).   Alternatively, if the \fB--source-list\fR option is specified,
28 \fISOURCE\fR is interpreted as a file that itself provides a list of
29 files and directories to include in the new WIM image.  Still
30 alternatively, only on UNIX-like systems, if \fISOURCE\fR is a
31 regular file or block device, it is interpreted as an NTFS volume from
32 which a WIM image is to be captured using libntfs-3g (see \fBNTFS VOLUME CAPTURE
33 (UNIX)\fR).
34 .PP
35 \fIIMAGE_NAME\fR and \fIIMAGE_DESCRIPTION\fR specify the name and description to
36 give the new WIM image.  If \fIIMAGE_NAME\fR is not specified, it defaults to
37 the base name (excluding path to parent directory) of \fISOURCE\fR, but if this
38 name already exists in \fIWIMFILE\fR, a unique suffix is added.  Otherwise,
39 \fIIMAGE_NAME\fR must be either a name that does not already exist as an image in
40 \fIWIMFILE\fR, or the empty string to create an image with no name.  If
41 \fIIMAGE_DESCRIPTION\fR is not specified, no description is given to the new
42 image.
43 .PP
44 As a special case, if \fIWIMFILE\fR is "-", the \fB--pipable\fR option is
45 assumed and the WIM file is written to standard output in a special pipable
46 format.   See the documentation for \fB--pipable\fR for more details.
47 .SH DIRECTORY CAPTURE (UNIX)
48 This section documents how \fB@IMAGEX_PROGNAME@\fR captures files from a
49 directory tree on UNIX-like systems.  See \fBDIRECTORY CAPTURE (WINDOWS)\fR for
50 the corresponding documentation for Windows.
51 .PP
52 On UNIX-like systems, when \fISOURCE\fR specifies a directory or a symbolic link
53 to a directory, the WIM image will be captured from the directory tree rooted at
54 this directory.  This directory can be on any type of filesystem, and mount
55 points are followed recursively.  However, it is important to keep in mind that
56 the WIM format was designed for Windows, so it cannot store all possible
57 metadata from filesystems used on UNIX-like systems.  The main information that
58 will \fInot\fR be stored is:
59 .IP \[bu] 4
60 UNIX file owners, groups, and modes.  (Exception: see the \fB--unix-data\fR
61 option.)  As a result, file permissions will not be stored, and files that are
62 neither regular files, directories, nor symbolic links, such as device files and
63 FIFOs, cannot be captured and will be excluded by default.
64 .IP \[bu]
65 Extended attributes.  This mainly includes extensions to the traditional UNIX
66 security model, such as SELinux security labels, POSIX ACLs, and capabilities
67 labels.
68 .IP \[bu]
69 Linux file attributes, as can be changed using the \fBchattr\fR (1) utility.
70 .PP
71 Notes: Timestamps are stored with 100 nanosecond granularity and include last
72 modification time (mtime) and last access time (atime), but not last status
73 change time (ctime).  Hard links and symbolic links are supported by the WIM
74 format and \fIare\fR stored.  Symbolic links are turned into "native" Windows
75 symbolic links, or "reparse points"; this process is fully reversible, e.g.
76 automatically by \fB@IMAGEX_PROGNAME@ apply\fR, unless the symbolic link target
77 contains backslash characters.
78 .PP
79 Pedantic note: A limitation of the WIM format prevents the unusual case where a
80 single symbolic link file itself has multiple names (hard links); in this
81 unlikely case, each symbolic link is stored as an independent file.
82 .SH NTFS VOLUME CAPTURE (UNIX)
83 This section documents how \fB@IMAGEX_PROGNAME@\fR captures files directly from
84 an NTFS volume image on UNIX-like systems.
85 .PP
86 On UNIX-like systems, a special image capture mode is entered when \fISOURCE\fR
87 is a regular file or block device.  In this mode, \fISOURCE\fR is assumed to be
88 an NTFS volume or volume image, and \fB@IMAGEX_PROGNAME@\fR will capture a WIM
89 image containing the full contents of the NTFS volume, including NTFS-specific
90 data.  This is done using libntfs-3g.
91 .PP
92 Please note that the NTFS volume capture mode is \fInot\fR entered if
93 \fISOURCE\fR is a directory, even if an NTFS filesystem is mounted on
94 \fISOURCE\fR using ntfs-3g.  You must specify the NTFS volume itself (and it
95 must be unmounted, and you must have permission to read from it).
96 .PP
97 The NTFS volume capture mode attempts to capture as much data and metadata as
98 possible, including:
99 .IP \[bu] 4
100 All data streams of all unencrypted files, including the unnamed data stream as
101 well as all named data streams.
102 .IP \[bu]
103 Reparse points, including symbolic links, junction points, and other reparse
104 points.
105 .IP \[bu]
106 File and directory creation, access, and modification timestamps, using the
107 native NTFS resolution of 100 nanoseconds.
108 .IP \[bu]
109 Windows security descriptors, including all components (owner, group, DACL, and
110 SACL).
111 .IP \[bu]
112 DOS/Windows file attribute flags.
113 .IP \[bu]
114 All names of all files, including names in the Win32 namespace, DOS namespace,
115 Win32+DOS namespace, and POSIX namespace.  This includes hard links.
116 .PP
117 However, the main limitations of this NTFS volume capture mode are:
118 .IP \[bu] 4
119 Encrypted files are excluded by default.  Although ntfs-3g can read their data,
120 they need to be stored in the WIM file in a special format that wimlib does not
121 yet support (except on Windows, where wimlib can treat the data as opaque and
122 hand it off to the appropriate API function).
123 .IP \[bu]
124 The sparse attribute on sparse files will be saved, but the data stored will be
125 the full data of the file rather than the "sparse" data.  (The data is, however,
126 subject to the WIM format's compression.)
127 .SH DIRECTORY CAPTURE (WINDOWS)
128 On Windows, \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR
129 natively support Windows-specific and NTFS-specific data.  They therefore act
130 similarly to the corresponding commands of Microsoft's ImageX.  For best
131 results, the directory being captured should be on an NTFS volume and
132 \fB@IMAGEX_PROGNAME@\fR should be run with Administrator privileges; however,
133 non-NTFS filesystems and running without Administrator privileges are also
134 supported.
135 .PP
136 On Windows, \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR
137 try to archive as much data and metadata as possible, including:
138 .IP \[bu] 4
139 All data streams of all files.
140 .IP \[bu]
141 Reparse points, including symbolic links, junction points, and other reparse
142 points, if supported by the source filesystem.  (Note: see \fB--rpfix\fR and
143 \fB--norpfix\fR for documentation on exactly how absolute symbolic links and
144 junctions are captured.)
145 .IP \[bu]
146 File and directory creation, access, and modification timestamps.  These are
147 stored with Windows NT's native timestamp resolution of 100 nanoseconds.
148 .IP \[bu]
149 Security descriptors, if supported by the source filesystem and \fB--no-acls\fR
150 is not specified.  However, beware that unless \fB--strict-acls\fR is specified,
151 the security descriptors for individual files or directories may be omitted or
152 only partially captured if the user does not have permission to read them, which
153 can be a problem if \fB@IMAGEX_PROGNAME@\fR is run as a non-Administrator.
154 .IP \[bu]
155 File attributes, including hidden, sparse, compressed, encrypted, etc.
156 Encrypted files will be stored in encrypted form rather than in plain text.
157 Transparently compressed files will be read as uncompressed and stored subject
158 to the WIM's own compression.  There is no special handling for storing sparse
159 files, but they are likely to compress to a small size.
160 .IP \[bu]
161 DOS names (8.3) names of files; however, the failure to read them is not
162 considered an error condition.
163 .IP \[bu]
164 Hard links, if supported by the source filesystem.
165 .PP
166 Note: the capture process is reversible, since when \fB@IMAGEX_PROGNAME@
167 apply\fR (on Windows) extracts the captured WIM image, it will extract all of
168 the above information, at least to the extent supported by the destination
169 filesystem.  One exception is that since encrypted files are stored as
170 encrypted, their data will not be available if restored on a Windows system
171 that does not have the decryption key.
172 .PP
173 Pedantic note: since Windows is not fully compatible with its own filesystem
174 (NTFS), on Windows wimlib cannot archive certain files that may exist on a valid
175 NTFS filesystem but are inaccessible to the Windows API, for example two files
176 with names differing only in case in the same directory, or a file whose name
177 contains certain characters considered invalid by Windows.  If you run into
178 problems archiving such files consider using the \fBNTFS VOLUME CAPTURE
179 (UNIX)\fR mode from Linux.
180 .SH OPTIONS
181 .TP 6
182 \fB--boot\fR
183 Specifies that the new image is to be made the bootable image of the WIM archive.
184 .TP
185 \fB--check\fR
186 For \fB@IMAGEX_PROGNAME@ append\fR, before performing the append operation,
187 check the integrity of \fIWIMFILE\fR if an integrity table is present.
188 Furthermore, include an integrity table in the new WIM file
189 (\fB@IMAGEX_PROGNAME@ capture\fR) or the modified WIM file (\fB@IMAGEX_PROGNAME@
190 append\fR).  If this option is not specified, no integrity table is included in
191 a WIM file created with \fB@IMAGEX_PROGNAME@ capture\fR, while a WIM file
192 updated with \fB@IMAGEX_PROGNAME@ append\fR will be written with an integrity
193 table if and only if one was present before.
194 .TP
195 \fB--compress\fR=\fITYPE\fR
196 Specifies the compression type for the new WIM file.  This flag is only valid
197 for \fB@IMAGEX_PROGNAME@ capture\fR, since the compression mode for
198 \fB@IMAGEX_PROGNAME@ append\fR must be the same as that of the existing
199 WIM (and is automatically set as such).  \fITYPE\fR may be "none",
200 "fast", or "maximum".  As of wimlib v1.5.3, the default is LZX compression, but
201 in a special mode that is somewhere in between "fast" and "maximum" in terms of
202 speed and compression ratio.  Use \fB--compress\fR=\fImaximum\fR to explicitly
203 request a better compression ratio at the cost of more time spent compressing.
204 .IP ""
205 You may also specify the actual names of the compression algorithms, "XPRESS"
206 and "LZX", instead of "fast" and "maximum", respectively.
207 .IP ""
208 As of wimlib v1.6.0, a third compression type, "recovery" or "LZMS", is also
209 available.  Its use is generally not recommended because other than wimlib
210 itself, as of Windows 8 it is only compatible with WIMGAPI and Windows Setup
211 (not even ImageX or Dism).  However, LZMS is the compression algorithm used in
212 packed resources created if the \fB--pack-streams\fR option is specified.
213 .TP
214 \fB--compress-slow\fR
215 Spend even more time compressing the data to achieve a very slightly better
216 compression ratio.  This currently only has an effect for LZX ("maximum", the
217 default) and LZMS ("recovery") compression.
218 .TP
219 \fB--chunk-size\fR=\fISIZE\fR
220 Set the WIM compression chunk size to \fISIZE\fR bytes.  Larger chunks mean larger
221 LZ77 dictionaries and better compression ratios on sufficiently large files, but
222 slower random access.  \fBUsing this option is generally not recommended because
223 of the compatibility limitations detailed in the next paragraph.\fR  But if you
224 decide to use this option regardless, you may choose a chunk size that is
225 allowed by the compression format.  All formats only allow power-of-2 chunk
226 sizes.  For LZX ("maximum") compression the maximum allowed chunk size is 2^21
227 (2097152), for XPRESS ("fast") compression the maximum allowed chunk size is
228 2^26 (67108864), and for LZMS ("recovery") compression the maximum allowed chunk
229 size is 2^30 (1073741824).
230 .IP ""
231 Beware that Microsoft's implementation has limited support for non-default chunk
232 sizes.  Depending on the version, their software may refuse to open the WIM, or
233 open it and crash, or open it and report the data is invalid, or even extract
234 the data incorrectly.  In addition, wimlib versions before 1.6.0 do not support
235 alternate chunk sizes.
236 .TP
237 \fB--pack-streams\fR, \fB--solid\fR
238 Create a "solid" archive that compresses multiple unique streams ("files")
239 together, rather than each unique stream ("file") independently.  This can
240 result in a significantly better compression ratio, but this format greatly
241 decreases the performance of random access to the data, as may occur on a WIM
242 mounted with \fB@IMAGEX_PROGNAME@ mount\fR.  Also, WIMs created using this
243 option use a different version number in their header and as of Windows 8 are
244 only compatible with Windows Setup and WIMGAPI, not even ImageX and Dism.
245 .IP ""
246 The default compression type and chunk size in packed resources is LZMS with
247 2^25 (33554432) byte chunks.  This is independent of the WIM's main compression
248 type and chunk size.
249 .TP
250 \fB--pack-chunk-size\fR=\fISIZE\fR, \fB--solid-chunk-size\fR=\fISIZE\fR
251 Like \fB--chunk-size\fR, but set the chunk size used in packed resources.  The
252 default is LZMS compression with 2^25 (33554432) byte chunks.  This option only
253 has an effect when \fB--pack-streams\fR is also specified.  For maximum
254 compatibility with the Microsoft implementation, do not use either of these
255 options.
256 .TP
257 \fB--pack-compress\fR=\fITYPE\fR, \fB--solid-compress\fR=\fITYPE\fR
258 Like \fB--compress\fR, but set the compression format used in packed resources.
259 The default is LZMS compression with 2^25 (33554432) byte chunks.  This option
260 only has an effect when \fB--pack-streams\fR is also specified.  For maximum
261 compatibility with the Microsoft implementation, do not use either of these
262 options.
263 .TP
264 \fB--threads\fR=\fINUM_THREADS\fR
265 Number of threads to use for compressing data.  Default: autodetect (number of
266 available CPUs).
267 .TP
268 \fB--rebuild\fR
269 For \fB@IMAGEX_PROGNAME@ append\fR: rebuild the entire WIM rather than appending the new
270 data to the end of it.  Rebuilding the WIM is slower, but will save a little bit
271 of space that would otherwise be left as a hole in the WIM.  Also see \fB@IMAGEX_PROGNAME@
272 optimize\fR(1).
273 .TP
274 \fB--flags\fR=\fIEDITIONID\fR
275 Specify a string to use in the <FLAGS> element of the XML data for the new
276 image.
277 .TP
278 \fB--dereference\fR
279 (UNIX-like systems only) Follow symbolic links and archive the files they point
280 to, rather than archiving the links themselves.
281 .TP
282 \fB--config\fR=\fIFILE\fR
283 Specifies a configuration file (UTF-8 or UTF-16LE encoded) for capturing the new
284 image.  The configuration file specifies files that are to be treated specially
285 during the image capture.
286 .IP ""
287 The format of the configuration file is a number of sections containing path
288 globs one per line, where each section begins with the tag [ExclusionList],
289 [ExclusionException], [CompressionExclusionList], or [AlignmentList].
290 Currently, only the [ExclusionList] and [ExclusionException] sections are
291 implemented.  The [ExclusionList] section specifies a list of path globs to
292 exclude from capture, while the [ExclusionException] section specifies a list of
293 path globs to include in the capture even if the matched file or directory name
294 also appears in the [ExclusionList].
295 .IP ""
296 Relative globs with only one path component (e.g. *.mp3) match against a
297 filename in any directory.  Relative globs with multiple path components (e.g.
298 dir/file), as well as absolute globs (e.g. /dir/file), are treated as paths
299 starting at the root directory of capture, or the root of the NTFS volume for
300 NTFS volume capture mode.  If a directory is matched by a glob in the
301 [ExclusionList], the entire directory tree rooted at that directory is excluded
302 from the capture, unless \fB--dereference\fR is specified and there is another
303 path into that directory through a symbolic link.
304 .IP ""
305 For compatibility with Windows, the path separators in the globs may be either
306 forward slashes or backslashes, and the line separators may be either UNIX-style
307 or DOS-style.  Trailing and leading whitespace is ignored.  Lines beginning with
308 the '#' or ';' characters are treated as comments and ignored.  Globs with
309 whitespace in them need not be quoted, unless the whitespace is leading or
310 trailing.  Both double and single quotes are accepted.
311 .IP ""
312 Paths may not have drive letters in them, as they are all relative to the root
313 of capture and not absolute external paths.
314 .IP ""
315 If this option is not specified the following default configuration file is
316 used:
317 .IP ""
318 .RS
319 .RS
320 .nf
321 [ExclusionList]
322 \\$ntfs.log
323 \\hiberfil.sys
324 \\pagefile.sys
325 \\System Volume Information
326 \\RECYCLER
327 \\Windows\\CSC
328 .RE
329 .RE
330 .fi
331 .TP
332 \fB--unix-data\fR
333 (UNIX-like systems only) Store the UNIX owner, group, and mode of all captured
334 files.  This is done by adding a special alternate data stream to each directory
335 entry that contains this information.  Please note that this flag is for
336 convenience only, in case you want to use \fB@IMAGEX_PROGNAME@\fR to archive
337 files on UNIX.  Microsoft's software will not understand this special
338 information.  You also may run into problems when applying an image with UNIX
339 data from a pipable WIM.
340 .TP
341 \fB--no-acls\fR
342 Do not capture files' security descriptors.
343 .TP
344 \fB--strict-acls\fR
345 Fail immediately if the full security descriptor of any file cannot be read.  On
346 Windows, the default behavior without this option is to first try omitting the
347 SACL from the security descriptor, then to try omitting the security descriptor
348 entirely.  The purpose of this is to capture as much data as possible without
349 always requiring Administrator privileges.  However, if you desire that all
350 security descriptors be captured exactly, you may wish to provide this option,
351 although the Administrator should have permission to read everything anyway.
352 .TP
353 \fB--rpfix\fR, \fB--norpfix\fR
354 Set whether to fix targets of absolute symbolic links (reparse points in Windows
355 terminology) or not.  When enabled (\fB--rpfix\fR), absolute symbolic links that
356 point inside the directory tree being captured will be adjusted to be absolute
357 relative to the root of the directory tree being captured.  In addition,
358 absolute symbolic links that point outside the directory tree being captured
359 will be ignored and not be captured at all.  When disabled (\fB--norpfix\fR),
360 absolute symbolic links will be captured exactly as is.
361 .IP ""
362 The default behavior for \fB@IMAGEX_PROGNAME@ capture\fR is equivalent to
363 \fB--rpfix\fR.  The default behavior for \fB@IMAGEX_PROGNAME@ append\fR will be
364 \fB--rpfix\fR if reparse point fixups have previously been done on
365 \fIWIMFILE\fR, otherwise \fB--norpfix\fR.
366 .IP ""
367 In the case of a multi-source capture, (\fB--source-list\fR specified), passing
368 \fB--norpfix\fR is recommended.  Otherwise, reparse point fixups will be
369 disabled on all capture sources destined for non-root locations in the WIM
370 image, while capture sources destined for the WIM root will get the default
371 behavior from the previous paragraph.
372 .TP
373 \fB--source-list\fR
374 \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR support
375 creating a WIM image from multiple separate files or directories.  When
376 \fB--source-list\fR is specified, the \fISOURCE\fR argument specifies the name
377 of a text file, each line of which is either 1 or 2 whitespace separated file
378 paths.  The first file path, the source, specifies the path to a file or
379 directory to capture into the WIM image.  It may be either absolute or relative
380 to the current working directory.  The second file path, if provided, is the
381 target and specifies the path  in the WIM image that this file or directory will
382 be saved as.  Leading and trailing slashes in the target are ignored, except if
383 it consists entirely of slashes (e.g. "/"), which indicates that the directory
384 is to become the root of the WIM image.  If omitted, the target string defaults
385 to the same as the source string.
386 .IP ""
387 An example source list file is as follows:
388 .IP ""
389 .RS
390 .RS
391 .nf
392 # Make the WIM image from the 'winpe' directory
393 winpe   /
394
395 # Send the 'overlay' directory to '/overlay' in the WIM image
396 overlay /overlay
397
398 # Overlay a separate directory directly on the root of the WIM image.
399 # This is only legal if there are no conflicting files.
400 /data/stuff     /
401 .RE
402 .RE
403 .fi
404 .IP ""
405 Subdirectories in the WIM are created as needed.  Multiple source directories
406 may share the same target, which implies an overlay; however, an error is issued
407 if the same file appears in different overlays to the same directory.
408 .IP ""
409 File paths containing whitespace may be quoted with either single quotes or
410 double quotes.  Quotes may not be escaped.
411 .IP ""
412 Lines consisting only of whitespace and lines beginning with '#' preceded by
413 optional whitespace are ignored.
414 .IP ""
415 As a special case, if \fISOURCE\fR is "-", the source list is read from standard
416 input rather than an external file.
417 .IP ""
418 The NTFS volume capture mode on UNIX-like systems cannot be used with
419 \fB--source-list\fR, as only capturing a full NTFS volume is supported.
420 .TP
421 \fB--pipable\fR
422 Create a "pipable" WIM, which can be applied fully sequentially, including from
423 a pipe.  An image in the resulting WIM can be applied with \fB@IMAGEX_PROGNAME@
424 apply\fR, either normally by specifying the WIM file name, or with
425 \fB@IMAGEX_PROGNAME@ apply -\fR to read the WIM from standard input.  See
426 \fB@IMAGEX_PROGNAME@ apply\fR(1) for more details.
427 .IP ""
428 For append operations, this option will result in a full rebuild of the WIM to
429 make it pipable.  For capture operations, the captured WIM is simply created as
430 pipable.  Beware that the more images you add to a pipable WIM, the less
431 efficient piping it will be, since more unneeded data will be sent through the
432 pipe.
433 .IP ""
434 When wimlib creates a pipable WIM, it carefully re-arranges the components of
435 the WIM so that they can be read sequentially and also makes several other
436 modifications.  As a result, these "pipable" WIMs are \fInot compatible with
437 Microsoft's software\fR, so keep this in mind if you're going to use them.  If
438 desired, you can use \fB@IMAGEX_PROGNAME@ optimize --not-pipable\fR to re-write
439 a pipable WIM as a regular WIM.  (\fB@IMAGEX_PROGNAME@ export\fR also provides
440 the capability to export images from a pipable WIM into a non-pipable WIM, or
441 vice versa.)
442 .IP ""
443 For the most part, wimlib operates on pipable WIMs transparently.  You can
444 modify them, add or delete images, export images, and even create split pipable
445 WIMs.  The main disadvantages are that appending is (currently) less efficient
446 (\fB--rebuild\fR is always implied), and also they aren't compatible with
447 Microsoft's software.
448 .IP ""
449 \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR can both
450 write a pipable WIM directly to standard output; this is done automatically if
451 \fIWIMFILE\fR is specified as "-".  (In that case, \fB--pipable\fR is assumed.)
452 .TP
453 \fB--not-pipable\fR
454 Ensure the resulting WIM is in the normal, non-pipable WIM format.  This is the
455 default for \fB@IMAGEX_PROGNAME@ capture\fR, except when writing to standard
456 output (\fIWIMFILE\fR specified as "-"), and also for \fB@IMAGEX_PROGNAME@
457 append\fR, except when appending to a WIM that is already pipable.
458 .TP
459 \fB--update-of\fR=[\fIWIMFILE\fR:]\fIIMAGE\fR
460 Declares that the image being captured or appended from \fISOURCE\fR is mostly the same as
461 the existing image \fIIMAGE\fR in \fIWIMFILE\fR, but captured at a later point
462 in time, possibly with some modifications in the intervening time.  This is
463 designed to be used in incremental backups of the same filesystem or directory
464 tree.  \fIIMAGE\fR can be a 1-based index or name of an existing image in
465 \fIWIMFILE\fR.  It can also be a negative integer to index backwards into the
466 images (e.g.  -1 means the last existing image in \fIWIMFILE\fR).
467 .IP ""
468 When this option is provided, the capture or append of the new image will be
469 optimized by not reading files that, based on metadata such as timestamps,
470 appear not to have been modified since they were archived in the existing
471 \fIIMAGE\fR.  Barring manipulation of timestamps, this option only affects
472 performance and does not change the resulting WIM image.
473 .IP ""
474 As shown, the full syntax for the argument to this option is to specify the WIM
475 file, a colon, and the image; for example, "--update-of mywim.wim:1".  However,
476 the WIM file and colon may be omitted, in which case the WIM file will default
477 to the WIM file being appended to for append operations, or the WIM file from
478 which a delta is being taken (only if \fB--delta-from\fR is specified exactly
479 once) for capture operations.
480 .TP
481 \fB--delta-from\fR=\fIWIMFILE\fR
482 For \fB@IMAGEX_PROGNAME@ capture\fR only: capture the new WIM as a "delta" from
483 \fIWIMFILE\fR.  Any streams that would ordinarily need to be archived in the new
484 WIM are omitted if they are already present in the \fIWIMFILE\fR on which the
485 delta is being based.  The new WIM will still contain a full copy of the image
486 metadata, but this is typically only a small fraction of a WIM's total size.
487 .IP ""
488 This option can be specified multiple times, in which case the resulting delta
489 WIM will only contain streams not present in any of the specified base
490 .IP ""
491 To operate on the resulting delta WIM using other commands such as
492 \fB@IMAGEX_PROGNAME@ apply\fR, you must specify the delta WIM as the WIM file to
493 operate on, but also reference the base WIM(s) using the \fB--ref\fR option.
494 Beware: to retain the proper functioning of the delta WIM, you can only add, not
495 delete, files and images to the base WIM(s) following the capture of a delta
496 from it.
497 .IP ""
498 \fB--delta-from\fR may be combined with \fB--update-of\fR to increase the
499 speed of capturing a delta WIM.
500 .IP ""
501 As an example, consider the following backup and restore sequence:
502 .IP ""
503 .RS
504 .nf
505 (initial backup)
506
507 $ wimcapture /some/directory bkup-base.wim
508
509 (some days later, create second backup as delta from first)
510
511 $ wimcapture /some/directory bkup-2013-08-20.dwm \\
512         --update-of bkup-base.wim:-1 --delta-from bkup-base.wim
513
514 (restoring the second backup)
515
516 $ wimapply bkup-2013-08-20.dwm --ref=bkup-base.wim 1 \\
517         /some/directory
518 .RE
519 .fi
520 .IP ""
521 However, note that as an alternative to the above sequence that used a delta
522 WIM, the second backup could have simply been appended to the WIM as new image
523 using \fB@IMAGEX_PROGNAME@ append\fR.  Delta WIMs should be used only if it's
524 desired to base the backups or images on a separate, large file that is rarely
525 modified.
526 .IP ""
527 Note: unlike "pipable" WIMs (created with the \fB--pipable\fR option), "delta"
528 WIMs (created with the \fB--delta-from\fR option) are compatible with
529 Microsoft's software.  You can use the /ref option of imagex.exe to reference
530 the base WIM(s), similar to above.
531 .IP ""
532 Additional note:  \fB@IMAGEX_PROGNAME@\fR is generalized enough that you can in
533 fact combine \fB--pipable\fR and \fB--delta-from\fR to create pipable delta
534 WIMs.  In such cases, the base WIM(s) must be captured as pipable as well as the
535 delta WIM, and when applying an image, the base WIM(s) must be sent over the
536 pipe after the delta WIM.
537 .TP
538 \fB--wimboot\fR
539 Windows only: mark the image as WIMBoot-compatible.  See Microsoft's
540 documentation for more information about WIMBoot.  This option will, by default,
541 change the compression type to XPRESS and the chunk size to 4096 bytes; these
542 can, however, still be overridden through the \fB--compress\fR and
543 \fB--chunk-size\fR parameters, respectively.  In addition, this option will, by
544 default, set the configuration file to
545 \fISOURCE\fR\\Windows\\System32\\WimBootCompress.ini if present and accessible;
546 however, this may still be overridden through the \fB--config\fR parameter.
547 .SH NOTES
548 \fB@IMAGEX_PROGNAME@ append\fR does not support appending an image to a split WIM.
549 .PP
550 It is safe to abort an \fB@IMAGEX_PROGNAME@ append\fR command partway through;
551 however, after doing this, it is recommended to run \fB@IMAGEX_PROGNAME@
552 optimize\fR to remove any data that was appended to the physical WIM file but
553 not yet incorporated into the structure of the WIM, unless the WIM was being
554 fully rebuilt (e.g. with \fB--rebuild\fR), in which case you should delete the
555 temporary file left over.
556 .PP
557 \fB@IMAGEX_PROGNAME@\fR creates WIMs compatible with Microsoft's software
558 (imagex.exe, Dism.exe, wimgapi.dll), with some caveats:
559 .IP \[bu] 4
560 With \fB@IMAGEX_PROGNAME@\fR on UNIX-like systems, it is possible to create a
561 WIM image containing files with names differing only in case, or files with
562 names containing the characters ':', '*', '?', '"', '<', '>', '|', or '\\',
563 which are valid on POSIX-compliant filesystems but not Windows.  Be warned that
564 such files will not be extracted by default by the Windows version of
565 \fB@IMAGEX_PROGNAME@\fR, and (even worse) Microsoft's ImageX can be confused by
566 such names and quit extracting the image partway through.  (It perhaps is worth
567 pointing out that Windows' own default filesystem, NTFS, supports these
568 characters, although Windows does not!)
569 .IP \[bu]
570 WIMs captured with \fB--unix-data\fR should be assumed to be incompatible with
571 Microsoft's software.
572 .IP \[bu]
573 Pipable WIMs are incompatible with Microsoft's software.  Pipable WIMs are
574 created only if \fIWIMFILE\fR was specified as "-" (standard output) or if
575 the \fB--pipable\fR flag was specified.
576 .IP \[bu]
577 WIMs captured with a non-default chunk size (with the \fB--chunk-size\fR option)
578 or as solid archives (with the \fB--pack-streams\fR option) or with LZMS
579 compression (with \fB--compress\fR=LZMS or \fB--compress\fR=recovery) have
580 varying levels of compatibility with Microsoft's software.  The best
581 compatibility is achieved with WIMGAPI itself (not ImageX or Dism) on Windows 8
582 or later.
583 .SH EXAMPLES
584 First example:  Create a new WIM 'mywim.wim' with "maximum" (LZX) compression
585 that will contain a captured image of the directory tree 'somedir'.  Note that
586 the image name need not be specified and will default to 'somedir':
587 .RS
588 .PP
589 @IMAGEX_PROGNAME@ capture somedir mywim.wim --compress=maximum
590 .RE
591 .PP
592 or, if the \fBwimcapture\fR hard link or batch file has been installed, the
593 abbreviated form can be used:
594 .RS
595 .PP
596 wimcapture somedir mywim.wim --compress=maximum
597 .RE
598 .PP
599 The remaining examples will use the long form, however.  Next, append the image
600 of a different directory tree to the WIM created above:
601 .RS
602 .PP
603 @IMAGEX_PROGNAME@ append anotherdir mywim.wim
604 .RE
605 .PP
606 Easy enough, and the above examples of imaging directory trees work on both
607 UNIX-like systems and Windows.  Next, capture a WIM with several non-default
608 options, including "fast" (XPRESS) compression, an integrity table, no messing
609 with absolute symbolic links, and an image name and description:
610 .RS
611 .PP
612 @IMAGEX_PROGNAME@ capture somedir mywim.wim --compress=fast \\
613 .RS
614 --check --norpfix "Some Name" "Some Description"
615 .RE
616 .RE
617 .PP
618 Capture an entire NTFS volume into a new WIM file and name the image "Windows
619 7".  On UNIX-like systems, this requires using the special mode described in
620 \fBNTFS VOLUME CAPTURE (UNIX)\fR where \fISOURCE\fR is a file or block device
621 containing an NTFS filesystem:
622 .RS
623 .PP
624 @IMAGEX_PROGNAME@ capture /dev/sda2 windows7.wim "Windows 7"
625 .RE
626 .PP
627 or, on Windows, to capture a full NTFS volume you instead need to specify the
628 root directory of the mounted volume, for example:
629 .RS
630 .PP
631 @IMAGEX_PROGNAME@ capture E:\\ windows7.wim "Windows 7"
632 .RE
633 .PP
634 Same as above example with capturing an NTFS volume from \fB@IMAGEX_PROGNAME@\fR
635 running on a UNIX-like system, but capture the WIM in the wimlib-specific
636 "pipable" format that can be piped to \fB@IMAGEX_PROGNAME@ apply\fR:
637 .RS
638 .PP
639 @IMAGEX_PROGNAME@ capture /dev/sda2 windows7.wim "Windows 7" \\
640 .br
641 .RS
642 --pipable
643 .RE
644 .RE
645 .PP
646 Same as above, but instead of writing the pipable WIM to the file
647 "windows7.wim", write it directly to standard output through a pipe into some
648 other program "someprog", which could, for example, be a program or script that
649 streams the data to a server.  Note that \fB--pipable\fR need not be explicitly
650 specified when using standard output as the WIM "file":
651 .RS
652 .PP
653 @IMAGEX_PROGNAME@ capture /dev/sda2 - "Windows 7" | someprog
654 .RE
655 .SH SEE ALSO
656 .BR @IMAGEX_PROGNAME@ (1),
657 .BR @IMAGEX_PROGNAME@-apply (1)