1WIMOPTIMIZE(1) User Commands WIMOPTIMIZE(1)
2
3
4
6 wimoptimize - Optimize a WIM archive
7
9 wimoptimize WIMFILE [OPTION...]
10
12 wimoptimize, or equivalently wimlib-imagex optimize, rebuilds the
13 standalone WIM archive WIMFILE. The new WIM is written to a temporary
14 file, and it is renamed to the original file when it's ready. This
15 will remove any holes that have been left in the WIM as a result of ap‐
16 pending or deleting files or images, so the new WIM may be smaller than
17 the old WIM.
18
19 By default, wimoptimize will reuse (not recompress) compressed data and
20 will not change the solid or pipable status of the WIM. However, it
21 can also perform recompression and/or convert between solid, non-solid,
22 pipable, and non-pipable WIMs; see the options and examples below.
23
25 --check
26 Before optimizing the WIM, verify its integrity if it contains
27 extra integrity information. Also include extra integrity infor‐
28 mation in the optimized WIM, even if it was not present before.
29
30 --nocheck
31 Do not include extra integrity information in the optimized WIM,
32 even if it was present before.
33
34 --include-integrity
35 Include extra integrity information in the optimized WIM, i.e.
36 like --check but don't also verify the WIM beforehand.
37
38 --recompress
39 Recompress all data in the WIM while optimizing it. This will
40 significantly increase the time needed to optimize the WIM, but
41 it may result in a better compression ratio if wimlib can do a
42 better job than the program that created the WIM --- which is
43 likely the case if the WIM was Microsoft-created, as wimlib's
44 compressors are slightly stronger.
45
46 --compress=TYPE[:LEVEL]
47 Recompress the WIM using the specified compression type, and op‐
48 tionally the specified compression level for that compression
49 type. This implies --recompress. See the documentation for this
50 option to wimcapture(1) for more details.
51
52 --chunk-size=SIZE
53 Set the WIM compression chunk size to SIZE. See the documenta‐
54 tion for this option to wimcapture(1) for more details.
55
56 --solid
57 Create a "solid" archive that compresses multiple files together.
58 This usually results in a significantly better compression ratio
59 but has disadvantages such as reduced compatibility. See the
60 documentation for this option to wimcapture(1) for more details.
61
62 --solid-compress=TYPE[:LEVEL]
63 Like --compress, but set the compression type used in solid re‐
64 sources. See the documentation for this option to wimcapture(1)
65 for more details.
66
67 --solid-chunk-size=SIZE
68 Like --chunk-size, but set the chunk size used in solid re‐
69 sources. See the documentation for this option to wimcapture(1)
70 for more details.
71
72 --threads=NUM_THREADS
73 Number of threads to use for compressing data. Default: autode‐
74 tect (number of processors).
75
76 --pipable
77 Rebuild the WIM so that it can be applied fully sequentially, in‐
78 cluding from a pipe. See wimcapture(1) for more details about
79 creating pipable WIMs. By default, when neither --pipable or
80 --not-pipable is specified, the optimized WIM will be pipable if
81 and only if it was pipable before.
82
83 --not-pipable
84 Rebuild the WIM in the non-pipable format.
85
86 --unsafe-compact
87 Compact the WIM in-place, without using a temporary file. Exist‐
88 ing resources are shifted down to fill holes and new resources
89 are appended as needed. The WIM is truncated to its final size,
90 which may shrink the on-disk file. This is more efficient than a
91 full rebuild, but it is only supported when no recompression is
92 being done. More importantly, AN UNSAFE COMPACTION OPERATION
93 CANNOT BE SAFELY INTERRUPTED! If the operation is interrupted,
94 then the WIM will be corrupted, and it may be impossible (or at
95 least very difficult) to recover any data from it. Users of this
96 option are expected to know what they are doing and assume re‐
97 sponsibility for any data corruption that may result.
98
100 wimoptimize does not support split WIMs or delta WIMs. For such files,
101 consider using wimexport(1) instead. Note that wimoptimize is roughly
102 equivalent to:
103
104 wimexport WIMFILE all tmp.wim && mv tmp.wim WIMFILE
105
107 Rebuild 'install.wim':
108
109 wimoptimize install.wim
110
111 Rebuild and recompress 'install.wim':
112
113 wimoptimize install.wim --recompress
114
115 Rebuild and recompress 'install.wim' using LZX ("maximum") compression
116 at a higher-than-default compression level. The compression chunk size
117 remains unchanged. This command will be slow, but it might be useful
118 for optimizing files for distribution. See https://wimlib.net/compres‐
119 sion.html for some benchmark results.
120
121 wimoptimize install.wim --compress=LZX:100
122
123 Recompress 'install.wim' using solid-mode compression, then rename it
124 to ´install.esd´. This will decrease the archive size significantly.
125 (Also consider using 'wimexport install.wim all install.esd --solid'.):
126
127 wimoptimize install.wim --solid
128 mv install.wim install.esd
129
131 wimlib-imagex(1) wimexport(1) wimverify(1)
132
133
134
135wimlib 1.13.4 April 2021 WIMOPTIMIZE(1)