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