Showing posts with label Shrink. Show all posts
Showing posts with label Shrink. Show all posts

Thursday, January 28, 2016

Shrink your Windows server and client images

When creating Windows images with lot's of updates, it's possible to shrink them before or after capturing the image. When deploying systems with less free disk space (like thin clients) this may be needed to fit. The DISM tool contains multiple servicing commands related to the component store (or the WINSXS directory). This location is used during servicing operations within Windows installations. Servicing operations include, but are not limited to, Windows Update, service pack, and hotfix installations.

The component store contains all the files that are required for a Windows installation. And, any updates to those files are also held within the component store as the updates are installed. This causes the component store to grow over time as more updates, features, or roles are added to the installation. The component store uses NTFS hard links between itself and other Windows directories to increase the robustness of the Windows platform.

The following commands can be used to shrink Windows installations and/or WIM images:

When creating a reference image use the online command:
Dism.exe /online /Cleanup-Image /StartComponentCleanup
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
Dism.exe /online /Cleanup-Image /SPSuperseded


When the image is already created, mount it and use the offline command:
Dism /image:<path> /Cleanup-Image /StartComponentCleanup

You can also run the following command to check the status of the Component Store:
Dims.exe /Online /Cleanup-Image /AnalyzeComponentStore


This can save multiple gigabytes on the image size!

For more information:
Clean Up the WinSxS Folder
How to address disk space issues that are caused by a large Windows component store (WinSxS) directory
How to Clean up the WinSxS Directory and Free Up Disk Space on Windows Server 2008 R2 with New Update

Friday, September 20, 2013

How to shrink the SQL Server Reporting Services log database

Today I did support on a ConfigMgr 2012 environment with local SQL installation, which I prefer! This because the SQL Server Reporting Services (SSRS) log database ReportServer_log.ldf file was claiming almost complete diskspace (30GB). This is because of the Maximum File Size setting which is set to 2TB by default and no Maintenance Plan is active to shrink the file (by design). I will explain how to shrink the file in order to prevent that the logfile stay small.
Before shrinking the file

Start SQL Management Studio for that and expand Databases. Select the ReportServer database and rightclick on it. Choose Properties and Files and change Full recovery to Simple recovery first. Do a rightclick on the ReportServer database again and choose Tasks, Shrink and Files. Under "File type" select Log and click OK.
Have a look at "Available free space"

The ReportServer_log.ldf file should now decreased in size to 1-5MB instead of multiple GB's. In my situation the logfile was shrinken from 30GB to 5MB (after a few minutes). Much better that way, and no need to increase diskspace every time.

Hope you have the same experience as described here!