Monday, August 17, 2015

How can I minimize my Windows 10 OS install disk footprint?


I am approaching a dangerous situation in that my OS (C:) drive is getting more and more full as time goes on. My machine came with a 256GB SSD which was partitioned into a C and D drive. Knowing this, every time I've chosen to install programs, I generally do it to the D: drive in order to save my C: space since it's the OS install. Even still, with all of the MS Windows Updates and also a few tools which wouldn't let me choose their install path (e.g. I have MS Visual Studio and a couple other large programs like this which forced a C: disk install), I am dangerously close to filling the drive and I won't even be able to update my OS anymore. My question is, what can I do to reduce disk space usage on this drive so I can continue to properly use my machine? I am attaching a screenshot of WinDirStat and basically, you can see that the majority of the space seems to be used by Windows system files and AppData. Obviously, I can figure out the personal files I've installed and remove them as appropriate, but I am mainly asking about the system files which continue to grow and grow. For example, in screenshot #2, you can see this "Installer" folder with a bunch of random MSI files. I would like to remove these if they are not immediately needed.


What I've tried so far:



  1. Run Disk Cleanup, including removal of "Operating System files" which has alreaedy removed the previous version backup file.

  2. Used 3rd party disk cleanup tools like CCleaner.

  3. Used WinDirStat to relocate/remove my personal files as needed


By the way, I am looking at getting a new SSD and installing it in my laptop this next week but I also want to do my best to free up the current one that I have.


Is there any way to tell Windows "I am low on disk space so please do not keep throwing more system files/updates onto the drive and consuming it?" For example, I only have 6GB left now and I don't even think I can do the next Windows Update because it'll try to keep a rollback version but won't be able to.


I have access to 3 large (1TB+) external drives and I have created some symbolic links to those before as well but obviously I have to be careful which files I do this with.


enter image description here
enter image description here


Answer



You can shrink the Windows installation a bit by using the "Compact OS" feature.


In an administrative command prompt, you can use the compact /CompactOs command to:


Query the current status with compact /CompactOs:query


Force-enable compaction with compact /CompactOs:always


Force-disable compaction with compact /CompactOs:never




You should avoid removing any of the files in the Installer folder. They are cached installer databases required to uninstall many programs - if you delete them, you'll find that many of your installed programs will fail to uninstall later.


In fact, since many upgrade installs include an implicit uninstall of the previous version, removing any of those files could cause future upgrades of applications to fail.




If you just desperately need space temporarily, you can also consider removing the hibernation file (hiberfil.sys) by disabling hibernation, and moving any page files to a secondary drive.


Also, since you didn't include the full tree in the screenshot it's a bit hard to tell, but you can check how much space shadow storage is using with vssadmin list shadowstorage. If you're willing to sacrifice a bit of system restore capability, you can reduce or disable this storage.


Of course, these are all things you should try to revert ASAP.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...