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