Following is relevant info taken from: https://docs.microso...ktop/compact-os
NOTE:In some cases I have added some additional commets to clarify the info.
Acording to MS info when using the Compact mode on 10 OS, (remember all commands on this section apply to Compact 4K, the standard option) :
You can query whether the operating system is running Compact OS, and change it at any time, using the Compact.exe command.
EDIT: New info from my post No. 46: http://reboot.pro/to...e-2#entry215932
I ran Compact /compactos:always in a elevateted command prompt from a running 10x64 (standard install, not compact) on a VHD, In my test got a compression of 1.8 to 1, I assume they were 4K compacted (standard Compact value on 10), see attached picture.
EDIT: Using new WOF_Compress-38, I was able to verify it was 8K compressed, then 8K seems to be the new stardard for Win10 Compact on this 10 19H1.
From Windows PE, determine if the OS is compacted:
Compact.exe /CompactOS:Query /WinDir:E:\Windows
Where E:\Windows is the folder where Windows has been installed.
From an online installation, change from non-compacted to compacted OS:
Compact.exe /CompactOS:always
Size comparisons
The table below shows the additional space saved by using compact OS, Single instancing, and reducing or turning Off Hiberfile on 2GB (x86 processor architecture) and 4GB (x64 processor architecture), on Windows 10, version 1607:
The table do not keep the correct aligments when pasted here and it was better to make an image and attach it.
This is another usefull info from: https://winaero.com/...thm-windows-10/
Starting with Windows 10, you can use LZX compression. This is the strongest algorithm available for NTFS. Its compression ratio is about 50% for certain files, which is much more than the default NTFS compression.
Before you proceed, you need to know that files compressed with LZX in Windows 10 cannot be opened in Windows 7, Windows 8.1 or in any previous Windows version.
To compress files on NTFS using the LZX algorithm in Windows 10, do the following.
Open an elevated command prompt.
Type or paste the following command:
compact /c /s /a /i /exe:lzx "C:\data\*"
Substitute the C:\data portion with the actual folder or drive path you want to compress.
This will apply LZX compression optimized for executable files which are read frequently and not modified.
Others algorithms are:
XPRESS4K (fastest) (default)
XPRESS8K
XPRESS16K
It will compress other files as well.
The switches are as follows:
/c - Compresses the specified files. Directories will be marked so that files added afterward will be compressed unless /EXE is specified.
/s - Performs the specified operation on files in the given directory and all subdirectories. Default "dir" is the current directory.
/a - Displays files with hidden or system attributes. These files are omitted by default.
/i - Continues performing the specified operation even after errors have occurred. By default, COMPACT stops when an error has encountered.
To unpack the compressed files (restore defaults), use the following command:
compact /u /a /s /exe "C:\data\*"
This info is good, but we need to also remember wimb made a GUI program to make this task: WOF_Compress
Anyway as said on first post under Summary of my procedure:
If you want a Compact mode LZX, doing your final VHD and latter apply Compact LZX to it is foolish, if you can install it directly as Compact mode LZX, using wimlib.
Also under Why wimlib is a better option than WinNTSetup when dealing with Compact installs:
WinNTSetup first installs all, and latter Compacts it (standard Dism procedure), the advantage of using wimlib for Compact mode installs is it first compacts the files on RAM and then write them to the VHD, this lets you use an smaller size for the target VHD, that WinNTSetup can't use, I have had this trouble with WinNTSetup during my tests.
alacran
Edited by alacran, 15 September 2020 - 11:59 PM.