McClean: LowDiskSpace
Overview
The computer for Scope #1 has recently been showing a warning (or error) saying:
Low Disk Space
You are running very low on disk space on Local Disk (C:).
Click here to see if you can free space on this drive.
If you see this error, here are some things to try to fix it.
Materials
- Yourself
- A computer
- An overenthusiastic operating system (Windows)
Protocol
0. Finding the problem
There are a few things to check:
- The Disk Cleanup utility
- The hibernation file
- The pagefile
- The windows log
The easiest way to figure out what's eating your disk space is to use TreeSize (already installed on the Scope #1 computer).
- Click Start
- Type
treesize
- Click 'TreeSize (Administrator)'
- Make sure the C: drive is selected and press the green play button
- TreeSize will scan the C: drive and list the directories in order of size.
- If the Windows file is huge (hundreds of GB), try the disk cleanup utility. If that doesn't work, try "fixing" the Windows log
- If
[n files]
entry (selected above) is huge, click on that entry- If you see a file named
hiberfil.sys
and it's large, disable hibernation - If the file
pagefile.sys
is large (more than a few GB) move it to the other hard drive
- If you see a file named
If you don't have a large pagefile, hibernation file, or a logging problem then this guide will not help you. TreeSize should at least show you what's eating the space on your disk though.
1. The Disk Cleanup utility
Sometimes temporary files build up and cause problems. The Disk Cleanup utility can help you safely remove these.
- Click on the error message. This will bring up the Disk Cleanup utility
- Scroll through the list to see if anything "big" (i.e., tens of gigabytes) can be deleted
- If so, check that item and click OK
The Disk Cleanup utility will remove unused files. In my experience, this does not actually free up very much space.
2. Enable/Disable Hibernation
In order to support hibernation, Windows creates a large file named hiberfil.sys where it dumps the RAM before hibernation. Then, when waking up from hibernation, Windows restores hiberfil.sys into the RAM.
On the Scope #1 computer, hiberfil.sys was about 50 GB in size (2/3 of the physical RAM size)
We should not need to hibernate these computers so I have turned off hibernation. This removed the hiberfil.sys file.
To re-enable hibernation (and restore hiberfil.sys):
- Click Start
- Type
cmd
- Right click on 'Command Prompt' and click 'Run as Administrator'
- Type
powercfg.exe /hibernate on
- Press Enter
- Restart the computer
To disable hibernation (and delete hiberfil.sys):
- Click Start
- Type
cmd
- Right click on 'Command Prompt' and click 'Run as Administrator'
- Type
powercfg.exe /hibernate off
- Press Enter
- Restart the computer
3. Moving the pagefile
Windows uses a pagefile for memory management. If there is a lot of physical RAM (e.g., the 64 GB on Scope #1's computer) the pagefile can be quite large and take up a lot of room on the C: drive. Fortunately, the pagefile can be moved to another drive.
IT IS RECOMMENDED TO KEEP A SMALLER PAGEFILE (AT LEAST 800 MB) ON THE C: DRIVE.
To move the pagefile:
- Click Start
- Right click 'Computer' and click 'Properties'
- Click 'Advanced System Settings
- Click the 'Advanced' tab, then under performance click 'Settings'
- Under the 'Advanced' tab, click 'Change'
- If 'Automatically manage paging file size for all drives' is checked, uncheck it
- Click C:
- Click custom size
- Enter '800' in the Initial size box
- Enter '1000' (or another size) in the Maximum size box
- Click 'Set'. YOU MUST CLICK SET
- Click your other drive (E: in our case)
- Click 'System Managed Size'
- Click 'Set'. YOU MUST CLICK SET
- Click 'OK' on all windows
- Restart the computer
Now when you run TreeSize, you should see a much smaller pagefile.sys file on the C: drive and a large pagefile.sys file on your other drive
4. The Windows logging bug
Unfortunately, a bug in Windows 7 causes problems if certain log files are larger than 2 GB in size. When this happens, the compressing program (makecab.exe) repeatedly creates ~100 MB cab files in the Temp folder. It will do this until the hard disk is full. The only 'solution' is to delete the large log file, delete the temporary files, and restart the computer. It's not enough to delete the cab files because makecab.exe will continue to produce them until the hard drive is full. Similarly, it's not enough to delete the large log file because the cab files will persist.
First, make sure this is an issue.
- Load TreeSize and scan the C: drive as above
- Click Windows > Temp > [n files]
If you see a lot of ~100 MB files that begin with cab, then this is your problem. In our case we had over 100 GB of cab files in the Windows\Temp folder.
To fix:
- Navigate to C:\Windows\Logs\CBS
- Copy all of these files to a new folder as a backup
- In practice, we probably don't need to save these. But it doesn't hurt.
- Delete everything in C:\Windows\Logs\CBS
- You may get an error saying the file 'CBS' is in use. That's fine, its safe to keep this file.
- Navigate to C:\Windows\Temp
- Delete every file that starts with cab. There are probably hundreds to thousands of them.
- Restart the computer
Now when you check TreeSize you should see that the Windows folder is MUCH smaller and that there are no cab files in the Windows\Temp folder.
Helpful Links
- Enable/Disable hibernation on Windows
- Moving the pagefile Ignore the part about disabling the pagefile on the C: drive, this could crash Windows. Follow the instructions above for the C: drive
- Windows logging bug I ignored the part about disabling the Windows Module Installer service and it worked fine
Notes
Please feel free to post comments, questions, or improvements to this protocol. Happy to have your input!
- List troubleshooting tips here.
- You can also link to FAQs/tips provided by other sources such as the manufacturer or other websites.
- Anecdotal observations that might be of use to others can also be posted here.
Please sign your name to your note by adding '''*~~~~''': to the beginning of your tip.
Contact
or instead, discuss this protocol.