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