18

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.

3
  • I supposed you could set something using Performance Monitor which is built into Windows blogs.technet.com/b/askcore/archive/2012/03/16/… May 5 '14 at 3:16
  • Thanks @Matthew Lock. It looks like Performance Monitor only shows the last minute in the view. I need something that can track years. Do you know if there's a way to do that using Performance Monitor?
    – Patrick
    May 5 '14 at 4:24
  • You can change the sampling time here: i.imgur.com/ganlFBW.png I haven't actually tried years in practice, but it seems to work. May 5 '14 at 5:54
18

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.

3
  • 1
    This should be marked as the right answer
    – Wadih M.
    Mar 31 '19 at 3:03
  • 1
    @WadihM. you're right. As per the StackExchange descriptions I should upvote Matthew's answer ("this answer is useful") and select mine as the correct answer. I've gone ahead and done so.
    – Patrick
    Apr 8 '19 at 22:26
  • And just in case one doesn't want to use perfmon... I found this paid solution (foldersizes.com/features/diskspacehistory). And community.spiceworks.com/topic/… mentioned "Veriato Disk Monitor" but that tool has rebranded and isn't free any longer. I hope it helps the next chia plotter ;-)
    – devnullius
    Jun 14 at 23:05
1

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/

3
  • 2
    Thanks for these links. I was hoping there was a way to do it through a program. I ended up using your first suggestion. After diving into Window Performance Monitor a little more, I discovered how to set up a user-defined data collector set and see data through the report feature. I'm accepting your answer because you deserve the credit for pointing me to the right answer in your comment. But, I'm also going to add my own for anyone who wants to accomplish this without scripting.
    – Patrick
    May 5 '14 at 6:45
  • 1
    As a highly valued Super User, I encourage you to revisit this answer and add more detail. As you may know, hyperlinks alone point toward an answer without actually being one. Please edit your answer so that it includes the essential elements from the links. Jun 12 '18 at 16:21
  • @Patrick Please set your answer as the correct one
    – Wadih M.
    Apr 7 '19 at 3:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.