]> wimlib.net Git - wimlib/blob - doc/man1/wimlib-imagex-capture.1
767991ababf93a05230957039a7df63a8f05893f
[wimlib] / doc / man1 / wimlib-imagex-capture.1
1 .TH WIMLIB-IMAGEX "1" "January 2015" "wimlib 1.7.4" "User Commands"
2 .SH NAME
3 wimlib-imagex-capture, wimlib-imagex-append \- Create or append a WIM image
4 .SH SYNOPSIS
5 \fBwimlib-imagex capture\fR \fISOURCE\fR \fIWIMFILE\fR [\fIIMAGE_NAME\fR \
6 [\fIIMAGE_DESCRIPTION\fR]] [\fIOPTION\fR...]
7 .br
8 \fBwimlib-imagex append\fR \fISOURCE\fR \fIWIMFILE\fR [\fIIMAGE_NAME\fR \
9 [\fIIMAGE_DESCRIPTION\fR]] [\fIOPTION\fR...]
10 .SH DESCRIPTION
11 The \fBwimlib-imagex capture\fR and \fBwimlib-imagex append\fR commands
12 create a Windows Imaging (WIM) image from a directory tree.  The
13 \fBwimlib-imagex capture\fR command creates a new WIM file containing the
14 captured image, while the \fBwimlib-imagex 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 \fBwimlib-imagex\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, modes, and device IDs (major and minor numbers),
61 unless the \fB--unix-data\fR option is specified.  By default (without
62 \fB--unix-data\fR), files that are neither regular files, directories, nor
63 symbolic links, such as device nodes and FIFOs, will be excluded.
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 \fBwimlib-imagex 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 \fBwimlib-imagex\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 \fBwimlib-imagex\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, \fBwimlib-imagex capture\fR and \fBwimlib-imagex append\fR
129 natively support Windows-specific and NTFS-specific data.  They therefore act
130 similarly to the corresponding commands of Microsoft's ImageX or DISM.  For best
131 results, the directory being captured should be on an NTFS volume and
132 \fBwimlib-imagex\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, \fBwimlib-imagex capture\fR and \fBwimlib-imagex 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 \fBwimlib-imagex\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 \fBwimlib-imagex
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 \fBwimlib-imagex 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 (\fBwimlib-imagex capture\fR) or the modified WIM file (\fBwimlib-imagex
190 append\fR).  If this option is not specified, no integrity table is included in
191 a WIM file created with \fBwimlib-imagex capture\fR, while a WIM file
192 updated with \fBwimlib-imagex 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[:\fILEVEL\fR]
196 Specifies the compression format for the new WIM file.  \fITYPE\fR may be
197 "none", "XPRESS" (alias: "fast"), "LZX" (alias: "maximum"), or "LZMS" (alias:
198 "recovery").  \fITYPE\fR is matched case-insensitively.  The default is "LZX".
199 .IP ""
200 You can optionally also specify an integer compression \fILEVEL\fR.  The
201 compression level specifies how hard the compression algorithm for the specified
202 compression \fITYPE\fR will work to compress the data.  The values are scaled so
203 that 20 is quick compression, 50 is medium compression, and 100 is high
204 compression.  However, you can choose any value, and not just these particular
205 values.  The default is 50.
206 .IP ""
207 Be careful if you choose LZMS compression.  It is not compatible with wimlib
208 before v1.6.0, WIMGAPI before Windows 8, DISM before Windows 8.1, and 7-Zip.
209 .IP ""
210 Also note that choosing LZMS compression does not automatically imply solid-mode
211 compression, as it does with DISM.  Use \fB--solid\fR if you want to create a
212 solid WIM, or "ESD file".
213 .TP
214 \fB--chunk-size\fR=\fISIZE\fR
215 Set the compression chunk size to \fISIZE\fR bytes.  A larger compression chunk
216 size results in a better compression ratio.  wimlib supports different chunk
217 sizes depending on the compression type:
218 .RS
219 .IP \[bu] 2
220 XPRESS: 4K, 8K, 16K, 32K, 64K
221 .IP \[bu]
222 LZX: 32K, 64K, 128K, 256K, 512K, 1M, 2M
223 .IP \[bu]
224 LZMS: 32K, 64K, 128K, 256K, 512K, 1M, 2M, 4M, 8M, 16M, 32M, 64M, 128M, 256M, 512M, 1G
225 .RE
226 .IP ""
227 You can provide the full number (e.g. 32768), or you can use one of the K, M, or
228 G suffixes.  KiB, MiB, and GiB are also accepted.
229 .IP ""
230 This option only affects the chunk size used for non-solid WIM resources.  If
231 you are creating a solid WIM (using the \fB--solid\fR option), then you probably
232 want \fB--solid-chunk-size\fR instead.
233 .IP ""
234 Use this option with caution if compatibility with Microsoft's implementation is
235 desired, since their implementation has limited support for non-default chunk
236 sizes.
237 .TP
238 \fB--solid\fR
239 Create a "solid" WIM file that compresses files together rather than
240 independently.  This results in a significantly better compression ratio, but it
241 comes at the cost of various tradeoffs, including: slow compression with very
242 high memory usage; slow random access to the resulting WIM file; and reduced
243 compatibility.
244 .IP ""
245 Compatibility-wise, the first version of Microsoft's WIMGAPI to support solid
246 WIM files was released with Windows 8, and the first version of DISM to do so
247 was released with Windows 8.1.
248 .IP ""
249 If you want to create an "ESD file", then use this option.  An (unencrypted)
250 "ESD file" is a solid WIM file.
251 .IP ""
252 By default, this option has an effect equivalent to DISM's option
253 \fB/compress:recovery\fR.  The options for wimlib-imagex are different because
254 they try not to conflate the compression type (e.g. LZX or LZMS) with solid-mode
255 compression, as these are two different things.
256 .TP
257 \fB--solid-chunk-size\fR=\fISIZE\fR
258 Like \fB--chunk-size\fR, but set the chunk size used in solid resources.  The
259 default, assuming LZMS compression, is 64MiB (67108864); this requires about
260 640MiB of memory per thread.  This option only has an effect when \fB--solid\fR
261 is also specified.  Note: Microsoft's implementation is not compatible with LZMS
262 chunk sizes larger than 64MiB.
263 .TP
264 \fB--solid-compress\fR=\fITYPE\fR[:\fILEVEL\fR]
265 Like \fB--compress\fR, but set the compression type used in solid resources.
266 The default is LZMS compression.  This option only has an effect when
267 \fB--solid\fR is also specified.
268 .TP
269 \fB--threads\fR=\fINUM_THREADS\fR
270 Number of threads to use for compressing data.  Default: autodetect (number of
271 available CPUs).
272 .TP
273 \fB--rebuild\fR
274 For \fBwimlib-imagex append\fR: rebuild the entire WIM rather than appending the new
275 data to the end of it.  Rebuilding the WIM is slower, but will save a little bit
276 of space that would otherwise be left as a hole in the WIM.  Also see \fBwimlib-imagex
277 optimize\fR(1).
278 .TP
279 \fB--flags\fR=\fIEDITIONID\fR
280 Specify a string to use in the <FLAGS> element of the XML data for the new
281 image.
282 .TP
283 \fB--dereference\fR
284 (UNIX-like systems only) Follow symbolic links and archive the files they point
285 to, rather than archiving the links themselves.
286 .TP
287 \fB--config\fR=\fIFILE\fR
288 Specifies a configuration file (UTF-8 or UTF-16LE encoded; plain ASCII also
289 works) for capturing the new image.  The configuration file specifies files that
290 are to be treated specially during the image capture.
291 .IP ""
292 The format of the configuration file is INI-style; that is, it is arranged in
293 bracketed sections.  Currently, only the following sections are recognized:
294 .RS
295 .IP \[bu] 4
296 [ExclusionList] ---  contains a list of path globs to exclude from capture.  If
297 a directory is matched, both the directory and its contents are excluded.
298 .IP \[bu]
299 [ExclusionException] --- contains a list of path globs to include in the
300 capture, even when the file or directory also matches a glob in [ExclusionList].
301 .IP \[bu]
302 [PrepopulateList] --- this does not affect capture, but if the image is applied
303 later with \fB--wimboot\fR, these are globs of files that shall be extracted
304 normally, not as WIMBoot "pointer files".  If a directory is matched, all files
305 and subdirectories are also matched recursively.
306 .RE
307 .IP ""
308 Any unrecognized sections will be ignored, with a warning printed.  Sections
309 dealing with compression (e.g. [CompressionExclusion]) are not particularly
310 important.
311 .IP ""
312 Path globs may contain the '*' and '?' meta-characters.  Relative globs (e.g.
313 *.mp3) match against a filename in any directory.  Absolute globs (e.g.
314 /dir/file), are treated as paths starting at the main directory being captured,
315 or the root of the NTFS volume for NTFS volume capture mode.  Do not use drive
316 letters in the paths; they will be ignored.  Path separators may be either
317 forwards slashes or backwards slashes.
318 .IP ""
319 Lines beginning with the '#' or ';' characters are treated as comments and
320 ignored.  Globs with whitespace in them need not be quoted; however, if they
321 are, both double and single quotes are accepted.
322 .IP ""
323 If this option is not specified the following default configuration file is
324 used:
325 .IP ""
326 .RS
327 .RS
328 .nf
329 [ExclusionList]
330 \\$ntfs.log
331 \\hiberfil.sys
332 \\pagefile.sys
333 \\swapfile.sys
334 \\System Volume Information
335 \\RECYCLER
336 \\Windows\\CSC
337 .RE
338 .RE
339 .fi
340 .IP ""
341 However, special behavior applies if \fB--wimboot\fR is also specified.  By
342 default, with \fB--wimboot\fR specified, the file
343 Windows/System32/WimBootCompress.ini in the directory being captured will be
344 used as the configuration file.  However, this can be overridden using
345 \fB--config\fR; and this also causes the specified configuration file to be
346 saved in the WIM image as Windows/System32/WimBootCompress.ini, overriding any
347 that may be present on the filesystem.
348 .TP
349 \fB--unix-data\fR
350 (UNIX-like systems only) Store the UNIX owner, group, mode, and device ID (major
351 and minor number) of each captured file.  As of wimlib v1.7.0, you can backup
352 and restore not only the standard UNIX file permission information, but also
353 character device nodes, block device nodes, named pipes (FIFOs), and UNIX domain
354 sockets.
355 .IP
356 wimlib stores UNIX data by adding a special tagged metadata item to each
357 directory entry of each file that contains this information.  This extra
358 information is ignored by the Microsoft implementation.  Note: UNIX data stored
359 by wimlib before v1.7.0 used a different format that is no longer supported.  If
360 you have old WIM files with UNIX data, apply them with v1.6.2 and recapture them
361 with v1.7.0 or later.
362 .TP
363 \fB--no-acls\fR
364 Do not capture files' security descriptors.
365 .TP
366 \fB--strict-acls\fR
367 Fail immediately if the full security descriptor of any file cannot be read.  On
368 Windows, the default behavior without this option is to first try omitting the
369 SACL from the security descriptor, then to try omitting the security descriptor
370 entirely.  The purpose of this is to capture as much data as possible without
371 always requiring Administrator privileges.  However, if you desire that all
372 security descriptors be captured exactly, you may wish to provide this option,
373 although the Administrator should have permission to read everything anyway.
374 .TP
375 \fB--rpfix\fR, \fB--norpfix\fR
376 Set whether to fix targets of absolute symbolic links (reparse points in Windows
377 terminology) or not.  When enabled (\fB--rpfix\fR), absolute symbolic links that
378 point inside the directory tree being captured will be adjusted to be absolute
379 relative to the root of the directory tree being captured.  When disabled
380 (\fB--norpfix\fR), absolute symbolic links will be captured exactly as is.
381 .IP ""
382 The default behavior for \fBwimlib-imagex capture\fR is equivalent to
383 \fB--rpfix\fR.  The default behavior for \fBwimlib-imagex append\fR will be
384 \fB--rpfix\fR if reparse point fixups have previously been done on
385 \fIWIMFILE\fR, otherwise \fB--norpfix\fR.
386 .IP ""
387 In the case of a multi-source capture, (\fB--source-list\fR specified), passing
388 \fB--norpfix\fR is recommended.  Otherwise, reparse point fixups will be
389 disabled on all capture sources destined for non-root locations in the WIM
390 image, while capture sources destined for the WIM root will get the default
391 behavior from the previous paragraph.
392 .TP
393 \fB--source-list\fR
394 \fBwimlib-imagex capture\fR and \fBwimlib-imagex append\fR support
395 creating a WIM image from multiple separate files or directories.  When
396 \fB--source-list\fR is specified, the \fISOURCE\fR argument specifies the name
397 of a text file, each line of which is either 1 or 2 whitespace separated file
398 paths.  The first file path, the source, specifies the path to a file or
399 directory to capture into the WIM image.  It may be either absolute or relative
400 to the current working directory.  The second file path, if provided, is the
401 target and specifies the path  in the WIM image that this file or directory will
402 be saved as.  Leading and trailing slashes in the target are ignored, except if
403 it consists entirely of slashes (e.g. "/"), which indicates that the directory
404 is to become the root of the WIM image.  If omitted, the target string defaults
405 to the same as the source string.
406 .IP ""
407 An example source list file is as follows:
408 .IP ""
409 .RS
410 .RS
411 .nf
412 # Make the WIM image from the 'winpe' directory
413 winpe   /
414
415 # Send the 'overlay' directory to '/overlay' in the WIM image
416 overlay /overlay
417
418 # Overlay a separate directory directly on the root of the WIM image.
419 /data/stuff     /
420 .RE
421 .RE
422 .fi
423 .IP ""
424 Subdirectories in the WIM are created as needed.  Multiple source directories
425 may share the same target, which implies an overlay.  In the event that this
426 results a nondirectory file being added to the WIM image multiple times, the
427 last version (as listed in the source list file) overrides any earlier version.
428 .IP ""
429 File paths containing whitespace may be quoted with either single quotes or
430 double quotes.  Quotes may not be escaped.
431 .IP ""
432 Lines consisting only of whitespace and lines beginning with '#' preceded by
433 optional whitespace are ignored.
434 .IP ""
435 As a special case, if \fISOURCE\fR is "-", the source list is read from standard
436 input rather than an external file.
437 .IP ""
438 The NTFS volume capture mode on UNIX-like systems cannot be used with
439 \fB--source-list\fR, as only capturing a full NTFS volume is supported.
440 .TP
441 \fB--pipable\fR
442 Create a "pipable" WIM, which can be applied fully sequentially, including from
443 a pipe.  An image in the resulting WIM can be applied with \fBwimlib-imagex
444 apply\fR, either normally by specifying the WIM file name, or with
445 \fBwimlib-imagex apply -\fR to read the WIM from standard input.  See
446 \fBwimlib-imagex apply\fR(1) for more details.
447 .IP ""
448 For append operations, this option will result in a full rebuild of the WIM to
449 make it pipable.  For capture operations, the captured WIM is simply created as
450 pipable.  Beware that the more images you add to a pipable WIM, the less
451 efficient piping it will be, since more unneeded data will be sent through the
452 pipe.
453 .IP ""
454 When wimlib creates a pipable WIM, it carefully re-arranges the components of
455 the WIM so that they can be read sequentially and also makes several other
456 modifications.  As a result, these "pipable" WIMs are \fInot compatible with
457 Microsoft's software\fR, so keep this in mind if you're going to use them.  If
458 desired, you can use \fBwimlib-imagex optimize --not-pipable\fR to re-write
459 a pipable WIM as a regular WIM.  (\fBwimlib-imagex export\fR also provides
460 the capability to export images from a pipable WIM into a non-pipable WIM, or
461 vice versa.)
462 .IP ""
463 For the most part, wimlib operates on pipable WIMs transparently.  You can
464 modify them, add or delete images, export images, and even create split pipable
465 WIMs.  The main disadvantages are that appending is (currently) less efficient
466 (\fB--rebuild\fR is always implied), and also they aren't compatible with
467 Microsoft's software.
468 .IP ""
469 \fBwimlib-imagex capture\fR and \fBwimlib-imagex append\fR can both
470 write a pipable WIM directly to standard output; this is done automatically if
471 \fIWIMFILE\fR is specified as "-".  (In that case, \fB--pipable\fR is assumed.)
472 .TP
473 \fB--not-pipable\fR
474 Ensure the resulting WIM is in the normal, non-pipable WIM format.  This is the
475 default for \fBwimlib-imagex capture\fR, except when writing to standard
476 output (\fIWIMFILE\fR specified as "-"), and also for \fBwimlib-imagex
477 append\fR, except when appending to a WIM that is already pipable.
478 .TP
479 \fB--update-of\fR=[\fIWIMFILE\fR:]\fIIMAGE\fR
480 Declares that the image being captured or appended from \fISOURCE\fR is mostly the same as
481 the existing image \fIIMAGE\fR in \fIWIMFILE\fR, but captured at a later point
482 in time, possibly with some modifications in the intervening time.  This is
483 designed to be used in incremental backups of the same filesystem or directory
484 tree.  \fIIMAGE\fR can be a 1-based index or name of an existing image in
485 \fIWIMFILE\fR.  It can also be a negative integer to index backwards into the
486 images (e.g.  -1 means the last existing image in \fIWIMFILE\fR).
487 .IP ""
488 When this option is provided, the capture or append of the new image will be
489 optimized by not reading files that, based on metadata such as timestamps,
490 appear not to have been modified since they were archived in the existing
491 \fIIMAGE\fR.  Barring manipulation of timestamps, this option only affects
492 performance and does not change the resulting WIM image.
493 .IP ""
494 As shown, the full syntax for the argument to this option is to specify the WIM
495 file, a colon, and the image; for example, "--update-of mywim.wim:1".  However,
496 the WIM file and colon may be omitted, in which case the WIM file will default
497 to the WIM file being appended to for append operations, or the WIM file from
498 which a delta is being taken (only if \fB--delta-from\fR is specified exactly
499 once) for capture operations.
500 .TP
501 \fB--delta-from\fR=\fIWIMFILE\fR
502 For \fBwimlib-imagex capture\fR only: capture the new WIM as a "delta" from
503 \fIWIMFILE\fR.  Any streams that would ordinarily need to be archived in the new
504 WIM are omitted if they are already present in the \fIWIMFILE\fR on which the
505 delta is being based.  The new WIM will still contain a full copy of the image
506 metadata, but this is typically only a small fraction of a WIM's total size.
507 .IP ""
508 This option can be specified multiple times, in which case the resulting delta
509 WIM will only contain streams not present in any of the specified base WIMs.
510 .IP ""
511 To operate on the resulting delta WIM using other commands such as
512 \fBwimlib-imagex apply\fR, you must specify the delta WIM as the WIM file to
513 operate on, but also reference the base WIM(s) using the \fB--ref\fR option.
514 Beware: to retain the proper functioning of the delta WIM, you can only add, not
515 delete, files and images to the base WIM(s) following the capture of a delta
516 from it.
517 .IP ""
518 \fB--delta-from\fR may be combined with \fB--update-of\fR to increase the
519 speed of capturing a delta WIM.
520 .IP ""
521 As an example, consider the following backup and restore sequence:
522 .IP ""
523 .RS
524 .nf
525 (initial backup)
526
527 $ wimcapture /some/directory bkup-base.wim
528
529 (some days later, create second backup as delta from first)
530
531 $ wimcapture /some/directory bkup-2013-08-20.dwm \\
532         --update-of bkup-base.wim:-1 --delta-from bkup-base.wim
533
534 (restoring the second backup)
535
536 $ wimapply bkup-2013-08-20.dwm --ref=bkup-base.wim 1 \\
537         /some/directory
538 .RE
539 .fi
540 .IP ""
541 However, note that as an alternative to the above sequence that used a delta
542 WIM, the second backup could have simply been appended to the WIM as new image
543 using \fBwimlib-imagex append\fR.  Delta WIMs should be used only if it's
544 desired to base the backups or images on a separate, large file that is rarely
545 modified.
546 .IP ""
547 Note: unlike "pipable" WIMs (created with the \fB--pipable\fR option), "delta"
548 WIMs (created with the \fB--delta-from\fR option) are compatible with
549 Microsoft's software.  For example, you can use the /ref option of ImageX to
550 reference the base WIM(s), similar to above.
551 .IP ""
552 Additional note:  \fBwimlib-imagex\fR is generalized enough that you can in
553 fact combine \fB--pipable\fR and \fB--delta-from\fR to create pipable delta
554 WIMs.  In such cases, the base WIM(s) must be captured as pipable as well as the
555 delta WIM, and when applying an image, the base WIM(s) must be sent over the
556 pipe after the delta WIM.
557 .TP
558 \fB--wimboot\fR
559 Mark the image as WIMBoot-compatible.  See Microsoft's
560 documentation for more information about WIMBoot.  This option will, by default,
561 set the compression type to XPRESS and the chunk size to 4096 bytes; these
562 can, however, still be overridden through the \fB--compress\fR and
563 \fB--chunk-size\fR parameters, respectively.  In addition, this option will, by
564 default, set the configuration file to
565 \fISOURCE\fR\\Windows\\System32\\WimBootCompress.ini if present and accessible;
566 however, this may still be overridden through the \fB--config\fR parameter.
567 .SH NOTES
568 \fBwimlib-imagex append\fR does not support appending an image to a split WIM.
569 .PP
570 It is safe to abort an \fBwimlib-imagex append\fR command partway through;
571 however, after doing this, it is recommended to run \fBwimlib-imagex
572 optimize\fR to remove any data that was appended to the physical WIM file but
573 not yet incorporated into the structure of the WIM, unless the WIM was being
574 fully rebuilt (e.g. with \fB--rebuild\fR), in which case you should delete the
575 temporary file left over.
576 .PP
577 \fBwimlib-imagex\fR creates WIMs compatible with Microsoft's software
578 (WIMGAPI, ImageX, DISM), with some caveats:
579 .IP \[bu] 4
580 With \fBwimlib-imagex\fR on UNIX-like systems, it is possible to create a
581 WIM image containing files with names differing only in case, or files with
582 names containing the characters ':', '*', '?', '"', '<', '>', '|', or '\\',
583 which are valid on POSIX-compliant filesystems but not Windows.  Be warned that
584 such files will not be extracted by default by the Windows version of
585 \fBwimlib-imagex\fR, and (even worse) Microsoft's ImageX can be confused by
586 such names and quit extracting the image partway through.  (It perhaps is worth
587 pointing out that Windows' own default filesystem, NTFS, supports these
588 characters, although Windows does not!)
589 .IP \[bu]
590 Pipable WIMs are incompatible with Microsoft's software.  Pipable WIMs are
591 created only if \fIWIMFILE\fR was specified as "-" (standard output) or if
592 the \fB--pipable\fR flag was specified.
593 .IP \[bu]
594 WIMs captured with a non-default chunk size (with the \fB--chunk-size\fR option)
595 or as solid archives (with the \fB--solid\fR option) or with LZMS
596 compression (with \fB--compress\fR=LZMS or \fB--compress\fR=recovery) have
597 varying levels of compatibility with Microsoft's software.  Generally, more
598 recent versions of Microsoft's software are more compatible.
599 .SH EXAMPLES
600 First example:  Create a new WIM 'mywim.wim' with LZX ("maximum") compression
601 that will contain a captured image of the directory tree 'somedir'.  Note that
602 the image name need not be specified and will default to 'somedir':
603 .RS
604 .PP
605 wimlib-imagex capture somedir mywim.wim
606 .RE
607 .PP
608 or, if the \fBwimcapture\fR hard link or batch file has been installed, the
609 abbreviated form can be used:
610 .RS
611 .PP
612 wimcapture somedir mywim.wim
613 .RE
614 .PP
615 The remaining examples will use the long form, however.  Next, append the image
616 of a different directory tree to the WIM created above:
617 .RS
618 .PP
619 wimlib-imagex append anotherdir mywim.wim
620 .RE
621 .PP
622 Easy enough, and the above examples of imaging directory trees work on both
623 UNIX-like systems and Windows.  Next, capture a WIM with several non-default
624 options, including XPRESS ("fast") compression, an integrity table, no messing
625 with absolute symbolic links, and an image name and description:
626 .RS
627 .PP
628 wimlib-imagex capture somedir mywim.wim --compress=fast \\
629 .RS
630 --check --norpfix "Some Name" "Some Description"
631 .RE
632 .RE
633 .PP
634 Capture an entire NTFS volume into a new WIM file and name the image "Windows
635 7".  On UNIX-like systems, this requires using the special mode described in
636 \fBNTFS VOLUME CAPTURE (UNIX)\fR where \fISOURCE\fR is a file or block device
637 containing an NTFS filesystem:
638 .RS
639 .PP
640 wimlib-imagex capture /dev/sda2 windows7.wim "Windows 7"
641 .RE
642 .PP
643 or, on Windows, to capture a full NTFS volume you instead need to specify the
644 root directory of the mounted volume, for example:
645 .RS
646 .PP
647 wimlib-imagex capture E:\\ windows7.wim "Windows 7"
648 .RE
649 .PP
650 Same as above example with capturing an NTFS volume from \fBwimlib-imagex\fR
651 running on a UNIX-like system, but capture the WIM in the wimlib-specific
652 "pipable" format that can be piped to \fBwimlib-imagex apply\fR:
653 .RS
654 .PP
655 wimlib-imagex capture /dev/sda2 windows7.wim "Windows 7" \\
656 .br
657 .RS
658 --pipable
659 .RE
660 .RE
661 .PP
662 Same as above, but instead of writing the pipable WIM to the file
663 "windows7.wim", write it directly to standard output through a pipe into some
664 other program "someprog", which could, for example, be a program or script that
665 streams the data to a server.  Note that \fB--pipable\fR need not be explicitly
666 specified when using standard output as the WIM "file":
667 .RS
668 .PP
669 wimlib-imagex capture /dev/sda2 - "Windows 7" | someprog
670 .RE
671 .SH SEE ALSO
672 .BR wimlib-imagex (1),
673 .BR wimlib-imagex-apply (1)