]> wimlib.net Git - wimlib/blob - doc/imagex-capture.1.in
mount_image.c: Implement versioned unmount messages
[wimlib] / doc / imagex-capture.1.in
1 .TH IMAGEX "1" "November 2012" "imagex (wimlib) wimlib @VERSION@" "User Commands"
2 .SH NAME
3 imagex-capture, imagex-append \- Capture a WIM image from a directory tree
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.  If \fISOURCE\fR is a regular file or block device, it is interpreted
27 as a NTFS volume from which a WIM image is to be captured.
28
29 \fIIMAGE_NAME\fR and \fIDESCRIPTION\fR specify the name and description of the
30 new image.  If \fIIMAGE_NAME\fR is not given, it is taken to be the same as the
31 base name of \fISOURCE\fR.  If \fIDESCRIPTION\fR is not given, no description is
32 given to the new image.
33
34 .SH NORMAL MODE
35
36 The normal image capture mode is entered when \fISOURCE\fR specifies a
37 directory.  The WIM image will be captured from the directory tree rooted at
38 this directory.  The directory may be on any type of filesystem.
39
40 In this normal image capture mode, we capture the following information from the
41 directory tree:
42
43 .IP \[bu] 4
44 The "normal" name and contents of each file and directory
45 .IP \[bu]
46 File and directory creation, access, and modification timestamps to the nearest
47 100 nanoseconds, if supported by the underlying filesystem
48 .IP \[bu]
49 Hard links and symbolic links
50
51 .PP
52
53 However, in the normal image capture mode, we do \fInot\fR capture the following
54 information from the directory tree:
55
56 .IP \[bu] 4
57 File permissions.  The resulting WIM image will not contain any security
58 descriptors because the format of the security descriptors is Windows-specific,
59 and they cannot contain UNIX file modes.
60 .IP \[bu]
61 No alternate data streams will be captured, since these do not exist on
62 POSIX-compliant filesystems.  The resulting WIM image will not contain any
63 alternate data streams.
64
65 .SH NTFS MODE
66
67 A special image capture mode is entered when \fISOURCE\fR is a regular file or
68 block device.  \fISOURCE\fR is interpreted as an NTFS volume and opened using
69 libntfs-3g.  If successful, a WIM image is captured containing the contents of
70 the NTFS volume, including NTFS-specific data.
71
72 Please note that the NTFS image capture mode is \fInot\fR entered if
73 \fISOURCE\fR is a directory, even if a NTFS filesystem is mounted on
74 \fISOURCE\fR.  You must specify the NTFS volume itself (and it must be
75 unmounted, and you must have permission to read from it).
76
77 More specifically, in this mode, we capture the following types of information
78 from the NTFS volume:
79
80 .IP \[bu] 4
81 All data streams of all files, including the un-named data stream as well as all
82 named data streams.
83 .IP \[bu]
84 Reparse points, including symbolic links, junction points, and other reparse
85 points.
86 .IP \[bu]
87 File and directory creation, access, and modification timestamps from NTFS
88 inodes (these have a resolution of 100 nanoseconds).
89 .IP \[bu]
90 The security descriptor for each NTFS inode.
91 .IP \[bu]
92 File attribute flags.
93 .IP \[bu]
94 All names of all files, including names in the Win32 namespace, DOS namespace,
95 Win32+DOS namespace, and POSIX namespace.  This includes hard links.
96
97 .SH OPTIONS
98 .TP 6
99 \fB--boot\fR
100 Specifies that the new image is to be made the bootable image of the WIM archive.
101 .TP
102 \fB--check\fR
103 Include an integrity table in the new WIM file or the modified WIM file.  If
104 this option is not specified, no integrity table is included in \fIWIMFILE\fR,
105 even if there was one before in the case of \fBimagex append\fR.
106 .TP
107 \fB--compress\fR=\fITYPE\fR
108 Specifies the compression type for the new WIM file.  This flag is only valid
109 for \fBimagex capture\fR, since the compression mode for \fBimagex append\fR
110 must be the same as that of the existing WIM.  \fITYPE\fR may be "none",
111 "maximum", or "fast".  By default, it is "fast".
112
113 You may also specify the actual names of the compression algorithms, "XPRESS"
114 and "LZX", instead of "fast" and "maximum", respectively.
115 .TP
116 \fB--threads\fR=\fINUM_THREADS\fR
117 Number of threads to use for compressing data.  Default: autodetect (number of
118 processors).  Note: if creating or appending to an uncompressed WIM, additional
119 threads will not be used, regardless of this parameter, since no compression
120 needs to be done in this case.
121 .TP
122 \fB--rebuild\fR
123 For \fBimagex append\fR: rebuild the entire WIM rather than appending the new
124 data to the end of it.  Rebuilding the WIM is slower, but will save a little bit
125 of space that would otherwise be left as a hole in the WIM.  Also see \fBimagex
126 optimize\fR.
127 .TP
128 \fB--flags\fR=\fIEDITIONID\fR
129 Specify a string to use in the <FLAGS> element of the XML data for the new
130 image.
131 .TP
132 \fB--verbose\fR
133 Print the names of files and directories as they are captured, as well as a few
134 other informational messages.
135 .TP
136 \fB--dereference\fR
137 Follow symlinks; archive and dump the files they point to.  (The default is to
138 archive the symlinks themselves.)  This flag is only valid in the normal image
139 capture mode.
140 .TP
141 \fB--config\fR=\fIFILE\fR
142 Specifies a configuration file for capturing the new image.  The configuration
143 file specifies files that are to be treated specially during the image capture.
144
145 The format of the configuration file is a number of sections containing file
146 globs one per line, where each section begins with the tag [ExclusionList],
147 [ExclusionException], [CompressionExclusionList], or [AlignmentList].
148 Currently, only the [ExclusionList] and [ExclusionException] sections are
149 implemented.  The [ExclusionList] section specifies a list of file globs to
150 exclude from capture, while the [ExclusionException] section specifies a list of
151 file globs to include in the capture even if the matched file or directory name
152 also appears in the [ExclusionList].
153
154 Relative globs with only one path component match against a filename in any
155 directory.  Relative globs with multiple path components, as well as absolute
156 globs, are treated as paths starting at the root directory of capture, or the
157 root of the NTFS volume for NTFS capture mode.  If a directory is matched by a
158 glob in the [ExclusionList], the entire directory tree rooted at that directory
159 is excluded from the capture, unless \fB--dereference\fR is specified and there
160 is another path into that directory through a symbolic link.
161
162 For compatibility with Windows, the path separators in the globs may be either
163 forward slashes or backslashes, and the line separators may be either UNIX-style
164 or DOS-style.  However, globs with spaces in them currently must not be quoted.
165 Empty lines are ignored.
166
167 If this option is not specified the following default configuration file is
168 used:
169
170 .RS
171 .RS
172 .PP
173 .nf
174 [ExclusionList]
175 \\$ntfs.log
176 \\hiberfil.sys
177 \\pagefile.sys
178 \\System Volume Information
179 \\RECYCLER
180 \\Windows\\CSC
181
182 [CompressionExclusionList]
183 *.mp3
184 *.zip
185 *.cab
186 \\WINDOWS\\inf\\*.pnf
187 .RE
188 .RE
189
190 .SH NOTES
191
192 \fBimage append\fR does not support appending an image to a split WIM.
193
194 The two different capture modes only specify the data that is captured and don't
195 specify a special WIM format.  A WIM file can contain images captured using
196 different modes.  However, all images in a WIM must have the same compression
197 type, and \fBimagex\fR always enforces this.
198
199 \fBimagex\fR writes WIMs having the version number 0x10d00 and a compressed
200 stream chunk size of 32768.  The only WIMs I've seen that are different from
201 this are some pre-Vista WIMs that had a different version number.
202
203 Unless \fB--rebuild\fR is specified, aborting an \fBimagex append\fR command
204 mid-way through has a small chance of corrupting the WIM file.  However, a
205 precaution is taken against this, so it should be very unlikely.  In the event
206 of an aborted \fBimagex append\fR, \fBimagex optimize\fR may be run to remove
207 extra data that may have been partially appended to the physical WIM file but
208 not yet incorporated into the structure of the WIM.
209
210 Capturing or appending an image happens in two main phases: (1) scanning the
211 directory or NTFS volume to checksum all the files and determine the streams to
212 be written, and (2) writing the new streams to the WIM file.  Streams are not
213 stored in memory after (1), since there could easily be gigabytes of data;
214 instead, they are read again during step (2); however, duplicate streams in the
215 image, and streams already existing in any other image in the WIM, are not read
216 again.  In the future, it may be possible to introduce the ability to capture an
217 image with reading each file only one time, although this mode would have some
218 limitations--- for example, a stream might be compressed only to be thrown away
219 as a duplicate once it's been checksummed.
220
221 .SH EXAMPLES
222 Create a new WIM 'mywim.wim' from the directory 'somedir', using LZX compression and
223 including an integrity table:
224 .RS
225 .PP
226 imagex capture somedir mywim.wim --compress=maximum --check
227 .RE
228 .PP
229 Append an image to the WIM we just captured, but do it from a NTFS volume on the
230 partition /dev/sda2, and name the image "Windows 7" and give it a description.
231 You do not need to specify the compression type, because the WIM already is
232 using LZX compression and this cannot be changed.  You need to specify --check
233 if you don't want the integrity table to be discarded.
234 .RS
235 .PP
236 imagex append /dev/sda2 mywim.wim --check "Windows 7" "Warning: This operating
237 system has been approved by Bill Gates"
238 .RE
239 .PP
240
241 .SH SEE ALSO
242 .BR imagex (1)
243