Tame a new system’s hard-drive bloat

Susan bradley By Susan Bradley

You just bought that new Windows 7 computer, and the next thing you know — you’re running out of space.

Here are some tips and tricks to show where your hard drive space is going.

Once upon a time, I bought a computer with a 1GB hard drive and thought I’d never outgrow it. A few years later, I think nothing of buying Terabyte hard drives. The pundits might declare we’re in a post-PC era, but the size of my C: drive begs to differ. It’s not just my basic documents that are taking up space, not even those hundreds of digital photos and videos. With Windows, there can be many hidden — and unneeded — files that are choking your hard drive.

Start with the basic Windows cleanup tool

It’s always best to start with Windows’ common maintenance tools such as Disk Cleanup, shown in Figure 1. In this example, I could reclaim a whopping 39.1GB of drive space. Selecting the Clean up system files button removes old dump files, log files, queued-up Windows error reporting logs, and previous versions files as well. For more on using Disk Cleanup, see the SevenForums article, “Windows 7 — Disk Cleanup — open and use.”

Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 10, Windows 8, Windows 7, Firefox, Internet Explorer, Google, etc. Join our 460,000 subscribers!

Enter your email above to receive messages about offerings by Penton, its brands, affiliates and/or third-party partners, consistent with Penton's Privacy Policy.
The Windows 7, Vol 3 (Excerpt)

Subscribe and get our monthly bonuses - free!

The Windows 7 Guide, Volume 3: Advanced maintenance and troubleshooting provides advanced tools for keeping Microsoft's premier operating system up and running smoothly. Get this excerpt and other 4 bonuses if you subscribe FREE now!

Windows disk cleanup dialog box
Figure 1. You get to Windows’ Disk Cleanup tool by selecting Computer and right-clicking the target drive. Select Properties and Disk Cleanup.

Two simple ways to find space-wasting files

The typical Windows system is full of large files lurking on the hard drive and consuming an extraordinary amount of space. Some of these you want to keep — others probably not. TreeSize Free (info page) is one of my favorite utilities for hunting down these hard-drive hogs. After installation, select TreeSize Free (Administrator) and let it scan your C drive. It produces a detailed, Explorer-like window (see Figure 2) of the largest to smallest folders and files. I found 60GB of Top Gear TV show videos (a BBC automobile show) that I can either move to another drive or put on my NAS storage device.

TreeSize free
Figure 2. TreeSize Free helps you hunt down those folders and files that consume the most disk space.

Another space-saving technique, as documented in MS Support article 920730, is to disable Windows hibernation. If you have a large amount of data in RAM, it will take a similar amount of space on the drive to save it in a hibernated state. Be aware, however, that you could lose data if you place the computer in hybrid sleep mode and the PC loses power.

Trim down Windows’ system-update files

But there’s another hidden disk hog: your operating system’s installation and patching contents. Windows 7 keeps a complete set of system files in the Windows Component Store (found at C:Windowswinsxs). The folder has everything needed for a full Windows installation plus all updates to the operating system. Decide at a later date that you want to install a Web server on your Windows 7 — just to play around with coding (hey, it could happen) — and the needed files are there in the component store. You may not have installed Spider Solitaire, but its files — and those of any other optional Windows app — are hiding in the component store.

It’s the component store that lets you successfully roll back a service pack or patch to a pre-update state.

Windows uses a technology called NTFS hard links to keep track of these important OS building blocks. And for the links to work, the component store must never be moved from the Windows system volume.

Oddly, when you look at a list of these system files in Explorer, they appear twice their actual size. That’s because a file can be located in two places — the component store folder and in the windowssystem32 directory — both hard-linked and counted as one file by Explorer.

To save some hard-drive space, Windows 7 and Server 2008 R2 perform an automatic background operation called scavenging, which removes unneeded Windows 7 components.

Another way to save space is to make a service pack permanent — a process the scavenging feature does not do — and reclaim several gigs of drive space. However, once you make a service pack permanent, it cannot be removed.

(Note: If you followed my advice and manually installed Windows SP1, there are unneeded, left-over files on your system. However, if you installed SP1 via Windows Update, it automatically removed the unneeded files.)

With that warning, and if you installed Windows 7 SP1 a few months ago and are comfortable making it a permanent part of your Win7 installation, you can run the following administrator-level command (shown in Figure 3):

DISM /online /Cleanup-Image /SpSuperseded

winsxs cleanup command
Figure 3. Use this command to make Win7 Service Pack 1 permanent and reclaim disk space.

To run an admin-level command prompt, click Start/All Programs/Accessories, then right-click Command Prompt and choose Run as administrator. (Shown in Figure 4.) Now enter the command string.

winsxs cleanup command
Figure 4. Right-click Command Prompt for the option to run it as an administrator.

Old Windows hands will by now be wondering about that old XP trick of removing system-patch folders — once the updates were installed and you were comfortable that they were working properly. Sorry; that doesn’t work in Windows 7. As noted above, Windows 7 stores all update files as noted in the WinSxS folder. Microsoft Support article 2592038 explicitly states that manually deleting files from the component store can cause serious problems with the OS.

Given the relatively low cost of hard drives, the ultimate solution is to ensure you have a sufficiently sized drive — enough to account for growth of the WinSxS folder. Although a TechNet/The Windows Servicing Guy blog recommends a 40GB C: drive, my recommendation is at least 60GB to 120GB.

One of the enduring debates is whether to have one large C: partition that uses the entire physical drive, or to use several smaller partitions. Even Window Secrets contributors debate this point.

Having one partition is certainly simpler — and should alleviate the worry that WinSxS will fill up the main system partition. But there are some benefits to multiple partitions. The first is the ability to separate your personal data from system data. It makes it easier to move your documents from drive to drive or from computer to computer. Separate partitions also make it easier to perform system repairs and other maintenance tasks. If Windows needs to perform an automatic rollback, it could take significantly longer on a single, large partition. And running CHKDSK might also take longer than you’d like.

So plan your drive space carefully and keep an eye on the C: drive. Running too tight on the system drive will degrade performance and cause problems with applications. And use TreeSize Free periodically to root out those forgotten monster files.

Feedback welcome: Have a question or comment about this story? Post your thoughts, praise, or constructive criticisms in the WS Columns forum.

The Patch Watch column reveals problems with patches for Windows and major Windows applications. Susan Bradley has been named an MVP (Most Valuable Professional) by Microsoft for her knowledge in the areas of Small Business Server and network security. She’s also a partner in a California CPA firm.
= Paid content

All Windows Secrets articles posted on 2011-08-25:

Susan Bradley

About Susan Bradley

Susan Bradley is a Small Business Server and Security MVP, a title awarded by Microsoft to independent experts who do not work for the company. She's also a partner in a California CPA firm.