]> wimlib.net Git - wimlib/blob - doc/man1/wimcapture.1
Make absolute ExclusionException patterns include ancestor directories
[wimlib] / doc / man1 / wimcapture.1
1 .TH WIMCAPTURE "1" "July 2017" "wimlib 1.12.0" "User Commands"
2 .SH NAME
3 wimcapture, wimappend \- Capture or append a WIM image
4 .SH SYNOPSIS
5 \fBwimcapture\fR \fISOURCE\fR \fIWIMFILE\fR [\fIIMAGE_NAME\fR \ [\fIIMAGE_DESC\fR]] [\fIOPTION\fR...]
6 .br
7 \fBwimappend\fR \fISOURCE\fR \fIWIMFILE\fR [\fIIMAGE_NAME\fR \ [\fIIMAGE_DESC\fR]] [\fIOPTION\fR...]
8 .SH DESCRIPTION
9 The \fBwimcapture\fR (equivalently: \fBwimlib-imagex capture\fR) and
10 \fBwimappend\fR (equivalently: \fBwimlib-imagex append\fR) commands create
11 ("capture") a new Windows Imaging (WIM) image.  \fBwimcapture\fR creates a new
12 WIM archive \fIWIMFILE\fR to contain the new image, while \fBwimappend\fR adds
13 the image to the existing WIM archive \fIWIMFILE\fR.
14 .PP
15 \fISOURCE\fR specifies the location of the files from which to create the WIM
16 image.  If \fISOURCE\fR is a directory or a symbolic link pointing to a
17 directory, then the image is captured from that directory as per \fBDIRECTORY
18 CAPTURE (UNIX)\fR or \fBDIRECTORY CAPTURE (WINDOWS)\fR.   Alternatively, if
19 \fB--source-list\fR is specified, then \fISOURCE\fR is interpreted as a file
20 containing a list of files and directories to include in the image.  Still
21 alternatively, if \fISOURCE\fR is a UNIX block device, then an image is captured
22 from the NTFS volume on it as per \fBNTFS VOLUME CAPTURE (UNIX)\fR.
23 .PP
24 \fIIMAGE_NAME\fR and \fIIMAGE_DESC\fR specify the name and description to give
25 the new image.  If \fIIMAGE_NAME\fR is unspecified, it defaults to the filename
26 component of \fISOURCE\fR, appending a unique suffix if needed.  Otherwise,
27 \fIIMAGE_NAME\fR must be either a name not already used by an image in
28 \fIWIMFILE\fR, or the empty string to create an unnamed image.  If
29 \fIIMAGE_DESC\fR is unspecified then the new image is given no description.
30 .PP
31 If \fIWIMFILE\fR is specified as "-", then the \fB--pipable\fR option is assumed
32 and a pipable WIM is written to standard output (this is a wimlib extension).
33 .SH DIRECTORY CAPTURE (UNIX)
34 On UNIX-like systems, if \fISOURCE\fR specifies a directory or a symbolic link
35 to a directory, then the WIM image will be captured from that directory.  The
36 directory can be on any type of filesystem, and mountpoints are followed.  In
37 this mode, the following types of information are captured:
38 .IP \[bu] 4
39 Directories and regular files, and the contents of regular files
40 .IP \[bu]
41 Hard links
42 .IP \[bu]
43 Symbolic links (translated losslessly to Windows reparse points)
44 .IP \[bu]
45 Last modification times (mtime) and last access times (atime) with 100
46 nanosecond granularity
47 .IP \[bu]
48 Files that appear to be sparse will be flagged as such, but their full data will
49 still be stored, subject to the usual compression.
50 .IP \[bu]
51 With \fB--unix-data\fR: standard UNIX file permissions (owner, group, and mode)
52 .IP \[bu]
53 With \fB--unix-data\fR: device nodes, named pipes, and sockets
54 .IP \[bu]
55 With \fB--unix-data\fR: extended attributes (Linux only)
56 .PP
57 There is no support for storing last status change times (ctimes), or hard link
58 information for symlinks (each symlink will be stored as a separate file).
59 Also, filenames and symlink targets which are not valid UTF-8 with the addition
60 of surrogate codepoints are unsupported.  Note that if you have a filesystem
61 containing filenames in another multibyte encoding, such as ISO-8859-1, and you
62 wish to archive it with wimlib, you may be able to mount it with an option which
63 causes its filenames to be presented as UTF-8.
64 .SH NTFS VOLUME CAPTURE (UNIX)
65 On UNIX-like systems, \fISOURCE\fR may also be specified as a block device (e.g.
66 /dev/sda3) containing an unmounted NTFS volume.  In this mode, \fBwimcapture\fR
67 uses libntfs-3g to capture a WIM image from root directory of the NTFS volume.
68 In this mode, as much data and metadata as possible is captured, including
69 NTFS-specific and Windows-specific metadata:
70 .IP \[bu] 4
71 All data streams of all unencrypted files, including the unnamed data stream as
72 well as all named data streams.
73 .IP \[bu]
74 Reparse points.  See \fBREPARSE POINTS AND SYMLINKS\fR for details.
75 .IP \[bu]
76 File and directory creation, access, and modification timestamps, using the
77 native NTFS resolution of 100 nanoseconds.
78 .IP \[bu]
79 Windows security descriptors, including all components (owner, group, DACL, and
80 SACL).
81 .IP \[bu]
82 DOS/Windows file attribute flags.
83 .IP \[bu]
84 All names of all files, including names in the Win32 namespace, DOS namespace,
85 Win32+DOS namespace, and POSIX namespace.  This includes hard links.
86 .IP \[bu]
87 Object IDs.
88 .PP
89 However, the main limitations of this mode are:
90 .IP \[bu] 4
91 Encrypted files are excluded.
92 .IP \[bu]
93 Extended attributes (EAs) are not stored yet.
94 .IP \[bu]
95 Sparse files will be flagged as such, but their full data will still be stored,
96 subject to the usual compression.
97 .IP \[bu]
98 Some types of reparse points are transparently dereferenced by Windows but not
99 by NTFS-3G.  See \fBREPARSE POINTS AND SYMLINKS\fR.
100 .PP
101 Note that this mode uses libntfs-3g directly, without going through the
102 \fBntfs-3g\fR(8) driver.  Hence, there is no special support for capturing a WIM
103 image from a directory on which an NTFS filesystem has been mounted using
104 \fBntfs-3g\fR(8); you have to unmount it first.  There is also no support for
105 capturing a subdirectory of the NTFS volume; you can only capture the full
106 volume.
107 .SH DIRECTORY CAPTURE (WINDOWS)
108 On Windows, \fBwimcapture\fR and \fBwimappend\fR natively support
109 Windows-specific and NTFS-specific data.  They therefore act similarly to the
110 corresponding commands of Microsoft's ImageX or DISM.  For best results, the
111 directory being captured should be on an NTFS volume and the program should be
112 run with Administrator privileges; however, non-NTFS filesystems and running
113 without Administrator privileges are also supported, subject to limitations.
114 .PP
115 On Windows, \fBwimcapture\fR and \fBwimappend\fR try to capture as much data and
116 metadata as possible, including:
117 .IP \[bu] 4
118 All data streams of all files.
119 .IP \[bu]
120 Reparse points, if supported by the source filesystem.  See \fBREPARSE POINTS
121 AND SYMLINKS\fR for details.
122 .IP \[bu]
123 File and directory creation, access, and modification timestamps.  These are
124 stored with Windows' native timestamp resolution of 100 nanoseconds.
125 .IP \[bu]
126 Security descriptors, if supported by the source filesystem and \fB--no-acls\fR
127 is not specified.  Note: when not running as an Administrator, security
128 descriptors may be only partially captured (see \fB--strict-acls\fR).
129 .IP \[bu]
130 File attributes, including hidden, sparse, compressed, encrypted, etc.
131 Encrypted files will be stored in encrypted form rather than in plain text.
132 Transparently compressed files will be read as uncompressed and stored subject
133 to the WIM's own compression.  There is no special handling for storing sparse
134 files, but they are likely to compress to a small size.
135 .IP \[bu]
136 DOS names (8.3) names of files; however, the failure to read them is not
137 considered an error condition.
138 .IP \[bu]
139 Hard links, if supported by the source filesystem.
140 .IP \[bu]
141 Object IDs, if supported by the source filesystem.
142 .IP \[bu]
143 Extended attributes (EAs), if supported by the source filesystem.
144 .SH REPARSE POINTS AND SYMLINKS
145 A "symbolic link" (or "symlink") is a special file which "points to" some other
146 file or directory.  On Windows, a "reparse point" is a generalization of a
147 symlink which allows access to a file or directory to be redirected in a more
148 complex way.  Windows uses reparse points to implement symlinks and sometimes
149 uses them for various other features as well.  Normally, applications can choose
150 whether they want to "dereference" reparse points and symlinks or not.
151 .PP
152 The default behavior of \fBwimcapture\fR is that reparse points and symlinks are
153 \fInot\fR dereferenced, meaning that the reparse points or symlinks themselves
154 are stored in the archive rather than the files or data they point to.  There is
155 a \fB--dereference\fR option, but it is currently only supported by the UNIX
156 version of \fBwimcapture\fR on UNIX filesystems (it's not yet implemented for
157 Windows filesystems).
158 .PP
159 Windows also treats certain types of reparse points specially.  For example,
160 Windows applications reading from deduplicated, WIM-backed, or system-compressed
161 files always see the dereferenced data, even if they ask not to.  Therefore,
162 \fBwimcapture\fR on Windows will store these files dereferenced, not as reparse
163 points.  But \fBwimcapture\fR on UNIX in NTFS-3G mode cannot dereference these
164 files and will store them as reparse points instead.  This difference can be
165 significant in certain situations, e.g. when capturing deduplicated files which,
166 to be readable after extraction, require that the chunk store also be present.
167 .SH OPTIONS
168 .TP 6
169 \fB--boot\fR
170 Mark the new image as the "bootable" image of the WIM.  The "bootable" image is
171 the image which the Windows bootloader will use when loading Windows PE from the
172 WIM.
173 .TP
174 \fB--check\fR
175 Include extra integrity information in the resulting WIM.  With \fBwimappend\fR,
176 also check the integrity of the WIM before appending to it.  Also verify the
177 integrity of any WIMs specified by \fB--update-of\fR and/or \fB--delta-from\fR.
178 .TP
179 \fB--include-integrity\fR
180 Include extra integrity information in the resulting WIM, i.e. like
181 \fB--check\fR but don't do any verification beforehand.
182 .TP
183 \fB--compress\fR=\fITYPE\fR[:\fILEVEL\fR]
184 With \fBwimcapture\fR, use the specified compression format in the new WIM file.
185 \fITYPE\fR may be "none", "XPRESS" (alias: "fast"), "LZX" (alias: "maximum"), or
186 "LZMS" (alias: "recovery").  \fITYPE\fR is matched case-insensitively.  The
187 default is "LZX".
188 .IP ""
189 You can optionally also specify an integer compression \fILEVEL\fR.  The
190 compression level specifies how hard the compression algorithm for the specified
191 compression \fITYPE\fR will work to compress the data.  The values are scaled so
192 that 20 is quick compression, 50 is medium compression, and 100 is high
193 compression.  However, you can choose any value and not just these particular
194 values.  The default is 50.
195 .IP ""
196 This option only affects the compression type used in non-solid WIM resources.
197 If you are creating a solid WIM (using the \fB--solid\fR option), then you
198 probably want \fB--solid-compress\fR instead.
199 .IP ""
200 Be careful if you choose LZMS compression.  It is not compatible with wimlib
201 before v1.6.0, WIMGAPI before Windows 8, DISM before Windows 8.1, and 7-Zip
202 before v15.12.  Also note that choosing LZMS compression does not automatically
203 imply solid-mode compression, as it does with DISM.  Use \fB--solid\fR if you
204 want to create a solid WIM, or "ESD file".
205 .TP
206 \fB--chunk-size\fR=\fISIZE\fR
207 With \fBwimcapture\fR, use a compression chunk size of \fISIZE\fR bytes.  A
208 larger compression chunk size results in a better compression ratio.  wimlib
209 supports different chunk sizes depending on the compression type:
210 .RS
211 .IP \[bu] 2
212 XPRESS: 4K, 8K, 16K, 32K, 64K
213 .IP \[bu]
214 LZX: 32K, 64K, 128K, 256K, 512K, 1M, 2M
215 .IP \[bu]
216 LZMS: 32K, 64K, 128K, 256K, 512K, 1M, 2M, 4M, 8M, 16M, 32M, 64M, 128M, 256M, 512M, 1G
217 .RE
218 .IP ""
219 You can provide the full number (e.g. 32768), or you can use one of the K, M, or
220 G suffixes.  KiB, MiB, and GiB are also accepted.
221 .IP ""
222 This option only affects the chunk size used in non-solid WIM resources.  If you
223 are creating a solid WIM (using the \fB--solid\fR option), then you probably
224 want \fB--solid-chunk-size\fR instead.
225 .IP ""
226 Use this option with caution if compatibility with Microsoft's WIM software is
227 desired, since their software has limited support for non-default chunk sizes.
228 .TP
229 \fB--solid\fR
230 With \fBwimcapture\fR, create a "solid" WIM file that compresses files together
231 rather than independently.  This results in a significantly better compression
232 ratio, but it comes at the cost of slow compression with very high memory usage,
233 reduced compatibility, and slow random access to the resulting WIM file.
234 .IP ""
235 By default this enables solid LZMS compression, thereby creating a file
236 equivalent to one created with DISM's \fB/compress\fR:\fIrecovery\fR option.
237 Such files are also called "ESD files" and were first supported by WIMGAPI in
238 Windows 8, by DISM in Windows 8.1, and by 7-Zip 15.12.
239 .TP
240 \fB--solid-compress\fR=\fITYPE\fR[:\fILEVEL\fR]
241 Like \fB--compress\fR, but set the compression type used in solid resources.
242 The default is LZMS compression.  This option only has an effect when
243 \fB--solid\fR is also specified.
244 .TP
245 \fB--solid-chunk-size\fR=\fISIZE\fR
246 Like \fB--chunk-size\fR, but set the chunk size used in solid resources.  The
247 default, assuming LZMS compression, is 64MiB (67108864); this requires about
248 640MiB of memory per thread.  This option only has an effect when \fB--solid\fR
249 is also specified.  Note: Microsoft's WIM software is not compatible with LZMS
250 chunk sizes larger than 64MiB.
251 .TP
252 \fB--threads\fR=\fINUM_THREADS\fR
253 Number of threads to use for compressing data.  Default: autodetect (number of
254 available CPUs).
255 .TP
256 \fB--rebuild\fR
257 With \fBwimappend\fR, rebuild the entire WIM rather than appending the new data
258 to the end of it.  Rebuilding the WIM is slower, but will save some space that
259 would otherwise be left as a hole in the WIM.  Also see \fBwimoptimize\fR(1).
260 .TP
261 \fB--flags\fR=\fIEDITIONID\fR
262 Specify a string to use in the <FLAGS> element of the XML data for the new
263 image.
264 .TP
265 \fB--image-property\fR \fINAME\fR=\fIVALUE\fR
266 Assign an arbitrary property to the new image in the XML document of the WIM.
267 \fIVALUE\fR is the string to set as the property value.  \fINAME\fR is the name
268 of the image property, for example "NAME", "DESCRIPTION", or "TOTALBYTES".  The
269 name can contain forward slashes to indicate a nested XML element; for example,
270 "WINDOWS/VERSION/BUILD" indicates the BUILD element nested within the VERSION
271 element nested within the WINDOWS element.  A bracketed number can be used to
272 indicate one of several identically-named elements; for example,
273 "WINDOWS/LANGUAGES/LANGUAGE[2]" indicates the second "LANGUAGE" element nested
274 within the "WINDOWS/LANGUAGES" element.  When adding a list of elements in this
275 way, they must be specified in sequential order.  Note that element names are
276 case-sensitive.  This option may be specified multiple times.
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; plain ASCII also
284 works) for capturing the new image.  The configuration file specifies files that
285 are to be treated specially during the image capture.
286 .IP ""
287 The format of the configuration file is INI-style; that is, it is arranged in
288 bracketed sections.  Currently, the following sections are recognized:
289 .RS
290 .IP \[bu] 4
291 [ExclusionList] ---  contains a list of path globs to exclude from capture.  If
292 a directory is matched, both the directory and its contents are excluded.
293 .IP \[bu]
294 [ExclusionException] --- contains a list of path globs to include, even when the
295 file or directory also matches a glob in [ExclusionList].  If a directory is
296 matched, then all its contents are included as well.  Files or directories
297 \fIwithin\fR a directory excluded by [ExclusionList] may even be included using
298 this, though currently it only works for absolute globs (those that begin with
299 "/" or "\\"); for example, "/dir/file" can be included while "/dir" can be
300 excluded, but including simply "file" won't work in that case.
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 Path globs may contain the '*' and '?' meta-characters.  Relative globs (e.g.
309 *.mp3) match against a filename in any directory.  Absolute globs (e.g.
310 /dir/file), are treated as paths starting at the main directory being captured,
311 or the root of the NTFS volume for NTFS volume capture mode.  Do not use drive
312 letters in the paths; they will be ignored.  Path separators may be either
313 forwards slashes or backwards slashes.
314 .IP ""
315 Lines beginning with the '#' or ';' characters are treated as comments and
316 ignored.  Globs with whitespace in them need not be quoted; however, if they
317 are, both double and single quotes are accepted.
318 .IP ""
319 If this option is not specified the following default configuration file is
320 used:
321 .IP ""
322 .RS
323 .RS
324 .nf
325 [ExclusionList]
326 \\$ntfs.log
327 \\hiberfil.sys
328 \\pagefile.sys
329 \\swapfile.sys
330 \\System Volume Information
331 \\RECYCLER
332 \\$RECYCLE.BIN
333 \\$Recycle.Bin
334 \\Windows\\CSC
335 .RE
336 .RE
337 .fi
338 .IP ""
339 However, special behavior applies if \fB--wimboot\fR is also specified.  By
340 default, with \fB--wimboot\fR specified, the file
341 Windows/System32/WimBootCompress.ini in the directory being captured will be
342 used as the configuration file.  However, this can be overridden using
343 \fB--config\fR; and this also causes the specified configuration file to be
344 saved in the WIM image as Windows/System32/WimBootCompress.ini, overriding any
345 that may be present on the filesystem.
346 .TP
347 \fB--unix-data\fR
348 (UNIX-like systems only)  Store UNIX-specific metadata and special files.  This
349 includes: standard UNIX file permissions (owner, group, and mode); device nodes,
350 named pipes, and sockets; and extended attributes (Linux only).  This
351 information can later be restored by \fBwimapply\fR with the \fB--unix-data\fR
352 option.
353 .IP
354 UNIX-specific information is ignored by Microsoft's WIM software and by the
355 Windows version of wimlib.
356 .TP
357 \fB--no-acls\fR
358 Do not capture files' security descriptors.
359 .TP
360 \fB--strict-acls\fR
361 Fail immediately if the full security descriptor of any file cannot be read.  On
362 Windows, the default behavior without this option is to first try omitting the
363 SACL from the security descriptor, then to try omitting the security descriptor
364 entirely.  The purpose of this is to capture as much data as possible without
365 always requiring Administrator privileges.  However, if you desire that all
366 security descriptors be captured exactly, you may wish to provide this option,
367 although the Administrator should have permission to read everything anyway.
368 .TP
369 \fB--rpfix\fR, \fB--norpfix\fR
370 Set whether to fix targets of absolute symbolic links (reparse points in Windows
371 terminology) or not.  When enabled (\fB--rpfix\fR), absolute symbolic links that
372 point inside the directory tree being captured will be adjusted to be absolute
373 relative to the root of the directory tree being captured.  When disabled
374 (\fB--norpfix\fR), absolute symbolic links will be captured exactly as is.
375 .IP ""
376 The default behavior of \fBwimcapture\fR is equivalent to \fB--rpfix\fR.  The
377 default behavior of \fBwimappend\fR is equivalent to \fB--rpfix\fR if reparse
378 point fixups have previously been done on \fIWIMFILE\fR, otherwise
379 \fB--norpfix\fR.
380 .IP ""
381 In the case of a multi-source capture, (\fB--source-list\fR specified), passing
382 \fB--norpfix\fR is recommended.  Otherwise, reparse point fixups will be
383 disabled on all capture sources destined for non-root locations in the WIM
384 image, while capture sources destined for the WIM root will get the default
385 behavior from the previous paragraph.
386 .TP
387 \fB--source-list\fR
388 \fBwimcapture\fR and \fBwimappend\fR support creating a WIM image from multiple
389 separate files or directories.  When \fB--source-list\fR is specified, the
390 \fISOURCE\fR argument specifies the name of a text file, each line of which is
391 either 1 or 2 whitespace separated file paths.  The first file path, the source,
392 specifies the path to a file or directory to capture into the WIM image.  It may
393 be either absolute or relative to the current working directory.  The second
394 file path, if provided, is the target and specifies the path  in the WIM image
395 that this file or directory will be saved as.  Leading and trailing slashes in
396 the target are ignored, except if it consists entirely of slashes (e.g. "/"),
397 which indicates that the directory is to become the root of the WIM image.  If
398 omitted, the target string defaults to the same as the source string.
399 .IP ""
400 An example source list file is as follows:
401 .IP ""
402 .RS
403 .RS
404 .nf
405 # Make the WIM image from the 'winpe' directory
406 winpe   /
407
408 # Send the 'overlay' directory to '/overlay' in the WIM image
409 overlay /overlay
410
411 # Overlay a separate directory directly on the root of the WIM image.
412 /data/stuff     /
413 .RE
414 .RE
415 .fi
416 .IP ""
417 Subdirectories in the WIM are created as needed.  Multiple source directories
418 may share the same target, which implies an overlay.  In the event that this
419 results a nondirectory file being added to the WIM image multiple times, the
420 last version (as listed in the source list file) overrides any earlier version.
421 .IP ""
422 File paths containing whitespace may be quoted with either single quotes or
423 double quotes.  Quotes may not be escaped.
424 .IP ""
425 Lines consisting only of whitespace and lines beginning with '#' preceded by
426 optional whitespace are ignored.
427 .IP ""
428 As a special case, if \fISOURCE\fR is "-", the source list is read from standard
429 input rather than an external file.
430 .IP ""
431 The NTFS volume capture mode on UNIX-like systems cannot be used with
432 \fB--source-list\fR, as only capturing a full NTFS volume is supported.
433 .TP
434 \fB--pipable\fR
435 With \fBwimcapture\fR, create a wimlib-specific "pipable" WIM which can be
436 captured and applied fully sequentially.  If \fIWIMFILE\fR is specified as "-",
437 then the pipable WIM is written directly to standard output; otherwise, it is
438 written to disk as usual.  The image in the pipable WIM can be later be applied
439 with \fBwimapply\fR, either from disk or from standard input.  A typical use of
440 pipable WIMs might involve streaming the WIM image to a remote server when
441 capturing it and/or streaming the WIM image from a remote server when applying
442 it.
443 .IP ""
444 Generally, all the \fBwimlib-imagex\fR commands work on both pipable and
445 non-pipable WIMs.  \fBwimoptimize\fR and \fBwimexport\fR may also be used to
446 convert between pipable WIMs and non-pipable WIMs.  However, there are a few
447 limitations of pipable WIMs:
448 .RS
449 .IP \[bu] 4
450 Pipable WIMs are a wimlib extension which are \fInot\fR compatible with
451 Microsoft's WIM software or with other programs such as 7-Zip.
452 .IP \[bu]
453 Using \fBwimappend\fR, multiple images may be added to a pipable WIM.  This is
454 supported, though it is less efficient than doing so with non-pipable WIMs
455 because a pipable WIM is fully rebuilt each time it is appended to; and when
456 piping such a WIM to \fBwimapply\fR to extract an image, some unneeded data will
457 be sent over the pipe.
458 .IP \[bu]
459 Although a pipable WIM image may be updated using \fBwimupdate\fR, it requires a
460 full rebuild of the WIM file, making it less efficient than updating a
461 non-pipable WIM.
462 .IP \[bu]
463 Solid pipable WIMs are not yet supported.
464 .RE
465 .TP
466 \fB--not-pipable\fR
467 With \fBwimappend\fR, rebuild the WIM file in the non-pipable (regular) format.
468 This option is only useful if you happen to be adding an image to a pipable WIM
469 (see \fB--pipable\fR) which you want in non-pipable format instead.  Note that
470 \fBwimoptimize\fR(1) can also be used to convert between non-pipable and pipable
471 WIMs.
472 .TP
473 \fB--update-of\fR=[\fIWIMFILE\fR:]\fIIMAGE\fR
474 Hint that the image being captured or appended from \fISOURCE\fR is mostly the
475 same as the existing image \fIIMAGE\fR in \fIWIMFILE\fR, but captured at a later
476 point in time, possibly with some modifications in the intervening time.  This
477 is designed to be used in incremental backups of the same filesystem or
478 directory tree.  \fIIMAGE\fR can be a 1-based index or name of an existing image
479 in \fIWIMFILE\fR.  It can also be a negative integer to index backwards into the
480 images (e.g.  -1 means the last existing image in \fIWIMFILE\fR).
481 .IP ""
482 When this option is provided, the capture or append of the new image will be
483 optimized by not reading files that, based on metadata such as timestamps,
484 appear not to have been modified since they were archived in the existing
485 \fIIMAGE\fR.  Barring manipulation of timestamps, this option only affects
486 performance and does not change the resulting WIM image (but see note below).
487 .IP ""
488 As shown, the full syntax for the argument to this option is to specify the WIM
489 file, a colon, and the image; for example, "--update-of mywim.wim:1".  However,
490 the WIM file and colon may be omitted if \fB--delta-from\fR is specified exactly
491 once, in which case the WIM defaults to that specified in \fB--delta-from\fR, or
492 if the operation is \fBwimappend\fR rather \fBwimcapture\fR, in which case the
493 WIM defaults to the one being appended to.
494 .IP ""
495 Note: in the Windows version of wimlib, it has been observed that
496 \fB--update-of\fR mode is not completely reliable at detecting changes in file
497 contents, sometimes causing the old contents of a few files to be archived
498 rather than the current contents.  The cause of this problem is that Windows
499 does not immediately update a file's last modification timestamp after every
500 write to that file.  Unfortunately, there is no known way for applications like
501 wimlib to automatically work around this bug.  Manual workarounds are possible;
502 theoretically, taking any action that causes the problematic files to be closed,
503 such as restarting applications or the computer itself, should cause the files'
504 last modification timestamps to be updated.  Also note that wimlib compares file
505 sizes as well as timestamps in determining whether a file has changed, which
506 helps make the problem less likely to occur; and the problem does not occur on
507 other operating systems such as Linux which maintain files' last modification
508 timestamps correctly.
509 .TP
510 \fB--delta-from\fR=\fIWIMFILE\fR
511 Capture or append the new image as a "delta" from \fIWIMFILE\fR.  Any file data
512 that would ordinarily need to be archived in the new or updated WIM is omitted
513 if it is already present in the \fIWIMFILE\fR on which the delta is being based.
514 The resulting WIM will still contain a full copy of the image metadata, but this
515 is typically only a small fraction of a WIM's total size.
516 .IP ""
517 This option can be specified multiple times, in which case the resulting delta
518 WIM will only contain file data not present in any of the specified base WIMs.
519 .IP ""
520 To operate on the resulting delta WIM using other commands such as
521 \fBwimapply\fR, you must specify the delta WIM as the WIM file to operate on,
522 but also reference the base WIM(s) using the \fB--ref\fR option.  Beware: to
523 retain the proper functioning of the delta WIM, you can only add, not delete,
524 files and images to the base WIM(s) following the capture of a delta from it.
525 .IP ""
526 \fB--delta-from\fR may be combined with \fB--update-of\fR to increase the
527 speed of capturing a delta WIM.
528 .IP ""
529 As an example, consider the following backup and restore sequence:
530 .IP ""
531 .RS
532 .nf
533 (initial backup)
534
535 $ wimcapture /some/directory bkup-base.wim
536
537 (some days later, create second backup as delta from first)
538
539 $ wimcapture /some/directory bkup-2013-08-20.dwm \\
540         --update-of bkup-base.wim:-1 --delta-from bkup-base.wim
541
542 (restoring the second backup)
543
544 $ wimapply bkup-2013-08-20.dwm --ref=bkup-base.wim 1 \\
545         /some/directory
546 .RE
547 .fi
548 .IP ""
549 However, note that as an alternative to the above sequence that used a delta
550 WIM, the second backup could have simply been appended to the WIM as new image
551 using \fBwimappend\fR.  Delta WIMs should be used only if it's desired to base
552 the backups or images on a separate, large file that is rarely modified.
553 .IP ""
554 \fB--delta-from\fR is supported by both \fBwimcapture\fR and \fBwimappend\fR.
555 .IP ""
556 Delta WIMs are compatible with Microsoft's WIM software.  For example, you can
557 use the /ref option of ImageX to reference the base WIM(s), similar to above.
558 .IP ""
559 Additional note: wimlib is generalized enough that you can in fact combine
560 \fB--pipable\fR and \fB--delta-from\fR to create pipable delta WIMs.  In such
561 cases, the base WIM(s) must be captured as pipable as well as the delta WIM, and
562 when applying an image, the base WIM(s) must be sent over the pipe after the
563 delta WIM.
564 .TP
565 \fB--wimboot\fR
566 Mark the image as WIMBoot-compatible.  See Microsoft's documentation for more
567 information about WIMBoot.  With \fBwimcapture\fR this option will set the
568 compression type to XPRESS and the chunk size to 4096 bytes; these can, however,
569 still be overridden through the \fB--compress\fR and \fB--chunk-size\fR
570 parameters, respectively.  In addition, this option will set the configuration
571 file to \fISOURCE\fR\\Windows\\System32\\WimBootCompress.ini if present and
572 accessible; however, this may still be overridden through the \fB--config\fR
573 parameter.
574 .TP
575 \fB--unsafe-compact\fR
576 With \fBwimappend\fR, compact the WIM archive in-place and append any new data,
577 eliminating "holes".  This is efficient, but in general this option should
578 \fInot\fR be used because a failed or interrupted compaction will corrupt the
579 WIM archive.  For more information, see the documentation for this option to
580 \fBwimoptimize\fR(1).
581 .TP
582 \fB--snapshot\fR
583 Create a temporary filesystem snapshot of the source directory and capture the
584 files from it.  Currently, this option is only supported on Windows, where it
585 uses the Volume Shadow Copy Service (VSS).  Using this option, you can create a
586 consistent backup of the system volume of a running Windows system without
587 running into problems with locked files.  For the VSS snapshot to be
588 successfully created, \fBwimlib-imagex\fR must be run as an Administrator, and
589 it cannot be run in WoW64 mode (i.e. if Windows is 64-bit, then
590 \fBwimlib-imagex\fR must be 64-bit as well).
591 .SH NOTES
592 \fBwimappend\fR does not support appending an image to a split WIM.
593 .PP
594 Except when using \fB--unsafe-compact\fR, it is safe to abort a \fBwimappend\fR
595 command partway through; however, after doing this, it is recommended to run
596 \fBwimoptimize\fR to remove any data that was appended to the physical WIM file
597 but not yet incorporated into the structure of the WIM, unless the WIM was being
598 fully rebuilt (e.g. with \fB--rebuild\fR), in which case you should delete the
599 temporary file left over.
600 .PP
601 \fBwimlib-imagex\fR creates WIMs compatible with Microsoft's software (WIMGAPI,
602 ImageX, DISM), with some caveats:
603 .IP \[bu] 4
604 With \fBwimlib-imagex\fR on UNIX-like systems, it is possible to create a WIM
605 image containing files with names differing only in case, or files with names
606 containing the characters ':', '*', '?', '"', '<', '>', '|', or '\\', which are
607 valid on POSIX-compliant filesystems but not Windows.  Be warned that such files
608 will not be extracted by default by the Windows version of \fBwimlib-imagex\fR,
609 and (even worse) Microsoft's ImageX can be confused by such names and quit
610 extracting the image partway through.
611 .IP \[bu]
612 Pipable WIMs are incompatible with Microsoft's software.  Pipable WIMs are
613 created only if \fIWIMFILE\fR was specified as "-" (standard output) or if
614 the \fB--pipable\fR flag was specified.
615 .IP \[bu]
616 WIMs captured with a non-default chunk size (with the \fB--chunk-size\fR option)
617 or as solid archives (with the \fB--solid\fR option) or with LZMS compression
618 (with \fB--compress\fR=LZMS or \fB--compress\fR=recovery) have varying levels of
619 compatibility with Microsoft's software.  Generally, more recent versions of
620 Microsoft's software are more compatible.
621 .SH EXAMPLES
622 First example:  Create a new WIM 'mywim.wim' with LZX ("maximum") compression
623 that will contain a captured image of the directory tree 'somedir'.  Note that
624 the image name need not be specified and will default to 'somedir':
625 .RS
626 .PP
627 wimcapture somedir mywim.wim
628 .RE
629 .PP
630 Next, append the image of a different directory tree to the WIM created above:
631 .RS
632 .PP
633 wimappend anotherdir mywim.wim
634 .RE
635 .PP
636 Easy enough, and the above examples of imaging directory trees work on both
637 UNIX-like systems and Windows.  Next, capture a WIM with several non-default
638 options, including XPRESS ("fast") compression, extra integrity information, no
639 messing with absolute symbolic links, and an image name and description:
640 .RS
641 .PP
642 wimcapture somedir mywim.wim --compress=fast \\
643 .RS
644 --check --norpfix "Some Name" "Some Description"
645 .RE
646 .RE
647 .PP
648 On a UNIX-like system, capture a full NTFS volume into a new WIM using the
649 \fBNTFS VOLUME CAPTURE (UNIX)\fR mode, and name the image "Windows 7":
650 .RS
651 .PP
652 wimcapture /dev/sda2 windows7.wim "Windows 7"
653 .RE
654 .PP
655 or, on Windows, to capture a full NTFS volume you instead need to specify the
656 root directory of the mounted volume, for example:
657 .RS
658 .PP
659 wimcapture E:\\ windows7.wim "Windows 7"
660 .RE
661 .PP
662 Same as UNIX example above, but capture the WIM in the wimlib-specific "pipable"
663 format that can be piped to \fBwimapply\fR:
664 .RS
665 .PP
666 wimcapture /dev/sda2 windows7.wim "Windows 7" --pipable
667 .RE
668 .PP
669 Same as above, but instead of writing the pipable WIM to the file
670 "windows7.wim", write it directly to standard output through a pipe into some
671 other program "someprog", which could, for example, be a program or script that
672 streams the data to a server:
673 .RS
674 .PP
675 wimcapture /dev/sda2 - "Windows 7" | someprog
676 .RE
677 .SH SEE ALSO
678 .BR wimlib-imagex (1),
679 .BR wimapply (1)
680 .BR wimoptimize (1)