Posted on July 8, 2016 · Posted in Windows 10

LZX File Compression on the NTFS Level in Windows 10

Another rather interesting and promising, though underpromoted, feature of Windows 10 is the support of LZX data compression algorithm on the NTFS file system level. Compared to the familiar NTFS compression, the LZX compression ratio in Windows 10 is much higher (almost at zip level). The average compression level is about 40-60%.

Compress files using the LZX algorithm Widnows 10 is performed only manually with the help of the familiar tool compact (we have discussed it in the article about Compact OS). When addressing the compressed files, their decompression in the memory is fully transparent for a user.

Disadvantages of LZX Compression:

  • The compression is performed manually, and after overwriting/updatingof the compressed file, it has to be compressed by user again. Thus, this type of compression is not suitable for constantly changed files and temporary folders.
  • Additional CPU and memory resources are spent on file decompression. In general, it is not critical for modern multicore processors.
  • The compressed files are not marked anyhow in Windows Explorer (the files compressed with the standard NTFS compression are highlighted in blue)

Important. Files compressed using LZX algorithm in Windows 10 cannot be opened in previous Windows versions.

The ideal candidates for LZX compression are static files that are accessed for read only and  *.exe files. It is usually typical to the folders with the installed applications, games, distribution storages, some system directories.

For example, after the folder with the installed game Far Cry 4 had been compressed, the size of the folder reduced from 27 GB to 17 GB. In case of Counter-Strike: GO, the size of the compressed folder was only 7.5 GB versus 10 GB of the original.

Note. Of course, there is no sense to compress multimedia files (pictures, videos, music) and archives, since they are already compressed using their own algorithms.

The compression is performed only from the command prompt run with the administrator privileges. For example, to compress one file use the following command:

compact /c /a /exe:lzx "C:\Program Files (x86)\\Tiny Hexer\mpth.exe"

compact compress file with lzx compression in windows 10

The size of this executable has reduced from 1.54 MB to 0.7 MB.

Let’s compress the contents of all files and subfolders in a specific directory:

compact /c /s /a /i /exe:lzx "C:\Program Files (x86)\*"

compress Program-Files-x86 folder in Windows 10
In our example, the size of the C:\Program Files (x86)\ decreased almost twice.

Important. Never compress the entire system disk or C:\Windows. The system can stop booting with an error: BOOTMGR is compressed).

As a rule, you can safely compress the following system folders:

  • C:\Windows\Installer
  • C:\Windows\assembly
  • C:\Windows\Microsoft.NET
  • C:\Windows\Fonts
  • C:\Windows\Inf
  • C:\Windows\infused apps

To decompress the compressed files, use these commands:

compact /u /a /exe “C:\Program Files (x86)\\Tiny Hexer\mpth.exe"
compact /u /a /s /exe "C:\Program Files (x86)\*"

Despite of the constant increase of media capacity, the problems with the lack of the free space are still relevant. The most often this problem occurs among the owners of SSD drives, for which the cost of a GB of space is quite expensive. Using LZX file compression in Windows 10 will allow to save space on a disk due to a slight loss in performance. There is another interesting nuance: in case of slow disks, compression allows to reduce the reading time of large files, since the decompression of these files in the memory takes less time, than the reading of a large file from the disk.

Related Articles