Question: I’m looking for a way to capture and visualize used disk space over time. All I need is one number– bytes used on disk. I store a lot of photos on my computer, so I need a way to estimate when I’ll need more hard drive space. If there’s a way to capture used disk space with hourly resolution that would be great, but even daily resolution is fine. I don’t even need a visualization of the data; as long as the data is easily exportable to Excel, I can create my own graph and extrapolate.

I’ve seen many disk space visualization programs like WinDirStat and TreeSizeFree, but they don’t have a way to automate capturing disk space usage over time.

Answer: 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:

  • Open Windows Performance Monitor (Win-R -> type “perfmon.exe” -> Enter)
  • In the left-most pane, double click Data Collector Sets. Right click User Defined -> New -> Data Collector Set.
  • Enter a name for your set, something like “Disk Space Free”. Click the radio button Create manually (Advanced), click Next.
  • Check Performance counter, click Next
  • Click Add…
  • 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.
  • 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.
  • Select the location you’d like your logs to be located in. Click Finish.
  • Double click User Defined in the left panel and click the data collector set you just created (the example name was “Disk Space Free”).
  • The data collector set you just created should show up in the right panel. Right click it -> Properties.
  • Under Log format you can select the type you prefer according the explanation in the paragraph above. Click OK.
  • 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.