Windows: How can I see disk space used over time?

Solution 1:

You can see used disk space over time with Windows Performance Monitor (perfmon) to the MB with down to one second resolution. This tool comes built into the latest versions of Windows so you don't even need to download another program to see the data. It doesn't show any previous data so you'll only see disk space data from when you set it up. I only needed hourly data points but I tested with updates every one second and it worked fine.

Perfmon allows you to output how much free disk space you have as values to a file that are comma-separated (can be opened in Excel), tab-separated (what Excel usually uses), or binary. Using the binary output, you can visualize the data in the perfmon itself. Using one of the other output types allows you to make your own graphs of the data in Excel.

Here's a step-by-step guide on how to set this up:

  1. Open Windows Performance Monitor (Win-R -> type "perfmon.exe" -> Enter)

  2. In the left-most pane, double click Data Collector Sets. Right click User Defined -> New -> Data Collector Set.

  3. Enter a name for your set, something like "Disk Space Free". Click the radio button Create manually (Advanced), click Next.

  4. Check Performance counter, click Next

  5. Click Add...

  6. Scroll until you see LogicalDisk and click the down arrow next to it. Scroll down a little and click Free Megabytes (you can also select % Free Space if desired). Now in the box below titled Instance of selected object: click C: and then below that Add >>. That counter should now show up in the right pane titled Added counters. Click OK.

  7. Set the Sample Interval to however often you'd like to have the data collected. Like I mentioned, I wanted to see hourly data points. So, I put 1 in Sample Interval and changed Units to Hours. Click Next.

  8. Select the location you'd like your logs to be located in. Click Finish.

  9. Double click User Defined in the left panel and click the data collector set you just created (the example name was "Disk Space Free").

  10. The data collector set you just created should show up in the right panel. Right click it -> Properties.

  11. Under Log format you can select the type you prefer according the explanation in the paragraph above. Click OK.

  12. Right click on the data collector and click start.

  13. After it's been running for some time, click to stop the data collector and review your data using one of the below methods.

If you selected binary, you can view the data by clicking Reports -> User Defined -> Disk Space Free in the left pane, then double clicking the item in the right pane.

If you chose comma-separated or tab-separated, you can view you data at the location you specified in step 8.

Solution 2:

Plenty of examples on the web of how to script this:

http://gallery.technet.microsoft.com/scriptcenter/c74d1cc0-d5e9-4d64-bc46-4ed92b416c62

http://powershell.com/cs/media/p/7081.aspx

http://social.technet.microsoft.com/Forums/windowsserver/en-US/4cfeeddf-afdb-436a-82fb-c4902ec9e303/monitor-and-report-the-disk-space-through-script-using-powershell-or-vb?forum=winservergen

http://www.poweradmin.com/blog/disk-space-monitoring-predict-full-disks/