Home > Certification, PowerShell, Windows2012 > Saving Disk Space on Windows 2012

Saving Disk Space on Windows 2012

As those close to me will know, I’ve recently jumped aboard the #90DaysToMCSA challenge with a few fellows from work, and have been diligently studying for the 70-410 exam and learning what has been updated from 2008 R2 to 2012.

I stumbled across a little nugget today that I wanted to touch on, as I found it interesting.  As we all know, the C:\WINDOWS\WINSxS folder is always huge and cumbersome.  This is the Windows Side By Side folder, where it basically keeps track of DLL hell, and when you remove or add features, or software, it helps find the right one.  Helpful, but why the HECK is it always 6-8-10GB or more?  Of course we know that you can use DISM options to remove Service Pack uninstallation files once applied, but often we’re installing from 2008R2 SP1 or 2012 media, and this has nothing to need to uninstall.  Windows 2012, however, has a new feature.  Not only can you use PowerShell to Remove-WindowsFeature, but you can also remove the installation media from disk.

See, it seems that also hidden in this C:\WINDOWS\WINSxS folder is a copy of some of the Windows installation media.  This is under the guise of being able to add/remove features without being prompted for installation media, such as the original DVD, ISO, or a share on the network.  I can understand why one would want this, but personally, I’d rather have my space back.

First, let’s take a look at the folder size on a server I had kicking around with no real features on it, just used for testing and poking at:

image

http://windowsitpro.com/windows-server-2012/q-how-can-i-remove-unused-roles-and-features-my-customized-windows-server-instal

Now, let’s use the help of John Savill (and really, who hasn’t?), and use the following code:

Get-WindowsFeature | Where-Object {$_.Installed -match “False”} | Uninstall-WindowsFeature -Remove

image

6.07GB down to 4.26GB – or about a 30% reduction.  That’s not too bad.  I’m sure many of my readers (are there many?  Okay, all 4 of you) are thinking “But it’s just 1.75GB, and my SAN’s DeDupe features will handle this, but how much does it matter?”.  You’re right, SAN level DeDupe will certainly handle this – but why make it?  First, having files on disk is just going to skew your stats.  Sure, you DeDupe 70% maybe, but if YOU let there be 20% common data, aren’t you being just a little dishonest about the success rate?

Then, let’s think about ALL the scenarios where SAN DeDupe doesn’t help:

  • You don’t HAVE SAN level DeDupe.
  • You’re doing this on SSD’s, and your boot disk is small.
  • You’re doing this with Windows 2012 VM’s on a physical host, and not using Linked-Clone or similar functionality.
  • You’re doing ANY kind of off-SAN backup.  Agent based backups inside the guest (sigh, really?  It’s the 21st century….) would be the worst, but even virtualization aware backups would still read the data, even if they DeDupe and/or Compress it away.  It might do it in an inline or post process, but why make it do the work?
  • You’re going to COPY the VM to another system – clones are going to need to copy these blocks.
  • You have scheduled antivirus scans, and they scan every file on the system, regardless of if it installation media or otherwise.
    Remember, there is nothing better than efficiency at source.
Advertisements
  1. Jeff Hutto
    October 28, 2013 at 11:50 AM

    Very helpful post. We will be using this as a post-installation step for new servers. Thanks!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: