]> wimlib.net Git - wimlib/blob - doc/imagex-capture.1.in
7f7ca9a3cd9df8379fa78ec14c0d780c650427e3
[wimlib] / doc / imagex-capture.1.in
1 .TH WIMLIB-IMAGEX "1" "January 2014" "@IMAGEX_PROGNAME@ @VERSION@" "User Commands"
2 .SH NAME
3 @IMAGEX_PROGNAME@-capture, @IMAGEX_PROGNAME@-append \- Create or append a WIM image
4 .SH SYNOPSIS
5 \fB@IMAGEX_PROGNAME@ capture\fR \fISOURCE\fR \fIWIMFILE\fR [\fIIMAGE_NAME\fR \
6 [\fIIMAGE_DESCRIPTION\fR]] [\fIOPTION\fR...]
7 .br
8 \fB@IMAGEX_PROGNAME@ append\fR \fISOURCE\fR \fIWIMFILE\fR [\fIIMAGE_NAME\fR \
9 [\fIIMAGE_DESCRIPTION\fR]] [\fIOPTION\fR...]
10 .SH DESCRIPTION
11 The \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR commands
12 create a Windows Imaging (WIM) image from a directory tree.  The
13 \fB@IMAGEX_PROGNAME@ capture\fR command creates a new WIM file containing the
14 captured image, while the \fB@IMAGEX_PROGNAME@ 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 \fB@IMAGEX_PROGNAME@\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 mount
55 points are followed recursively.  However, it is important to keep in mind that
56 the WIM format was designed for Windows, so it cannot store all possible
57 metadata from filesystems used on UNIX-like systems.  The main information that
58 will \fInot\fR be stored is:
59 .IP \[bu] 4
60 UNIX file owners, groups, and modes.  (Exception: see the \fB--unix-data\fR
61 option.)  As a result, file permissions will not be stored, and files that are
62 neither regular files, directories, nor symbolic links, such as device files and
63 FIFOs, cannot be captured and will be excluded by default.
64 .IP \[bu]
65 Extended attributes.  This mainly includes extensions to the traditional UNIX
66 security model, such as SELinux security labels, POSIX ACLs, and capabilities
67 labels.
68 .PP
69 Notes: hard links and symbolic links are supported by the WIM format and
70 \fIare\fR stored.  (Symbolic links are turned into "native" Windows symbolic
71 links via reparse points; this process is reversible, e.g. automatically by
72 \fB@IMAGEX_PROGNAME@ apply\fR.)  Timestamps are stored with 100 nanosecond
73 granularity and include last modification time (mtime) and last access time
74 (atime), but not last status change time (ctime).
75 .SH NTFS VOLUME CAPTURE (UNIX)
76 This section documents how \fB@IMAGEX_PROGNAME@\fR captures files directly from
77 an NTFS volume image on UNIX-like systems.
78 .PP
79 On UNIX-like systems, a special image capture mode is entered when \fISOURCE\fR
80 is a regular file or block device.  In this mode, \fISOURCE\fR is assumed to be
81 an NTFS volume or volume image, and \fB@IMAGEX_PROGNAME@\fR will capture a WIM
82 image containing the full contents of the NTFS volume, including NTFS-specific
83 data.  This is done using libntfs-3g.
84 .PP
85 Please note that the NTFS volume capture mode is \fInot\fR entered if
86 \fISOURCE\fR is a directory, even if an NTFS filesystem is mounted on
87 \fISOURCE\fR using ntfs-3g.  You must specify the NTFS volume itself (and it
88 must be unmounted, and you must have permission to read from it).
89 .PP
90 The NTFS volume capture mode attempts to capture as much data and metadata as
91 possible, including:
92 .IP \[bu] 4
93 All data streams of all unencrypted files, including the unnamed data stream as
94 well as all named data streams.
95 .IP \[bu]
96 Reparse points, including symbolic links, junction points, and other reparse
97 points.
98 .IP \[bu]
99 File and directory creation, access, and modification timestamps, using the
100 native NTFS resolution of 100 nanoseconds.
101 .IP \[bu]
102 Windows security descriptors, including all components (owner, group, DACL, and
103 SACL).
104 .IP \[bu]
105 DOS/Windows file attribute flags.
106 .IP \[bu]
107 All names of all files, including names in the Win32 namespace, DOS namespace,
108 Win32+DOS namespace, and POSIX namespace.  This includes hard links.
109 .PP
110 However, the main limitations of this NTFS volume capture mode are:
111 .IP \[bu] 4
112 Encrypted files are excluded by default.  Although ntfs-3g can read their data,
113 they need to be stored in the WIM file in a special format that wimlib does not
114 yet support (except on Windows, where wimlib can treat the data as opaque and
115 hand it off to the appropriate API function).
116 .IP \[bu]
117 The sparse attribute on sparse files will be saved, but the data stored will be
118 the full data of the file rather than the "sparse" data.  (The data is, however,
119 subject to the WIM format's compression.)
120 .SH DIRECTORY CAPTURE (WINDOWS)
121 On Windows, \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR
122 natively support Windows-specific and NTFS-specific data.  They therefore act
123 similarly to the corresponding commands of Microsoft's ImageX.  For best
124 results, the directory being captured should be on an NTFS volume and
125 \fB@IMAGEX_PROGNAME@\fR should be run with Administrator privileges; however,
126 non-NTFS filesystems and running without Administrator privileges are also
127 supported.
128 .PP
129 On Windows, \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR
130 try to archive as much data and metadata as possible, including:
131 .IP \[bu] 4
132 All data streams of all files.
133 .IP \[bu]
134 Reparse points, including symbolic links, junction points, and other reparse
135 points, if supported by the source filesystem.  (Note: see \fB--rpfix\fR and
136 \fB--norpfix\fR for documentation on exactly how absolute symbolic links and
137 junctions are captured.)
138 .IP \[bu]
139 File and directory creation, access, and modification timestamps.  These are
140 stored with Windows NT's native timestamp resolution of 100 nanoseconds.
141 .IP \[bu]
142 Security descriptors, if supported by the source filesystem and \fB--no-acls\fR
143 is not specified.  However, beware that unless \fB--strict-acls\fR is specified,
144 the security descriptors for individual files or directories may be omitted or
145 only partially captured if the user does not have permission to read them, which
146 can be a problem if \fB@IMAGEX_PROGNAME@\fR is run as a non-Administrator.
147 .IP \[bu]
148 File attributes, including hidden, sparse, compressed, encrypted, etc.
149 Encrypted files will be stored in encrypted form rather than in plain text.
150 Transparently compressed files will be read as uncompressed and stored subject
151 to the WIM's own compression.  There is no special handling for storing sparse
152 files, but they are likely to compress to a small size.
153 .IP \[bu]
154 DOS names (8.3) names of files; however, the failure to read them is not
155 considered an error condition.
156 .IP \[bu]
157 Hard links, if supported by the source filesystem.
158 .PP
159 Note: the capture process is reversible, since when \fB@IMAGEX_PROGNAME@
160 apply\fR (on Windows) extracts the captured WIM image, it will extract all of
161 the above information, at least to the extent supported by the destination
162 filesystem.  One exception is that since encrypted files are stored as
163 encrypted, their data will not be available if restored on a Windows system
164 that does not have the decryption key.
165 .SH OPTIONS
166 .TP 6
167 \fB--boot\fR
168 Specifies that the new image is to be made the bootable image of the WIM archive.
169 .TP
170 \fB--check\fR
171 For \fB@IMAGEX_PROGNAME@ append\fR, before performing the append operation,
172 check the integrity of \fIWIMFILE\fR if an integrity table is present.
173 Furthermore, include an integrity table in the new WIM file
174 (\fB@IMAGEX_PROGNAME@ capture\fR) or the modified WIM file (\fB@IMAGEX_PROGNAME@
175 append\fR).  If this option is not specified, no integrity table is included in
176 a WIM file created with \fB@IMAGEX_PROGNAME@ capture\fR, while a WIM file
177 updated with \fB@IMAGEX_PROGNAME@ append\fR will be written with an integrity
178 table if and only if one was present before.
179 .TP
180 \fB--compress\fR=\fITYPE\fR
181 Specifies the compression type for the new WIM file.  This flag is only valid
182 for \fB@IMAGEX_PROGNAME@ capture\fR, since the compression mode for
183 \fB@IMAGEX_PROGNAME@ append\fR must be the same as that of the existing
184 WIM (and is automatically set as such).  \fITYPE\fR may be "none",
185 "fast", or "maximum".  As of wimlib v1.5.3, the default is LZX compression, but
186 in a special mode that is somewhere in between "fast" and "maximum" in terms of
187 speed and compression ratio.  Use \fB--compress\fR=\fImaximum\fR to explicitly
188 request a better compression ratio at the cost of more time spent compressing.
189 .IP ""
190 You may also specify the actual names of the compression algorithms, "XPRESS"
191 and "LZX", instead of "fast" and "maximum", respectively.
192 .IP ""
193 As of wimlib v1.6.0, a third compression type, "recovery" or "LZMS", is also
194 available.  Its use is generally not recommended because other than wimlib
195 itself, as of Windows 8 it is only compatible with WIMGAPI and Windows Setup
196 (not even ImageX or Dism).  However, LZMS is the compression algorithm used in
197 packed resources created if the \fB--pack-streams\fR option is specified.
198 .TP
199 \fB--compress-slow\fR
200 Spend even more time compressing the data to achieve a very slightly better
201 compression ratio.  This currently only has an effect for LZX ("maximum", the
202 default) and LZMS ("recovery") compression.
203 .TP
204 \fB--chunk-size\fR=\fISIZE\fR
205 Set the WIM compression chunk size to \fISIZE\fR.  Using this option is not
206 recommended because WIM chunk sizes other than the default of 32768 have varying
207 levels of compatibility with Microsoft's software (depending on the compression
208 type, chunk size, and software version).  In addition, wimlib versions before
209 1.6.0 do not support alternate chunk sizes.  But if you decide to use this
210 option regardless, you can choose a chunk size that is a power of 2 greater than
211 or equal to 2^15 (32768) up to a maximum determined by the compression format.
212 Larger chunks mean larger LZ77 dictionaries and better compression ratios on
213 sufficiently large files, but slower random access.  For LZX ("maximum")
214 compression, the maximum allowed chunk size is 2^21 (2097152), and for XPRESS
215 ("fast") and LZMS ("recovery") compression, the maximum allowed chunk size is
216 2^26 (67108644).
217 .TP
218 \fB--pack-streams\fR
219 Create a "solid" archive that compresses multiple unique streams ("files")
220 together, rather than each unique stream ("file") independently.  This can
221 result in a significantly better compression ratio, but this format greatly
222 decreases the performance of random access to the data, as may occur on a WIM
223 mounted with \fB@IMAGEX_PROGNAME@ mount\fR.  Also, WIMs created using this
224 option use a different version number in their header and as of Windows 8 are
225 only compatible with Windows Setup and WIMGAPI, not even ImageX and Dism.
226 .IP ""
227 Packed resources use a compression type and chunk size that is independent of
228 the WIM's "default compression type" and "default chunk size" (which may be
229 adjusted by the \fB--compress\fR and \fB--chunk-size\fR options, respectively).
230 For compatibility reasons, \fB@IMAGEX_PROGNAME@ capture\fR currently has no
231 option to change the compression type or chunk size used in packed resources.
232 .TP
233 \fB--threads\fR=\fINUM_THREADS\fR
234 Number of threads to use for compressing data.  Default: autodetect (number of
235 available CPUs).
236 .TP
237 \fB--rebuild\fR
238 For \fB@IMAGEX_PROGNAME@ append\fR: rebuild the entire WIM rather than appending the new
239 data to the end of it.  Rebuilding the WIM is slower, but will save a little bit
240 of space that would otherwise be left as a hole in the WIM.  Also see \fB@IMAGEX_PROGNAME@
241 optimize\fR(1).
242 .TP
243 \fB--flags\fR=\fIEDITIONID\fR
244 Specify a string to use in the <FLAGS> element of the XML data for the new
245 image.
246 .TP
247 \fB--dereference\fR
248 (UNIX-like systems only) Follow symbolic links and archive the files they point
249 to, rather than archiving the links themselves.
250 .TP
251 \fB--config\fR=\fIFILE\fR
252 Specifies a configuration file for capturing the new image.  The configuration
253 file specifies files that are to be treated specially during the image capture.
254 .IP ""
255 The format of the configuration file is a number of sections containing path
256 globs one per line, where each section begins with the tag [ExclusionList],
257 [ExclusionException], [CompressionExclusionList], or [AlignmentList].
258 Currently, only the [ExclusionList] and [ExclusionException] sections are
259 implemented.  The [ExclusionList] section specifies a list of path globs to
260 exclude from capture, while the [ExclusionException] section specifies a list of
261 path globs to include in the capture even if the matched file or directory name
262 also appears in the [ExclusionList].
263 .IP ""
264 Relative globs with only one path component (e.g. *.mp3) match against a
265 filename in any directory.  Relative globs with multiple path components (e.g.
266 dir/file), as well as absolute globs (e.g. /dir/file), are treated as paths
267 starting at the root directory of capture, or the root of the NTFS volume for
268 NTFS volume capture mode.  If a directory is matched by a glob in the
269 [ExclusionList], the entire directory tree rooted at that directory is excluded
270 from the capture, unless \fB--dereference\fR is specified and there is another
271 path into that directory through a symbolic link.
272 .IP ""
273 For compatibility with Windows, the path separators in the globs may be either
274 forward slashes or backslashes, and the line separators may be either UNIX-style
275 or DOS-style.  Globs with spaces in them must be quoted, and leading and
276 trailing whitespace is not significant.  Empty lines and lines beginning with
277 \'#' or whitespace followed by '#' are ignored.
278 .IP ""
279 Paths may not have drive letters in them, as they are all relative to the root
280 of capture and not absolute external paths.
281 .IP ""
282 If this option is not specified the following default configuration file is
283 used:
284 .IP ""
285 .RS
286 .RS
287 .nf
288 [ExclusionList]
289 \\$ntfs.log
290 \\hiberfil.sys
291 \\pagefile.sys
292 "\\System Volume Information"
293 \\RECYCLER
294 \\Windows\\CSC
295 .RE
296 .RE
297 .fi
298 .TP
299 \fB--unix-data\fR
300 (UNIX-like systems only) Store the UNIX owner, group, and mode of all captured
301 files.  This is done by adding a special alternate data stream to each directory
302 entry that contains this information.  Please note that this flag is for
303 convenience only, in case you want to use \fB@IMAGEX_PROGNAME@\fR to archive
304 files on UNIX.  Microsoft's software will not understand this special
305 information.  You also may run into problems when applying an image with UNIX
306 data from a pipable WIM.
307 .TP
308 \fB--no-acls\fR
309 Do not capture files' security descriptors.
310 .TP
311 \fB--strict-acls\fR
312 Fail immediately if the full security descriptor of any file cannot be read.  On
313 Windows, the default behavior without this option is to first try omitting the
314 SACL from the security descriptor, then to try omitting the security descriptor
315 entirely.  The purpose of this is to capture as much data as possible without
316 always requiring Administrator privileges.  However, if you desire that all
317 security descriptors be captured exactly, you may wish to provide this option,
318 although the Administrator should have permission to read everything anyway.
319 .TP
320 \fB--rpfix\fR, \fB--norpfix\fR
321 Set whether to fix targets of absolute symbolic links (reparse points in Windows
322 terminology) or not.  When enabled (\fB--rpfix\fR), absolute symbolic links that
323 point inside the directory tree being captured will be adjusted to be absolute
324 relative to the root of the directory tree being captured.  In addition,
325 absolute symbolic links that point outside the directory tree being captured
326 will be ignored and not be captured at all.  When disabled (\fB--norpfix\fR),
327 absolute symbolic links will be captured exactly as is.
328 .IP ""
329 The default behavior for \fB@IMAGEX_PROGNAME@ capture\fR is equivalent to
330 \fB--rpfix\fR.  The default behavior for \fB@IMAGEX_PROGNAME@ append\fR will be
331 \fB--rpfix\fR if reparse point fixups have previously been done on
332 \fIWIMFILE\fR, otherwise \fB--norpfix\fR.
333 .IP ""
334 In the case of a multi-source capture, (\fB--source-list\fR specified), passing
335 \fB--norpfix\fR is recommended.  Otherwise, reparse point fixups will be
336 disabled on all capture sources destined for non-root locations in the WIM
337 image, while capture sources destined for the WIM root will get the default
338 behavior from the previous paragraph.
339 .TP
340 \fB--source-list\fR
341 \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR support
342 creating a WIM image from multiple separate files or directories.  When
343 \fB--source-list\fR is specified, the \fISOURCE\fR argument specifies the name
344 of a text file, each line of which is either 1 or 2 whitespace separated file
345 paths.  The first file path, the source, specifies the path to a file or
346 directory to capture into the WIM image.  It may be either absolute or relative
347 to the current working directory.  The second file path, if provided, is the
348 target and specifies the path  in the WIM image that this file or directory will
349 be saved as.  Leading and trailing slashes in the target are ignored, except if
350 it consists entirely of slashes (e.g. "/"), which indicates that the directory
351 is to become the root of the WIM image.  If omitted, the target string defaults
352 to the same as the source string.
353 .IP ""
354 An example source list file is as follows:
355 .IP ""
356 .RS
357 .RS
358 .nf
359 # Make the WIM image from the 'winpe' directory
360 winpe   /
361
362 # Send the 'overlay' directory to '/overlay' in the WIM image
363 overlay /overlay
364
365 # Overlay a separate directory directly on the root of the WIM image.
366 # This is only legal if there are no conflicting files.
367 /data/stuff     /
368 .RE
369 .RE
370 .fi
371 .IP ""
372 Subdirectories in the WIM are created as needed.  Multiple source directories
373 may share the same target, which implies an overlay; however, an error is issued
374 if the same file appears in different overlays to the same directory.
375 .IP ""
376 File paths containing whitespace may be quoted with either single quotes or
377 double quotes.  Quotes may not be escaped.
378 .IP ""
379 Lines consisting only of whitespace and lines beginning with '#' preceded by
380 optional whitespace are ignored.
381 .IP ""
382 As a special case, if \fISOURCE\fR is "-", the source list is read from standard
383 input rather than an external file.
384 .IP ""
385 The NTFS volume capture mode on UNIX-like systems cannot be used with
386 \fB--source-list\fR, as only capturing a full NTFS volume is supported.
387 .TP
388 \fB--pipable\fR
389 Create a "pipable" WIM, which can be applied fully sequentially, including from
390 a pipe.  An image in the resulting WIM can be applied with \fB@IMAGEX_PROGNAME@
391 apply\fR, either normally by specifying the WIM file name, or with
392 \fB@IMAGEX_PROGNAME@ apply -\fR to read the WIM from standard input.  See
393 \fB@IMAGEX_PROGNAME@ apply\fR(1) for more details.
394 .IP ""
395 For append operations, this option will result in a full rebuild of the WIM to
396 make it pipable.  For capture operations, the captured WIM is simply created as
397 pipable.  Beware that the more images you add to a pipable WIM, the less
398 efficient piping it will be, since more unneeded data will be sent through the
399 pipe.
400 .IP ""
401 When wimlib creates a pipable WIM, it carefully re-arranges the components of
402 the WIM so that they can be read sequentially and also makes several other
403 modifications.  As a result, these "pipable" WIMs are \fInot compatible with
404 Microsoft's software\fR, so keep this in mind if you're going to use them.  If
405 desired, you can use \fB@IMAGEX_PROGNAME@ optimize --not-pipable\fR to re-write
406 a pipable WIM as a regular WIM.  (\fB@IMAGEX_PROGNAME@ export\fR also provides
407 the capability to export images from a pipable WIM into a non-pipable WIM, or
408 vice versa.)
409 .IP ""
410 For the most part, wimlib operates on pipable WIMs transparently.  You can
411 modify them, add or delete images, export images, and even create split pipable
412 WIMs.  The main disadvantages are that appending is (currently) less efficient
413 (\fB--rebuild\fR is always implied), and also they aren't compatible with
414 Microsoft's software.
415 .IP ""
416 \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR can both
417 write a pipable WIM directly to standard output; this is done automatically if
418 \fIWIMFILE\fR is specified as "-".  (In that case, \fB--pipable\fR is assumed.)
419 .TP
420 \fB--not-pipable\fR
421 Ensure the resulting WIM is in the normal, non-pipable WIM format.  This is the
422 default for \fB@IMAGEX_PROGNAME@ capture\fR, except when writing to standard
423 output (\fIWIMFILE\fR specified as "-"), and also for \fB@IMAGEX_PROGNAME@
424 append\fR, except when appending to a WIM that is already pipable.
425 .TP
426 \fB--update-of\fR=[\fIWIMFILE\fR:]\fIIMAGE\fR
427 Declares that the image being captured or appended from \fISOURCE\fR is mostly the same as
428 the existing image \fIIMAGE\fR in \fIWIMFILE\fR, but captured at a later point
429 in time, possibly with some modifications in the intervening time.  This is
430 designed to be used in incremental backups of the same filesystem or directory
431 tree.  \fIIMAGE\fR can be a 1-based index or name of an existing image in
432 \fIWIMFILE\fR.  It can also be a negative integer to index backwards into the
433 images (e.g.  -1 means the last existing image in \fIWIMFILE\fR).
434 .IP ""
435 When this option is provided, the capture or append of the new image will be
436 optimized by not reading files that, based on metadata such as timestamps,
437 appear not to have been modified since they were archived in the existing
438 \fIIMAGE\fR.  Barring manipulation of timestamps, this option only affects
439 performance and does not change the resulting WIM image.
440 .IP ""
441 As shown, the full syntax for the argument to this option is to specify the WIM
442 file, a colon, and the image; for example, "--update-of mywim.wim:1".  However,
443 the WIM file and colon may be omitted, in which case the WIM file will default
444 to the WIM file being appended to for append operations, or the WIM file from
445 which a delta is being taken (only if \fB--delta-from\fR is specified exactly
446 once) for capture operations.
447 .TP
448 \fB--delta-from\fR=\fIWIMFILE\fR
449 For \fB@IMAGEX_PROGNAME@ capture\fR only: capture the new WIM as a "delta" from
450 \fIWIMFILE\fR.  Any streams that would ordinarily need to be archived in the new
451 WIM are omitted if they are already present in the \fIWIMFILE\fR on which the
452 delta is being based.  The new WIM will still contain a full copy of the image
453 metadata, but this is typically only a small fraction of a WIM's total size.
454 .IP ""
455 This option can be specified multiple times, in which case the resulting delta
456 WIM will only contain streams not present in any of the specified base
457 \fIWIMFILE\fRs.
458 .IP ""
459 To operate on the resulting delta WIM using other commands such as
460 \fB@IMAGEX_PROGNAME@ apply\fR, you must specify the delta WIM as the WIM file to
461 operate on, but also reference the base WIM(s) using the \fB--ref\fR option.
462 Beware: to retain the proper functioning of the delta WIM, you can only add, not
463 delete, files and images to the base WIM(s) following the capture of a delta
464 from it.
465 .IP ""
466 \fB--delta-from\fR may be combined with \fB--update-of\fR to increase the
467 speed of capturing a delta WIM.
468 .IP ""
469 As an example, consider the following backup and restore sequence:
470 .IP ""
471 .RS
472 .nf
473 (initial backup)
474
475 $ wimcapture /some/directory bkup-base.wim
476
477 (some days later, create second backup as delta from first)
478
479 $ wimcapture /some/directory bkup-2013-08-20.dwm \\
480         --update-of bkup-base.wim:-1 --delta-from bkup-base.wim
481
482 (restoring the second backup)
483
484 $ wimapply bkup-2013-08-20.dwm --ref=bkup-base.wim 1 \\
485         /some/directory
486 .RE
487 .fi
488 .IP ""
489 However, note that as an alternative to the above sequence that used a delta
490 WIM, the second backup could have simply been appended to the WIM as new image
491 using \fB@IMAGEX_PROGNAME@ append\fR.  Delta WIMs should be used only if it's
492 desired to base the backups or images on a separate, large file that is rarely
493 modified.
494 .IP ""
495 Note: unlike "pipable" WIMs (created with the \fB--pipable\fR option), "delta"
496 WIMs (created with the \fB--delta-from\fR option) are compatible with
497 Microsoft's software.  You can use the /ref option of imagex.exe to reference
498 the base WIM(s), similar to above.
499 .IP ""
500 Additional note:  \fB@IMAGEX_PROGNAME@\fR is generalized enough that you can in
501 fact combine \fB--pipable\fR and \fB--delta-from\fR to create pipable delta
502 WIMs.  In such cases, the base WIM(s) must be captured as pipable as well as the
503 delta WIM, and when applying an image, the base WIM(s) must be sent over the
504 pipe after the delta WIM.
505 .SH NOTES
506 \fB@IMAGEX_PROGNAME@ append\fR does not support appending an image to a split WIM.
507 .PP
508 It is safe to abort an \fB@IMAGEX_PROGNAME@ append\fR command partway through;
509 however, after doing this, it is recommended to run \fB@IMAGEX_PROGNAME@
510 optimize\fR to remove any data that was appended to the physical WIM file but
511 not yet incorporated into the structure of the WIM, unless the WIM was being
512 fully rebuilt (e.g. with \fB--rebuild\fR), in which case you should delete the
513 temporary file left over.
514 .PP
515 \fB@IMAGEX_PROGNAME@\fR creates WIMs compatible with Microsoft's software
516 (imagex.exe, Dism.exe, wimgapi.dll), with some caveats:
517 .IP \[bu] 4
518 With \fB@IMAGEX_PROGNAME@\fR on UNIX-like systems, it is possible to create a
519 WIM image containing files with names differing only in case, or files with
520 names containing the characters ':', '*', '?', '"', '<', '>', '|', or '\\',
521 which are valid on POSIX-compliant filesystems but not Windows.  Be warned that
522 such files will not be extracted by default by the Windows version of
523 \fB@IMAGEX_PROGNAME@\fR, and (even worse) Microsoft's ImageX can be confused by
524 such names and quit extracting the image partway through.  (It perhaps is worth
525 pointing out that Windows' own default filesystem, NTFS, supports these
526 characters, although Windows does not!)
527 .IP \[bu]
528 WIMs captured with \fB--unix-data\fR should be assumed to be incompatible with
529 Microsoft's software.
530 .IP \[bu]
531 Pipable WIMs are incompatible with Microsoft's software.  Pipable WIMs are
532 created only if \fIWIMFILE\fR was specified as "-" (standard output) or if
533 the \fB--pipable\fR flag was specified.
534 .IP \[bu]
535 WIMs captured with a non-default chunk size (with the \fB--chunk-size\fR option)
536 or as solid archives (with the \fB--pack-streams\fR option) have varying levels
537 of compatibility with Microsoft's software.  The best compatibility is achieved
538 with WIMGAPI itelf (not ImageX or Dism) on Windows 8 or later.
539 .SH EXAMPLES
540 First example:  Create a new WIM 'mywim.wim' with "maximum" (LZX) compression
541 that will contain a captured image of the directory tree 'somedir'.  Note that
542 the image name need not be specified and will default to 'somedir':
543 .RS
544 .PP
545 @IMAGEX_PROGNAME@ capture somedir mywim.wim --compress=maximum
546 .RE
547 .PP
548 or, if the \fBwimcapture\fR hard link or batch file has been installed, the
549 abbreviated form can be used:
550 .RS
551 .PP
552 wimcapture somedir mywim.wim
553 .RE
554 .PP
555 The remaining examples will use the long form, however.  Next, append the image
556 of a different directory tree to the WIM created above:
557 .RS
558 .PP
559 @IMAGEX_PROGNAME@ append anotherdir mywim.wim
560 .RE
561 .PP
562 Easy enough, and the above examples of imaging directory trees work on both
563 UNIX-like systems and Windows.  Next, capture a WIM with several non-default
564 options, including "fast" (XPRESS) compression, an integrity table, no messing
565 with absolute symbolic links, and an image name and description:
566 .RS
567 .PP
568 @IMAGEX_PROGNAME@ capture somedir mywim.wim --compress=fast \\
569 .RS
570 --check --norpfix "Some Name" "Some Description"
571 .RE
572 .RE
573 .PP
574 Capture an entire NTFS volume into a new WIM file and name the image "Windows
575 7".  On UNIX-like systems, this requires using the special mode described in
576 \fBNTFS VOLUME CAPTURE (UNIX)\fR where \fISOURCE\fR is a file or block device
577 containing an NTFS filesystem:
578 .RS
579 .PP
580 @IMAGEX_PROGNAME@ capture /dev/sda2 windows7.wim "Windows 7"
581 .RE
582 .PP
583 or, on Windows, to capture a full NTFS volume you instead need to specify the
584 root directory of the mounted volume, for example:
585 .RS
586 .PP
587 @IMAGEX_PROGNAME@ capture E:\\ windows7.wim "Windows 7"
588 .RE
589 .PP
590 Same as above example with capturing an NTFS volume from \fB@IMAGEX_PROGNAME@\fR
591 running on a UNIX-like system, but capture the WIM in the wimlib-specific
592 "pipable" format that can be piped to \fB@IMAGEX_PROGNAME@ apply\fR:
593 .RS
594 .PP
595 @IMAGEX_PROGNAME@ capture /dev/sda2 windows7.wim "Windows 7" \\
596 .br
597 .RS
598 --pipable
599 .RE
600 .RE
601 .PP
602 Same as above, but instead of writing the pipable WIM to the file
603 "windows7.wim", write it directly to standard output through a pipe into some
604 other program "someprog", which could, for example, be a program or script that
605 streams the data to a server.  Note that \fB--pipable\fR need not be explicitly
606 specified when using standard output as the WIM "file":
607 .RS
608 .PP
609 @IMAGEX_PROGNAME@ capture /dev/sda2 - "Windows 7" | someprog
610 .RE
611 .SH SEE ALSO
612 .BR @IMAGEX_PROGNAME@ (1),
613 .BR @IMAGEX_PROGNAME@-apply (1)