]> wimlib.net Git - wimlib/blob - doc/imagex-capture.1.in
man page updates
[wimlib] / doc / imagex-capture.1.in
1 .TH IMAGEX "1" "March 2013" "imagex (wimlib) wimlib @VERSION@" "User Commands"
2 .SH NAME
3 imagex-capture, imagex-append \- Create or append a WIM image
4
5 .SH SYNOPSIS
6 \fBimagex capture\fR \fISOURCE\fR \fIWIMFILE\fR [\fIIMAGE_NAME\fR] \
7 [\fIDESCRIPTION\fR] [\fIOPTION\fR]...
8 .br
9 \fBimagex append\fR \fISOURCE\fR \fIWIMFILE\fR [\fIIMAGE_NAME\fR] \
10 [\fIDESCRIPTION\fR] [\fIOPTION\fR]...
11
12 .SH DESCRIPTION
13 .PP
14
15 The \fBimagex capture\fR and \fBimagex append\fR commands create a Windows
16 Imaging (WIM) image from a directory tree.  The \fBimagex capture\fR command
17 creates a new WIM file containing the captured image, while the \fBimagex
18 append\fR command appends the captured image to an existing WIM file.
19
20 A WIM image is an independent directory tree in the WIM file.  A WIM file may
21 contain any number of separate images.  However, files are stored only one time
22 in the entire WIM, regardless of how many images the file appears in.
23
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.  Alternatively, if \fISOURCE\fR is a regular file or block device, it
27 is interpreted as a NTFS volume from which a WIM image is to be captured.  Still
28 alternatively, if the \fB--source-list\fR option is given, \fISOURCE\fR is
29 interpreted as a file that itself provides a list of files and directories to
30 include in the new WIM image.
31
32 \fIIMAGE_NAME\fR and \fIDESCRIPTION\fR specify the name and description of the
33 new image.  If \fIIMAGE_NAME\fR is not given, it is taken to be the same as the
34 base name of \fISOURCE\fR.  If \fIDESCRIPTION\fR is not given, no description is
35 given to the new image.
36
37 .SH NORMAL MODE
38
39 The normal image capture mode is entered when \fISOURCE\fR specifies a
40 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
43 In this mode, the following information is captured from the directory tree:
44
45 .IP \[bu] 4
46 The "normal" name and contents of each file and directory
47 .IP \[bu]
48 File and directory creation, access, and modification timestamps to the nearest
49 100 nanoseconds, if supported by the underlying filesystem
50 .IP \[bu]
51 Hard links and symbolic links
52
53 .PP
54
55 However, in this mode, the following information is \fInot\fR captured from the
56 directory tree:
57
58 .IP \[bu] 4
59 File permissions.  The resulting WIM image will not contain any security
60 descriptors because the format of the security descriptors is Windows-specific,
61 and they cannot contain UNIX file modes.  (Exception: see the \fB--unix-data\fR
62 option.)
63
64 .IP \[bu]
65 No alternate data streams will be captured, since these do not exist on
66 POSIX-compliant filesystems.  The resulting WIM image will not contain any
67 alternate data streams.  (Exception: see the \fB--unix-data\fR option.)
68
69 .SH NTFS MODE
70
71 A special image capture mode is entered when \fISOURCE\fR is a regular file or
72 block device.  \fISOURCE\fR is interpreted as an NTFS volume and opened using
73 libntfs-3g.  If successful, a WIM image is captured containing the contents of
74 the NTFS volume, including NTFS-specific data.
75
76 Please note that the NTFS image capture mode is \fInot\fR entered if
77 \fISOURCE\fR is a directory, even if a NTFS filesystem is mounted on
78 \fISOURCE\fR.  You must specify the NTFS volume itself (and it must be
79 unmounted, and you must have permission to read from it).
80
81 More specifically, in this mode, the following types of information are captured
82 from the NTFS volume:
83
84 .IP \[bu] 4
85 All data streams of all files, including the un-named data stream as well as all
86 named data streams.
87 .IP \[bu]
88 Reparse points, including symbolic links, junction points, and other reparse
89 points.
90 .IP \[bu]
91 File and directory creation, access, and modification timestamps from NTFS
92 inodes (these have a resolution of 100 nanoseconds).
93 .IP \[bu]
94 The security descriptor for each NTFS inode.
95 .IP \[bu]
96 File attribute flags.
97 .IP \[bu]
98 All names of all files, including names in the Win32 namespace, DOS namespace,
99 Win32+DOS namespace, and POSIX namespace.  This includes hard links.
100
101 .SH SOURCE LIST MODE
102
103 Yet another capture mode is entered when the \fB--source-list\fR option is
104 given.  It is essentially an extension of the \fBNORMAL MODE\fR that allows
105 multiple files or directories to be incorporated into a WIM image using a single
106 \fBimagex capture\fR or \fBimagex append\fR command.  See the documentation for
107 \fB--source-list\fR below.
108
109 .SH OPTIONS
110 .TP 6
111 \fB--boot\fR
112 Specifies that the new image is to be made the bootable image of the WIM archive.
113 .TP
114 \fB--check\fR
115 Include an integrity table in the new WIM file or the modified WIM file.  If
116 this option is not specified, no integrity table is included in \fIWIMFILE\fR,
117 even if there was one before in the case of \fBimagex append\fR.
118 .TP
119 \fB--compress\fR=\fITYPE\fR
120 Specifies the compression type for the new WIM file.  This flag is only valid
121 for \fBimagex capture\fR, since the compression mode for \fBimagex append\fR
122 must be the same as that of the existing WIM.  \fITYPE\fR may be "none",
123 "maximum", or "fast".  By default, it is "fast".
124
125 You may also specify the actual names of the compression algorithms, "XPRESS"
126 and "LZX", instead of "fast" and "maximum", respectively.
127 .TP
128 \fB--threads\fR=\fINUM_THREADS\fR
129 Number of threads to use for compressing data.  Default: autodetect (number of
130 processors).  Note: if creating or appending to an uncompressed WIM, additional
131 threads will not be used, regardless of this parameter, since no compression
132 needs to be done in this case.
133 .TP
134 \fB--rebuild\fR
135 For \fBimagex append\fR: rebuild the entire WIM rather than appending the new
136 data to the end of it.  Rebuilding the WIM is slower, but will save a little bit
137 of space that would otherwise be left as a hole in the WIM.  Also see \fBimagex
138 optimize\fR.
139 .TP
140 \fB--flags\fR=\fIEDITIONID\fR
141 Specify a string to use in the <FLAGS> element of the XML data for the new
142 image.
143 .TP
144 \fB--verbose\fR
145 Print the names of files and directories as they are captured, as well as a few
146 other informational messages.
147 .TP
148 \fB--dereference\fR
149 Follow symlinks; archive and dump the files they point to.  (The default is to
150 archive the symlinks themselves.)  This flag is only valid in the normal image
151 capture mode.
152 .TP
153 \fB--config\fR=\fIFILE\fR
154 Specifies a configuration file for capturing the new image.  The configuration
155 file specifies files that are to be treated specially during the image capture.
156
157 The format of the configuration file is a number of sections containing file
158 globs one per line, where each section begins with the tag [ExclusionList],
159 [ExclusionException], [CompressionExclusionList], or [AlignmentList].
160 Currently, only the [ExclusionList] and [ExclusionException] sections are
161 implemented.  The [ExclusionList] section specifies a list of file globs to
162 exclude from capture, while the [ExclusionException] section specifies a list of
163 file globs to include in the capture even if the matched file or directory name
164 also appears in the [ExclusionList].
165
166 Relative globs with only one path component match against a filename in any
167 directory.  Relative globs with multiple path components, as well as absolute
168 globs, are treated as paths starting at the root directory of capture, or the
169 root of the NTFS volume for NTFS capture mode.  If a directory is matched by a
170 glob in the [ExclusionList], the entire directory tree rooted at that directory
171 is excluded from the capture, unless \fB--dereference\fR is specified and there
172 is another path into that directory through a symbolic link.
173
174 For compatibility with Windows, the path separators in the globs may be either
175 forward slashes or backslashes, and the line separators may be either UNIX-style
176 or DOS-style.  However, globs with spaces in them currently must not be quoted.
177 Empty lines are ignored.
178
179 If this option is not specified the following default configuration file is
180 used:
181
182 .RS
183 .RS
184 .PP
185 .nf
186 [ExclusionList]
187 \\$ntfs.log
188 \\hiberfil.sys
189 \\pagefile.sys
190 \\System Volume Information
191 \\RECYCLER
192 \\Windows\\CSC
193
194 [CompressionExclusionList]
195 *.mp3
196 *.zip
197 *.cab
198 \\WINDOWS\\inf\\*.pnf
199 .RE
200 .RE
201
202 .TP
203 \fB--unix-data\fR
204 Store the UNIX owner, group, and mode of regular files, symbolic links, and
205 directories.  This is done by adding a special alternate data stream to each
206 directory entry that contains this information.  Please note that this flag is
207 for convenience only, in case you want to use \fBimagex\fR to archive files on
208 UNIX.  Microsoft's software will not understand this special
209 information.
210 .TP
211 \fB--source-list\fR
212 \fBimagex capture\fR and \fBimagex append\fR, as of wimlib 1.2.7, support a new
213 option to create a WIM image from multiple files or directories.  When
214 \fB--source-list\fR is specified, the \fISOURCE\fR argument specifies the name
215 of a text file, each line of which is either 1 or 2 whitespace separated
216 filenames.  The first filename, the source, specifies the path to a file or
217 directory to capture into the WIM image.  It may be either absolute or relative
218 to the current working directory.  The second filename, if provided, is the
219 target and specifies the path  in the WIM image that this file or directory will
220 be saved as.  Leading and trailing slashes are ignored.  "/" indicates that
221 the directory is to become the root of the WIM image.  If not specified, the
222 target string defaults to the same as the source string.
223
224 An example is as follows:
225
226 .RS
227 .RS
228 .PP
229 .nf
230 # Make the WIM image from the 'winpe' directory
231 winpe   /
232
233 # Send the 'overlay' directory to '/overlay' in the WIM image
234 overlay /overlay
235
236 # Overlay a separate directory directly on the root of the WIM image.
237 # This is only legal if there are no conflicting files.
238 /data/stuff     /
239 .RE
240
241 Subdirectories in the WIM are created as needed.  Multiple source directories
242 may share the same target, which implies an overlay; however, an error is issued
243 if the same file appears in different overlays.
244
245 Filenames containing whitespace may be quoted with either single quotes or
246 double quotes.  Quotes may not be escaped.
247
248 Lines consisting only of whitespace and lines beginning with '#' preceded by
249 optional whitespace are ignored.
250
251 As a special case, if \fISOURCE\fR is "-", the source list is read from standard
252 input rather than an external file.
253
254 The NTFS capture mode cannot be used with \fB--source-list\fR, as only capturing
255 a full NTFS volume is supported.
256
257 .SH NOTES
258
259 \fBimage append\fR does not support appending an image to a split WIM.
260
261 The different capture modes only specify the data that is captured and don't
262 specify a special WIM format.  A WIM file can contain images captured using
263 different modes.  However, all images in a WIM must have the same compression
264 type, and \fBimagex\fR always enforces this.
265
266 \fBimagex\fR writes WIMs having the version number 0x10d00 and a compressed
267 stream chunk size of 32768.  The only WIMs I've seen that are different from
268 this are some pre-Vista WIMs that had a different version number.
269
270 Unless \fB--rebuild\fR is specified, aborting an \fBimagex append\fR command
271 mid-way through has a small chance of corrupting the WIM file.  However, a
272 precaution is taken against this, so it should be very unlikely.  In the event
273 of an aborted \fBimagex append\fR, \fBimagex optimize\fR may be run to remove
274 extra data that may have been partially appended to the physical WIM file but
275 not yet incorporated into the structure of the WIM.
276
277 Capturing or appending an image happens in two main phases: (1) scanning the
278 directory or NTFS volume to checksum all the files and determine the streams to
279 be written, and (2) writing the new streams to the WIM file.  Streams are not
280 stored in memory after (1), since there could easily be gigabytes of data;
281 instead, they are read again during step (2); however, duplicate streams in the
282 image, and streams already existing in any other image in the WIM, are not read
283 again.  In the future, it may be possible to introduce the ability to capture an
284 image with reading each file only one time, although this mode would have some
285 limitations--- for example, a stream might be compressed only to be thrown away
286 as a duplicate once it's been checksummed.
287
288 \fISOURCE\fR may be a symbolic link to a directory rather than a directory
289 itself.  However, additional symbolic links in subdirectories, or in additional
290 source directories not destined for the WIM image root (with
291 \fB--source-list\fR), are not dereferenced unless \fB--dereference\fR is
292 specified.
293
294 .SH EXAMPLES
295 Create a new WIM 'mywim.wim' from the directory 'somedir', using LZX compression and
296 including an integrity table:
297 .RS
298 .PP
299 imagex capture somedir mywim.wim --compress=maximum --check
300 .RE
301 .PP
302 Append an image to the WIM we just captured, but do it from a NTFS volume on the
303 partition /dev/sda2 and name the image "Windows 7".  You do not need to specify
304 the compression type, because the WIM already is using LZX compression and this
305 cannot be changed.  You need to specify \fB--check\fR if you don't want the
306 integrity table to be discarded.
307 .RS
308 .PP
309 imagex append /dev/sda2 mywim.wim --check "Windows 7"
310 .RE
311 .PP
312
313 .SH SEE ALSO
314 .BR imagex (1)
315