7

I have some drives that are mounted in NTFS folders because I've run out of drive letters in Windows. How can I easily check the free space on these drives? I Googled it without success.

8
  • 16
    "...because I run out of driver letters." I must say that's a first for me.
    – squillman
    Commented Mar 18 at 14:54
  • Unless quotas are a factor, you have to find out how much free space the volume that contains the mounted folder has on the remote server.
    – squillman
    Commented Mar 18 at 15:00
  • Liberate one drive-letter and use that.
    – harrymc
    Commented Mar 18 at 15:11
  • On a side note, do you really need to maintain all of those drive mappings? Do you use them frequently enough to keep them ALL mapped persistently? If not, you'll help the performance of your PC by removing them.
    – squillman
    Commented Mar 18 at 15:13
  • 2
    You can do so via the GUI by opening the directory properties for whichever directory it's mounted to, and there will be a button on it that when clicked, will open the normal partition properties for the mount point. I'll look in the morning and reply back with the exact steps
    – JW0914
    Commented Mar 19 at 1:53

3 Answers 3

10

The "Disk Management" console diskmgmt.msc has columns for "Free Space" and "% Free", for all volumes regardless of where they are mounted.

PowerShell's Get-Volume likewise has a SizeRemaining column, and it's possible to add a custom column with a percentage like this (although it breaks auto-formatting for the existing columns):

Get-Volume | select FileSystemLabel,
                    @{Name="FreeGB";Expression={$_.SizeRemaining/1e9}},
                    @{Name="%Free";Expression={$_.SizeRemaining/$_.Size*100}},
                    Path;

(This looks better in PS7, which rounds the values, whereas PS5 doesn't.)

At API level, the same GetDiskFreeSpaceEx() (e.g. through Python's pywin32) accepts any kind of path and is not inherently limited to a drive letter. (for example, I have an old df clone.)

4
  • Interesting! I never thought to name a drive that way. Do networks deal well with that? Commented Mar 18 at 15:40
  • Interesting. How do you assign [: or 4: as driveletter though? Disk Management does not seem to list them, but I'm very interested to learn more about this. Care to give me a mention and a comment, or edit the answer and then mention me in a comment? Btw, I do know how to do this with network shares, unless that is what you mean.... EDIT: okay, net use won't let me use [: or 2: either. Curious for both. :)
    – LPChip
    Commented Mar 18 at 17:14
  • @LPChip: Hmm, now that you mention it, I only remember actually doing that with subst, not with real volumes. (Though volume to letter mappings are also stored in registry somewhere...) The 'vfdwin' virtual-floppy-drive tool in the WinXP era used numbers. Commented Mar 18 at 17:17
  • Yeah, I know about subst. I've done it there too, but anywhere else seems impossible. I guess you can mount a partition to a folder, and use a script with subst at boot to create an arbitrary driveletter. Problem is that windows won't show those in explorer, so you still can't see the size.
    – LPChip
    Commented Mar 18 at 17:24
7

fsutil can do this.

As a test I mounted an empty partition in c:\foo. Then to get the volume id use fsutil volume list:

C:\temp>fsutil volume list
Possible volumes and current mount points are:

\\?\Volume{a81467b8-cd80-4d3a-88aa-8b7663286301}\
C:\

\\?\Volume{5f40e7c5-e9a5-49b6-a298-2e7293b462ba}\

\\?\Volume{b1758026-c638-4776-82c1-def41293cb5b}\
C:\foo\

\\?\Volume{f287744b-f47a-4b8b-811f-3d8fe071661d}\

And we can see from this that the volume we want is the one mounted as c:\foo i.e. \\?\Volume{b1758026-c638-4776-82c1-def41293cb5b}\. Then to get the free space use fsutil volume diskfree:

C:\temp>fsutil volume diskfree \\?\Volume{b1758026-c638-4776-82c1-def41293cb5b}\
Total free bytes                : 255,936,524,288 (238.4 GB)
Total bytes                     : 256,042,332,160 (238.5 GB)
Total quota free bytes          : 255,936,524,288 (238.4 GB)
Unavailable pool bytes          :               0 (  0.0 KB)
Quota unavailable pool bytes    :               0 (  0.0 KB)
Used bytes                      :     101,613,568 ( 96.9 MB)
Total Reserved bytes            :       4,194,304 (  4.0 MB)
Volume storage reserved bytes   :               0 (  0.0 KB)
Available committed bytes       :               0 (  0.0 KB)
Pool available bytes            :               0 (  0.0 KB)
3

While the other answers discussing cli options are far more efficient, the GUI method:

To open the normal partition Properties, showing free space:

  1. Right-click on directory that's the mounted partition → Properties
  2. Type: Mounted VolumeProperties

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .