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