Any useful scenario for NTFS compression?

Page 3 of 4 FirstFirst 1234 LastLast

  1. Posts : 2,935
    Windows 10 Home x64
    Thread Starter
       #21

    Hello.

    These are some Windows folders that can be compressed too.

    \windows\assembly (already mentioned)
    \windows\inf
    \windows\infused apps
    \windows\installer (you may need to unpack it first with /u /s /a /a) (it was packed with lznt1 on my pc by default)

    This will shave off about 2GB+ of free space.
      My Computer


  2. Posts : 5,478
    2004
       #22

    eLPuSHeR said:
    \windows\inf
    That one is already compressed by compact /compactos:always (in my case from 50.4MB to 22.5). I'll add it anyway though, thanks.

    In case you are interested this is what I'm doing at the moment.. It is pretty stable.

    The compression is a bit trial and error (lzx for things like installer that are never used like installer, xpress8k for things that are like assembly). Obviously deleting is better than compressing when you can (WindowsApps and SoftwareDistribution\Downloads in particular). Fonts is reasonable extra saving (377MB to 249MB compressed) but you need to take/restore ownership.

    Code:
    $compactDirectory = @(	
    ("$env:programFiles",                     "", "xpress16k")
    ("${env:programFiles(x86)}",              "", "xpress16k"),
    ("$env:homeDrive\MSOCache",               "", "lzx"),
    ("$env:homeDrive$env:homePath\Documents", "", "xpress16k"),
    ("$env:homeDrive$env:homePath\OneDrive",  "", "xpress16k"),
    ("$env:homeDrive$env:homePath\Downloads", "", "xpress16k"),
    ("$env:windir\Assembly",                  "","xpress8k"),
    ("$env:windir\Fonts",                     "NT SERVICE\TrustedInstaller", "xpress16k"),
    ("$env:windir\InfusedApps",               "", "xpress16k"),
    ("$env:windir\Installer",                 "", "lzx"),
    ("$env:windir\Panther",                   "", "xpress16k"),
    ("$env:windir\SoftwareDistribution",      "", "xpress16k"),
    ("$env:windir\System32\Catroot2",         "", "xpress16k"),
    ("$env:windir\System32\LogFiles",         "", "xpress16k")		
    )
    #------------------------------------------------------------------------------------------------------------------------------------------------------
    function takeOwn-folder ($folder) {
    	$toplevel = Split-Path $folder -leaf
    	if (Test-Path "$PSScriptRoot\$toplevel.acl") {Remove-Item "$PSScriptRoot\$toplevel.acl" -Force -ErrorAction 0}
    	icacls "$folder" /save "$PSScriptRoot\$toplevel.acl" /t 
    	takeown /f "$folder" /r 
    	icacls "$folder" --% /grant "%USERDOMAIN%\%USERNAME%":(F) /t
    }
    #------------------------------------------------------------------------------------------------------------------------------------------------------
    function restoreOwn-folder ($folder, $owner) {
    	$toplevel = Split-Path $folder -leaf
    	$parentPath = Split-Path -parent $folder
    	icacls "$folder" /setowner "$owner" /t
    	icacls "$parentPath" /restore "$PSScriptRoot\$toplevel.acl"
    	Remove-Item "$PSScriptRoot\$toplevel.acl" -Force -ErrorAction 0	
    }
    #------------------------------------------------------------------------------------------------------------------------------------------------------
    For($i=0;$i -lt $compactDirectory.Count; $i++) {
    	$folder       = $compactDirectory[$i][0]
    	$owner        = $compactDirectory[$i][1]
    	$compression  = $compactDirectory[$i][2]
    		
    	if(Test-Path $folder)	 {
    		# take ownership if required
    		if ($owner -ne "") {takeOwn-folder -folder $folder} 
    			
    		Write-Host "Running " -NoNewLine
    		Write-Host "compact /c /s /a /f /q /i /exe:"$compression $folder"\*" -f White 
    
    		compact /c /s /a /f /q /i /exe:$compression $folder\*
    							
    		#restore ownership
    		if ($owner -ne "") {restoreOwn-folder -folder $folder -owner $owner}
    	}
    }
    What I've had problems with are these 3
    Code:
    	#	("$env:windir\System32\DriverStore\FileRepository","","lzx"),
    	#	("$env:programData","NT AUTHORITY\SYSTEM","xpress16k"),
    	#	("$env:APPDATA","NT AUTHORITY\SYSTEM","xpress16k"),
    Not sure if I've got the ownership wrong or what but windows doesn't work properly if I compress these.

    I'd like to compress DriverStore as it is big but my screen goes all funny if I do...
      My Computer


  3. Posts : 201
    Kernel 4.x.x
       #23

    Sometimes when I install the OS, I choose to use NTFS compression across the entire System partition (On MBR/BIOS I combine boot and windows partitions).

    I do this after install, but before the final reboot via command prompt with something similar to:
    Code:
    FOR /F "delims=*" %I IN ('dir /b /s "C:\*.dll") DO compact /C /A /EXE:XPRESS18K "%I"
    FOR /F "delims=*" %I IN ('dir /b /s "C:\*.exe") DO compact /C /A /EXE:XPRESS18K "%I"
    compact /C /A /S:C:\
    compact /U /A /S:C:\boot
    compact /U /A /S:C:\Windows\boot
    compact /U /A C:\Windows\System32\winload.exe
    A few things you cannot compress and successfully boot on MBR/BIOS are:
    \Windows\System32\winload.exe
    \Windows\boot\*
    \boot\* (assuming you combine boot and OS partitions like I do)

    Everything else I believe is able to have compression applied.
      My Computers


  4. Posts : 2,935
    Windows 10 Home x64
    Thread Starter
       #24

    I would love MS or someone else would make a nice GUI and improve the compact command.
      My Computer


  5. Posts : 2,935
    Windows 10 Home x64
    Thread Starter
       #25

    Hello guys.

    A question crossed my mind. Does anybody know if Xpress DECOMPRESSION TIME is the same for al variants (4k, 8k, 16k)?
    I am asking this because right now I am quite satisfied with the 8k compression ratio/speed, but I could go for 16k just for the extra space savings.
      My Computer


  6. Posts : 5,478
    2004
       #26

    eLPuSHeR said:
    Hello guys.

    A question crossed my mind. Does anybody know if Xpress DECOMPRESSION TIME is the same for al variants (4k, 8k, 16k)?
    I am asking this because right now I am quite satisfied with the 8k compression ratio/speed, but I could go for 16k just for the extra space savings.
    Isn't that what testing load times of Winword.exe and firefox you did earlier does? For the first load this will read from disk and decompress into ram. This guy says xpress16k is just as fast Windows 10 Compression - Page 8 and (completely unscientifically) I can't feel any difference...

    I guess you could test it by decompressing something big (a wim or a game or something) but how this would apply to real use I don't know as if you've got enough RAM pages will be decompressed and stay in memory anyway until something pushes them out.

    Perhaps looking at frame rates in a game would be a good test? I don't have any so I can't test that.
      My Computer


  7. Posts : 2,935
    Windows 10 Home x64
    Thread Starter
       #27

    Thanks. I am asking because the tool we used to measure loading times (AppTimer) doesn't take into account cpu usage, which would be nice to have too. I will test packing a game or something.

    Best regards.
      My Computer


  8. Posts : 2,935
    Windows 10 Home x64
    Thread Starter
       #28

    I have made a quick test. Compressing a huge 4GB+ Neverwinter Nights 2 campaign I am currently playing. Although the game sits on my SSD, these external files are on my SATA II mechanical hard disk. I do not trust SSD tests because they are pretty fast already and it makes more sense on HD anyway.

    No great differences between Xpress8k and Xpress16k

    Both compression ratios were 2.2 to 1. Loading times (using a physical chronograph) were 18'69s and 19'54s respectively. If we take into account some error margin, the difference is less than a second.

    Some other apps. didn't get any benefit in size from going to 16k over 8k. Defraggler went from 1.8 to 2.2 though.

    I have not been able to determine if loading times are the same or not. Maybe someone could supply a different way of testing (or showing some documents or something).

    Right now I am sticking to 8k to be on safe ground.

    PS - By the way. When we did our earlier tests we didn't take into account Windows Prefetcher .pf files. They could add some randomness to loading times I think. I think we should have deleted the associated .pf files between runs.

    Best regards.
      My Computer


  9. Posts : 2
    windows
       #29

    hello, anyone here reading this anymore? i have a question... how can i choose what format (algorithm) i want (for example xpress4k) to use it and compress my os binaries in that format? For example i want to choose xpress4k , if i just type the command : C:\Windows\system32>compact/compactos: always ....it automatically compress the file in whatever format it wants, and i want xpress4k. So how to make it follow my demand? Thanks
    Last edited by cata; 11 Jan 2017 at 09:30.
      My Computer


  10. Posts : 5,478
    2004
       #30

    cata said:
    hello, anyone here reading this anymore? i have a question... how can i choose what format (algorithm) i want (for example xpress4k) to use it and compress my os binaries in that format? For example i want to choose xpress4k , if i just type the command : C:\Windows\system32>compact/compactos: always ....it automatically compress the file in whatever format it wants, and i want xpress4k. So how to make it follow my demand? Thanks
    You can't specify the compression unfortunately. /CompactOS:always uses xpress4k. If there is some way to change this to xpress16k or something else I don't know it.

    If you want xpress4k then you can just run the command. If not you'll have to do it manually - just don't compress boot files.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:12.
Find Us




Windows 10 Forums