Search this blog

Thursday, November 17, 2016

Freeing space in windows 7 by cleaning some clutter

Once again my windows 7 server*  reached the below 10% on the root drive mark. 

Running WinDirStat showed me the larger folders, and a careful check brought me to the following folders as the lead nominees to begin with, if one wishes to clean windows7 from some clutter:

Before

\windows\logs\cbs 
This is where log files, knows as "CBS Persist logs" are created. Apparently Windows uses this folder to log installation, updates and configurations. According to a superuser discussion "The normal log goes to a file CBS.log, but to prevent, that the file gets too large Windows splits them into CBS Persist logs and later compresses them into CAB files". The files are safe to delete, and there is no point in keeping them as history logs, if you don't have any problems with installations or updates. I guess that on a high-availability production machine I'd be more careful, but here I Deleted all but the files bearing today's date.
The outcome: 20GB released !!! 

\windows\winsxs 
SXS stands for Side-by-side technology. It is also known as WinSxS or SxS, although technically WinSxS refers only to the global side-by-side store (officially called the "Windows component store"), which is conceptually the native equivalent of the .NET Global Assembly Cache. Executables that include an SxS manifest are designated SxS assemblies. (For some reason I was not able to get to Microsoft's english version of support for winsxs. This is the link for the winsxs hebrew support. What can you say about a company that uses wordpress for its support?) 

To sum it up: not the kind of folder you want to delete stuff from on your own. 
Does Microsoft offer any tool or detailed steps to clean it ? 
The answer in the past was as far as practical conduct goes, a shocking no
Theoretically speaking, Microsoft realized that it has to provide a way to clean the WinSXS folder through the clean-up wizard. But even though my windows has the relevant update the wizard does not have the promised button "clean up system files". You may try on your own machine, running the wizard the as administrator (assuming your windows is on your C drive, open up C:\Windows\System32, and then right click cleanmgr.exe). 
For me, it did not help... I didn't get the promised "clean up system files". 

\windows\temp 
This is a relatively simple delete everything folder, with the exception that if a file is used, just skip it. (I've never ran into a situation when the entire folder was deleted, unless I was in safe mode).

For some reason, the folder had 10GB of files in it,  even though I distinctly remembered clearing it a few months ago. Oh well.... 

Last step
make sure you empty the recycle bin (for some reason, pressing shift during delete did not make it thru as permanent delete).

After

After-thoughts
And we are at the 36% free space line... which means that despite winsxs being an annoying issue, I'll let it be for the time being. Windows peculiarities can take one a lifetime, and I prefer to invest that time being productive on other things. (yes, surprising as it may seem, one learns and grows. 10 years ago I would have spent an all nighter on this issue now I prefer to dedicate the time to a more interesting question: how the blip did my data folder got so inflated... but that shall be kept for 
another post ). 

(*)
yes, I know it might sound funny, but the living room entertainment station is also being used as a home server.
what kind of server tasks you wonder? storage, backup, a miscellany of virtual machines, and other stuff.
Storage, btw, does not mean this is a file server. I'm slowly planning to become more cloud-oriented, but for now the equal storage nodes of the house, relying on Dropbox for the synchronizing and the external backup, works quite well in my mind. It enables the usage of several stations around the house with several users, while data is kept synchronized in all nodes and I highly recommend it.