]> wimlib.net Git - wimlib/blob - doc/man1/wimoptimize.1
v1.11.0
[wimlib] / doc / man1 / wimoptimize.1
1 .TH WIMOPTIMIZE "1" "January 2017" "wimlib 1.11.0" "User Commands"
2 .SH NAME
3 wimoptimize \- Optimize a WIM archive
4 .SH SYNOPSIS
5 \fBwimoptimize\fR \fIWIMFILE\fR [\fIOPTION\fR...]
6 .SH DESCRIPTION
7 \fBwimoptimize\fR, or equivalently \fBwimlib-imagex optimize\fR, rebuilds the
8 standalone WIM archive \fIWIMFILE\fR.  The new WIM is written to a temporary
9 file, and it is renamed to the original file when it's ready.  This will remove
10 any holes that have been left in the WIM as a result of appending or deleting
11 files or images, so the new WIM may be smaller than the old WIM.
12 .PP
13 By default, \fBwimoptimize\fR will reuse (not recompress) compressed data and
14 will not change the solid or pipable status of the WIM.  However, it can also
15 perform recompression and/or convert between solid, non-solid, pipable, and
16 non-pipable WIMs; see the options and examples below.
17 .SH OPTIONS
18 .TP 6
19 \fB--check\fR
20 Before optimizing the WIM, verify its integrity if it contains extra integrity
21 information.  Also include extra integrity information in the optimized WIM,
22 even if it was not present before.
23 .TP
24 \fB--nocheck\fR
25 Do not include extra integrity information in the optimized WIM, even if it was
26 present before.
27 .TP
28 \fB--recompress\fR
29 Recompress all data in the WIM while optimizing it.  This will significantly
30 increase the time needed to optimize the WIM, but it may result in a better
31 compression ratio if wimlib can do a better job than the program that created
32 the WIM --- which is likely the case if the WIM was Microsoft-created, as
33 wimlib's compressors are slightly stronger.
34 .TP
35 \fB--compress\fR=\fITYPE\fR[:\fILEVEL\fR]
36 Recompress the WIM using the specified compression type, and optionally the
37 specified compression level for that compression type.  This implies
38 \fB--recompress\fR.  See the documentation for this option to
39 \fBwimcapture\fR(1) for more details.
40 .TP
41 \fB--chunk-size\fR=\fISIZE\fR
42 Set the WIM compression chunk size to \fISIZE\fR.  See the documentation for
43 this option to \fBwimcapture\fR(1) for more details.
44 .TP
45 \fB--solid\fR
46 Create a "solid" archive that compresses multiple files together.  This usually
47 results in a significantly better compression ratio but has disadvantages such
48 as reduced compatibility.  See the documentation for this option to
49 \fBwimcapture\fR(1) for more details.
50 .TP
51 \fB--solid-compress\fR=\fITYPE\fR[:\fILEVEL\fR]
52 Like \fB--compress\fR, but set the compression type used in solid resources.
53 See the documentation for this option to \fBwimcapture\fR(1) for more details.
54 .TP
55 \fB--solid-chunk-size\fR=\fISIZE\fR
56 Like \fB--chunk-size\fR, but set the chunk size used in solid resources.  See
57 the documentation for this option to \fBwimcapture\fR(1) for more details.
58 .TP
59 \fB--threads\fR=\fINUM_THREADS\fR
60 Number of threads to use for compressing data.  Default: autodetect (number of
61 processors).
62 .TP
63 \fB--pipable\fR
64 Rebuild the WIM so that it can be applied fully sequentially, including from a
65 pipe.  See \fBwimcapture\fR(1) for more details about creating pipable WIMs.  By
66 default, when neither \fB--pipable\fR or \fB--not-pipable\fR is specified, the
67 optimized WIM will be pipable if and only if it was pipable before.
68 .TP
69 \fB--not-pipable\fR
70 Rebuild the WIM in the non-pipable format.
71 .TP
72 \fB--unsafe-compact\fR
73 Compact the WIM in-place, without using a temporary file.  Existing resources
74 are shifted down to fill holes and new resources are appended as needed.  The
75 WIM is truncated to its final size, which may shrink the on-disk file.  This is
76 more efficient than a full rebuild, but it is only supported when no
77 recompression is being done.  More importantly, AN UNSAFE COMPACTION OPERATION
78 CANNOT BE SAFELY INTERRUPTED!  If the operation is interrupted, then the WIM
79 will be corrupted, and it may be impossible (or at least very difficult) to
80 recover any data from it.  Users of this option are expected to know what they
81 are doing and assume responsibility for any data corruption that may result.
82 .SH NOTES
83 \fBwimoptimize\fR does not support split WIMs or delta WIMs.  For such files,
84 consider using \fBwimexport\fR(1) instead.  Note that \fBwimoptimize\fR is
85 roughly equivalent to:
86 .RS
87 .PP
88 \fBwimexport\fR \fIWIMFILE\fR all tmp.wim && mv tmp.wim \fIWIMFILE\fR
89 .RE
90 .PP
91 .SH EXAMPLES
92 Rebuild 'install.wim':
93 .RS
94 .PP
95 wimoptimize install.wim
96 .RE
97 .PP
98 Rebuild and recompress 'install.wim':
99 .RS
100 .PP
101 wimoptimize install.wim --recompress
102 .RE
103 .PP
104 Rebuild and recompress 'install.wim' using LZX ("maximum") compression at a
105 higher-than-default compression level.  The compression chunk size remains
106 unchanged.  This command will be slow, but it might be useful for optimizing
107 files for distribution.  See \fIhttps://wimlib.net/compression.html\fR for some
108 benchmark results.
109 .RS
110 .PP
111 wimoptimize install.wim --compress=LZX:100
112 .RE
113 .PP
114 Recompress 'install.wim' using solid-mode compression, then rename it to
115 \'install.esd\'.  This will decrease the archive size significantly.  (Also
116 consider using 'wimexport install.wim all install.esd --solid'.):
117 .RS
118 .PP
119 wimoptimize install.wim --solid
120 .br
121 mv install.wim install.esd
122 .RE
123 .SH SEE ALSO
124 .BR wimlib-imagex (1)
125 .BR wimexport (1)
126 .BR wimverify (1)