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