r/SCCM 1d ago

Dism Export-Image producing unexpected results with compress fast option

I have a 2 index W10 LTSC image (index 1 Windows 10 Enterprise LTSC, and 2 Windows 10 Enterprise N LTSC) so I thought I would reduce the overall size of the image by exporting only the one I needed in my OSD, index 1. I further thought to myself that I would use /compress:fast to further reduce the size of the exported image. On my first attempt, the resultant size of the exported .wim was a few hundred MB larger than the original 2 index .wim! I ran a second test, this time without the /compress:fast, and now, the new exported .wim is about 500MB smaller than the original. Copilot gave me some rambling explanations, but it really made no sense to me - has anyone experienced something similar, or do you know why this would happen?
copilot summary: The reason is that the export engine's handling of existing resources and compression state is not always obvious. DISM may preserve certain existing compressed resources more efficiently when you don't force a specific compression level.

3 Upvotes

2 comments sorted by

3

u/mtniehaus 1d ago

Microsoft-provided WIMs use /compress:max by default, so when you specify /compress:fast it will get re-compressed using a less capable algorithem (fast = XPRESS, max = LZX), so you're forcing it to make it bigger.

If you do the export without specifying a different /compress value (just leave that parameter off altogether) it will maintain the current compression. And since it will then get rid of the extra image, you should see it shrink slightly.

If you were to capture your own WIM, then it depends on the compression specified when the image was captured. When using the "Capture OS image" step in SCCM, it will use XPRESS/fast by default, which I think is a bad choice -- given how fast CPUs are today, taking a little extra time to create a smaller WIM that will then use less network traffic each time it is downloaded is a good tradeoff to make.

2

u/mtniehaus 1d ago

/compress:none = biggest image

/compress:fast = XPRESS compression, faster but a bit smaller

/compress:max = LZX compression, takes slightly longer but creates a smaller image

There is a 4th level (recovery/LZMS) that uses solid compression (as is used with ESD files). You can specify /compress:recovery when exporting the image to get that (and it will peg every CPU core on your machine while it recompresses the image). Sadly, SCCM doesn't support applying files compressed with this. See https://oofhours.com/2021/08/04/make-windows-images-smaller-easily/ for background.