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