]> wimlib.net Git - wimlib/blob - doc/imagex-capture.1.in
cb651651d69c37349fb0434985e9cb74aad6b563
[wimlib] / doc / imagex-capture.1.in
1 .TH IMAGEX "1" "August 2013" "@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 .PP
17 A WIM image is an independent directory tree in the WIM file.  A WIM file may
18 contain any number of separate images.  However, files are stored only one time
19 in the entire WIM, regardless of how many images the file appears in.
20 .PP
21 \fISOURCE\fR specifies the location of the files to create the new WIM image
22 from.  If \fISOURCE\fR is a directory, the WIM image is captured from that
23 directory.   Alternatively, if the \fB--source-list\fR option is given,
24 \fISOURCE\fR is interpreted as a file that itself provides a list of
25 files and directories to include in the new WIM image.  Still
26 alternatively, only on UNIX builds of wimlib, if \fISOURCE\fR is a
27 regular file or block device, it is interpreted as an NTFS volume from
28 which a WIM image is to be captured. 
29 .PP
30 \fIIMAGE_NAME\fR and \fIIMAGE_DESCRIPTION\fR specify the name and description of
31 the new image.  If \fIIMAGE_NAME\fR is not given, it is taken to be the same as
32 the base name of \fISOURCE\fR.  If \fIIMAGE_DESCRIPTION\fR is not given, no
33 description is given to the new image.
34 .PP
35 As a special case, if \fIWIMFILE\fR is "-", the \fB--pipable\fR option is
36 assumed and the WIM file is written to standard output in a special pipable
37 format.   See the documentation for \fB--pipable\fR for more details.
38 .SH NORMAL MODE (UNIX)
39 This section documents how files are captured from a directory on UNIX.  See
40 \fBWINDOWS VERSION\fR for the corresponding documentation for the Windows
41 version.
42 .PP
43 On UNIX, the "normal" image capture mode is entered when \fISOURCE\fR specifies
44 a directory.  The WIM image will be captured from the directory tree rooted at
45 this directory.  The directory may be on any type of filesystem.
46 .PP
47 In this mode, the following information is captured from the directory tree:
48 .IP \[bu] 4
49 The "normal" name and contents of each file and directory
50 .IP \[bu]
51 File and directory creation, access, and modification timestamps to the nearest
52 100 nanoseconds, if supported by the underlying filesystem
53 .IP \[bu]
54 Hard links and symbolic links
55 .PP
56 However, in this mode, the following information is \fInot\fR captured from the
57 directory tree:
58 .IP \[bu] 4
59 UNIX file owners, groups, and modes.  The resulting WIM image will contain no
60 security information (file permissions).  (Exception: see the \fB--unix-data\fR
61 option.)
62 .IP \[bu]
63 Extended attributes.
64 .SH NTFS MODE (UNIX)
65 This section documents how files are captured from an NTFS volume image on UNIX.
66 See \fBWINDOWS VERSION\fR for the corresponding documentation for the Windows
67 version.
68 .PP
69 On UNIX, a special image capture mode is entered when \fISOURCE\fR is a regular
70 file or block device.  \fISOURCE\fR is interpreted as an NTFS volume and opened
71 using libntfs-3g.  If successful, a WIM image is captured containing the
72 contents of the NTFS volume, including NTFS-specific data.
73 .PP
74 Please note that the NTFS image capture mode is \fInot\fR entered if
75 \fISOURCE\fR is a directory, even if an NTFS filesystem is mounted on
76 \fISOURCE\fR.  You must specify the NTFS volume itself (and it must be
77 unmounted, and you must have permission to read from it).
78 .PP
79 More specifically, in this mode, the following types of information are captured
80 from the NTFS volume:
81 .IP \[bu] 4
82 All data streams of all files, including the un-named data stream as well as all
83 named data streams.
84 .IP \[bu]
85 Reparse points, including symbolic links, junction points, and other reparse
86 points.
87 .IP \[bu]
88 File and directory creation, access, and modification timestamps from NTFS
89 inodes (these have a resolution of 100 nanoseconds).
90 .IP \[bu]
91 The security descriptor for each NTFS inode.
92 .IP \[bu]
93 File attribute flags.
94 .IP \[bu]
95 All names of all files, including names in the Win32 namespace, DOS namespace,
96 Win32+DOS namespace, and POSIX namespace.  This includes hard links.
97 .SH WINDOWS VERSION
98 The Windows versions of \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@
99 append\fR act similarly to the corresponding commands of Microsoft's ImageX.
100 For best results, the directory being captured should be on an NTFS volume and
101 you should be running with Administrator privileges; however, non-NTFS
102 filesystems and running without Administrator privileges are also supported.
103 .PP
104 On Windows, \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR
105 try to archive as much data as possible.  This includes:
106 .IP \[bu] 4
107 All data streams of all files.  This includes the default file contents, as well
108 as named data streams if supported by the filesystem and if the version of
109 Windows is Vista or later.
110 .IP \[bu]
111 Reparse points, including symbolic links, junction points, and other reparse
112 points, if supported by the underlying filesystem.  (Note: see
113 \fB--rpfix\fR and \fB--norpfix\fR for documentation on how absolute symbolic
114 links and junctions are captured.)
115 .IP \[bu]
116 File and directory creation, access, and modification timestamps to the nearest
117 100 nanoseconds.
118 .IP \[bu]
119 Security descriptors, if supported by the filesystem and \fB--no-acls\fR is not
120 specified.  Furthermore, unless \fB--strict-acls\fR is specified, the security
121 descriptor for individual files or directories may be omitted or only partially
122 captured if the user does not have permission to read them.
123 .IP \[bu]
124 File attributes, including hidden, sparse, compressed, encrypted, etc.
125 Encrypted files will be stored in encrypted form rather than in plain text.
126 .IP \[bu]
127 DOS names (8.3) names of files; however, the failure to read them is not
128 considered an error condition.
129 .IP \[bu]
130 Hard links, excluding directory hard links (which aren't supposed to exist
131 anyway).
132 .SH OPTIONS
133 .TP 6
134 \fB--boot\fR
135 Specifies that the new image is to be made the bootable image of the WIM archive.
136 .TP
137 \fB--check\fR
138 For \fB@IMAGEX_PROGNAME@ append\fR, check the integrity of \fIWIMFILE\fR if an
139 integrity was present.  Furthermore, include an integrity table in the new WIM
140 file (\fB@IMAGEX_PROGNAME@ capture\fR) or the modified WIM file
141 (\fB@IMAGEX_PROGNAME@ append\fR).  If this option is not specified, no integrity
142 table is included in a WIM file created with \fB@IMAGEX_PROGNAME@ capture\fR,
143 while a WIM file updated with \fB@IMAGEX_PROGNAME@ append\fR will be written
144 with an integrity table if and only if one was present before.
145 .TP
146 \fB--compress\fR=\fITYPE\fR
147 Specifies the compression type for the new WIM file.  This flag is only valid
148 for \fB@IMAGEX_PROGNAME@ capture\fR, since the compression mode for
149 \fB@IMAGEX_PROGNAME@ append\fR must be the same as that of the existing WIM.
150 \fITYPE\fR may be "none", "maximum", or "fast".  By default, it is "fast".
151 .IP ""
152 You may also specify the actual names of the compression algorithms, "XPRESS"
153 and "LZX", instead of "fast" and "maximum", respectively.
154 .TP
155 \fB--threads\fR=\fINUM_THREADS\fR
156 Number of threads to use for compressing data.  Default: autodetect (number of
157 processors).  Note: if creating or appending to an uncompressed WIM, additional
158 threads will not be used, regardless of this parameter, since no compression
159 needs to be done in this case.
160 .TP
161 \fB--rebuild\fR
162 For \fB@IMAGEX_PROGNAME@ append\fR: rebuild the entire WIM rather than appending the new
163 data to the end of it.  Rebuilding the WIM is slower, but will save a little bit
164 of space that would otherwise be left as a hole in the WIM.  Also see \fB@IMAGEX_PROGNAME@
165 optimize\fR.
166 .TP
167 \fB--flags\fR=\fIEDITIONID\fR
168 Specify a string to use in the <FLAGS> element of the XML data for the new
169 image.
170 .TP
171 \fB--verbose\fR
172 Print the names of files and directories as they are captured.
173 .TP
174 \fB--dereference\fR
175 (UNIX only) Follow symbolic links and archive the files they point to, rather
176 than archiving the links themselves.
177 .TP
178 \fB--config\fR=\fIFILE\fR
179 Specifies a configuration file for capturing the new image.  The configuration
180 file specifies files that are to be treated specially during the image capture.
181 .IP ""
182 The format of the configuration file is a number of sections containing path
183 globs one per line, where each section begins with the tag [ExclusionList],
184 [ExclusionException], [CompressionExclusionList], or [AlignmentList].
185 Currently, only the [ExclusionList] and [ExclusionException] sections are
186 implemented.  The [ExclusionList] section specifies a list of path globs to
187 exclude from capture, while the [ExclusionException] section specifies a list of
188 path globs to include in the capture even if the matched file or directory name
189 also appears in the [ExclusionList].
190 .IP ""
191 Relative globs with only one path component (e.g. *.mp3) match against a filename in any
192 directory.  Relative globs with multiple path components (e.g. dir/file),
193 as well as absolute globs (e.g. /dir/file), are treated as paths starting at the
194 root directory of capture, or the root of the NTFS volume for NTFS capture mode.
195 If a directory is matched by a glob in the [ExclusionList], the entire directory
196 tree rooted at that directory is excluded from the capture, unless
197 \fB--dereference\fR is specified and there is another path into that directory
198 through a symbolic link.
199 .IP ""
200 For compatibility with Windows, the path separators in the globs may be either
201 forward slashes or backslashes, and the line separators may be either UNIX-style
202 or DOS-style.  Globs with spaces in them must be quoted, and leading and
203 trailing whitespace is not significant.  Empty lines and lines beginning with
204 \'#' or whitespace followed by '#' are ignored.
205 .IP ""
206 Paths may not have drive letters in them, as they are all relative to the root
207 of capture and not absolute external paths.
208 .IP ""
209 If this option is not specified the following default configuration file is
210 used:
211 .IP ""
212 .RS
213 .RS
214 .nf
215 [ExclusionList]
216 \\$ntfs.log
217 \\hiberfil.sys
218 \\pagefile.sys
219 "\\System Volume Information"
220 \\RECYCLER
221 \\Windows\\CSC
222 .RE
223 .RE
224 .fi
225 .TP
226 \fB--unix-data\fR
227 (UNIX only) Store the UNIX owner, group, and mode of all captured files.  This
228 is done by adding a special alternate data stream to each directory entry that
229 contains this information.  Please note that this flag is for convenience only,
230 in case you want to use \fB@IMAGEX_PROGNAME@\fR to archive files on UNIX.
231 Microsoft's software will not understand this special information.  You also may
232 run into problems when applying an image with UNIX data from a pipable WIM.
233 .TP
234 \fB--no-acls\fR
235 Do not capture files' security descriptors.  This option is available in the
236 Windows version, as well as on UNIX in NTFS capture mode.
237 .TP
238 \fB--strict-acls\fR
239 (Windows only) Fail immediately if the full security descriptor of any file
240 cannot be read.  The default behavior without this option is to first try
241 omitting the SACL from the security descriptor, then to try omitting the
242 security descriptor entirely.  The purpose of this is to capture as much data as
243 possible without always requiring Administrator privileges.  However, if you
244 desire that all security descriptors be captured exactly, you may wish to
245 provide this option, although the Administrator should have permission to read
246 everything anyway.
247 .TP
248 \fB--rpfix\fR, \fB--norpfix\fR
249 Set whether to fix targets of absolute symbolic links (reparse points in Windows
250 terminology) or not.  When enabled (\fB--rpfix\fR), absolute symbolic links that
251 point inside the directory tree being captured will be adjusted to be absolute
252 relative to the root of the directory tree being captured.  In addition,
253 absolute symbolic links that point outside the directory tree being captured
254 will be ignored and not be captured at all.  When disabled (\fB--norpfix\fR),
255 absolute symbolic links will be captured exactly as is.
256 .IP ""
257 The default behavior for \fB@IMAGEX_PROGNAME@ capture\fR is equivalent to
258 \fB--rpfix\fR.  The default behavior for \fB@IMAGEX_PROGNAME@ append\fR will be
259 \fB--rpfix\fR if reparse point fixups have previously been done on
260 \fIWIMFILE\fR, otherwise \fB--norpfix\fR.
261 .IP ""
262 In the case of a multi-source capture, (\fB--source-list\fR specified), passing
263 \fB--norpfix\fR is recommended.  Otherwise, reparse point fixups will be
264 disabled on all capture sources destined for non-root locations in the WIM
265 image, while capture sources destined for the WIM root will get the default
266 behavior from the previous paragraph.
267 .TP
268 \fB--source-list\fR
269 \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR support
270 creating a WIM image from multiple files or directories.  When
271 \fB--source-list\fR is specified, the \fISOURCE\fR argument specifies the name
272 of a text file, each line of which is either 1 or 2 whitespace separated file
273 paths.  The first file path, the source, specifies the path to a file or
274 directory to capture into the WIM image.  It may be either absolute or relative
275 to the current working directory.  The second file path, if provided, is the
276 target and specifies the path  in the WIM image that this file or directory will
277 be saved as.  Leading and trailing slashes are ignored.  "/" indicates that the
278 directory is to become the root of the WIM image.  If not specified, the target
279 string defaults to the same as the source string.
280 .IP ""
281 An example source list file is as follows:
282 .IP ""
283 .RS
284 .nf
285 # Make the WIM image from the 'winpe' directory
286 winpe   /
287
288 # Send the 'overlay' directory to '/overlay' in the WIM image
289 overlay /overlay
290
291 # Overlay a separate directory directly on the root of the WIM image.
292 # This is only legal if there are no conflicting files.
293 /data/stuff     /
294 .RE
295 .fi
296 .IP ""
297 Subdirectories in the WIM are created as needed.  Multiple source directories
298 may share the same target, which implies an overlay; however, an error is issued
299 if the same file appears in different overlays to the same directory.
300 .IP ""
301 File paths containing whitespace may be quoted with either single quotes or
302 double quotes.  Quotes may not be escaped.
303 .IP ""
304 Lines consisting only of whitespace and lines beginning with '#' preceded by
305 optional whitespace are ignored.
306 .IP ""
307 As a special case, if \fISOURCE\fR is "-", the source list is read from standard
308 input rather than an external file.
309 .IP ""
310 The NTFS capture mode cannot be used with \fB--source-list\fR, as only capturing
311 a full NTFS volume is supported.
312 .TP
313 \fB--pipable\fR
314 Create a "pipable" WIM, which can be applied fully sequentially, including from
315 a pipe.  An image in the resulting WIM can be applied with \fB@IMAGEX_PROGNAME@
316 apply\fR, either normally by specifying the WIM file name, or with
317 \fB@IMAGEX_PROGNAME@ apply -\fR to read the WIM from standard input.  See
318 \fB@IMAGEX_PROGNAME@ apply\fR(1) for more details.
319 .IP ""
320 For append operations, this option will result in a full rebuild of the WIM to
321 make it pipable.  For capture operations, the captured WIM is simply created as
322 pipable.  Beware that the more images you add to a pipable WIM, the less
323 efficient piping it will be, since more unneeded data will be sent through the
324 pipe.
325 .IP ""
326 When wimlib creates a pipable WIM, it carefully re-arranges the components of
327 the WIM so that they can be read sequentially, and also makes several other
328 modifications.  As a result, these "pipable" WIMs are \fInot compatible with
329 Microsoft's software\fR, so keep this in mind if you're going to use them.  If
330 desired, you can use \fB@IMAGEX_PROGNAME@ optimize --not-pipable\fR to re-write
331 a pipable WIM as a regular WIM.  (\fB@IMAGEX_PROGNAME@ export\fR also provides
332 the capability to export images from a pipable WIM into a non-pipable WIM, or
333 vice versa.)
334 .IP ""
335 For the most part, wimlib operates on pipable WIMs transparently.  You can
336 modify them, add or delete images, export images, and even create split pipable
337 WIMs.  The main disadvantages are that appending is (currently) less efficient,
338 and also they aren't compatible with Microsoft's software.
339 .IP ""
340 \fB@IMAGEX_PROGNAME@ capture\fR and \fB@IMAGEX_PROGNAME@ append\fR can both
341 write a pipable WIM directly to standard output; this is done automatically if
342 \fIWIMFILE\fR is specified as "-".  (In that case, \fB--pipable\fR is assumed.)
343 .TP
344 \fB--not-pipable\fR
345 Ensure the resulting WIM is in the normal, non-pipable WIM format.  This is the
346 default for \fB@IMAGEX_PROGNAME@ capture\fR, except when writing to standard
347 output, and for \fB@IMAGEX_PROGNAME@ append\fR, except when appending to a WIM
348 that is already pipable.
349 .SH NOTES
350 \fB@IMAGEX_PROGNAME@ append\fR does not support appending an image to a split WIM.
351 .PP
352 The different capture modes only specify the data that is captured and don't
353 specify a special WIM format.  A WIM file can contain images captured using
354 different modes.  However, all images in a WIM must have the same compression
355 type, and \fB@IMAGEX_PROGNAME@\fR always enforces this.
356 .PP
357 \fB@IMAGEX_PROGNAME@\fR writes WIMs having the version number 0x10d00 and a
358 compressed stream chunk size of 32768.  The only WIMs I've seen that are
359 different from this are some pre-Vista WIMs that had a different version number.
360 .PP
361 It is safe to abort an \fB@IMAGEX_PROGNAME@ append\fR command partway through;
362 however, after doing this, it is recommended to run \fB@IMAGEX_PROGNAME@
363 optimize\fR to remove any data that was appended to the physical WIM file but
364 not yet incorporated into the structure of the WIM, unless \fB--rebuild\fR was
365 specified, in which case you should delete the temporary file left over.
366 .PP
367 \fISOURCE\fR may be a symbolic link to a directory rather than a directory
368 itself.  However, additional symbolic links in subdirectories, or in additional
369 source directories not destined for the WIM image root (with
370 \fB--source-list\fR), are not dereferenced unless \fB--dereference\fR is
371 specified.
372 .PP
373 With the UNIX version of \fB@IMAGEX_PROGNAME@\fR, it is possible to create a WIM
374 image containing files with names differing only in case, or files with names
375 containing the characters ':', '*', '?', '"', '<', '>', '|', or '\\', which are
376 valid on POSIX-compliant filesystems but not Windows.  Be warned that such files
377 will not be extracted by default by the Windows version of
378 \fB@IMAGEX_PROGNAME@\fR, and Microsoft's ImageX might get confused by such
379 names.
380 .SH EXAMPLES
381 Create a new WIM 'mywim.wim' from the directory 'somedir', using LZX compression and
382 including an integrity table:
383 .RS
384 .PP
385 @IMAGEX_PROGNAME@ capture somedir mywim.wim --compress=maximum --check
386 .RE
387 .PP
388 Append an image to the WIM we just captured, but do it from an NTFS volume on the
389 partition /dev/sda2 and name the image "Windows 7".  You do not need to specify
390 the compression type, because the WIM already is using LZX compression and this
391 cannot be changed.  You need to specify \fB--check\fR if you don't want the
392 integrity table to be discarded.
393 .RS
394 .PP
395 @IMAGEX_PROGNAME@ append /dev/sda2 mywim.wim --check "Windows 7"
396 .RE
397 .PP
398 Capture a WIM from a NTFS volume and write it directly to standard output, using
399 the wimlib-specific pipable WIM format:
400 .RS
401 .PP
402 @IMAGEX_PROGNAME@ capture /dev/sda1 -
403 .RE
404 .PP
405 .SH SEE ALSO
406 .BR @IMAGEX_PROGNAME@ (1)