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