It is currently March 28th, 2024, 5:48 pm

Support for reading disk space on mounted NTFS folder

Report bugs with the Rainmeter application and suggest features.
Post Reply
hunnypuppy
Posts: 5
Joined: September 15th, 2017, 1:52 am

Support for reading disk space on mounted NTFS folder

Post by hunnypuppy »

Windows allows you to mount drives to empty folders. It would be awesome if RainMeter would allow a way to read diskspace on mounted folders. Often many of my friends and I mount new drives to existing folders that way we can swap out drives without any hassles or add new ones and add capacity to the system very easily. But it's VERY hard to monitor free space and when it's being used up. Currently RainMeter only monitor drives, adding the ability to monitor mounted folders would just be a killer feature that most monitoring tools in the market don't even provide today
hunnypuppy
Posts: 5
Joined: September 15th, 2017, 1:52 am

Re: Support for reading disk space on mounted NTFS folder

Post by hunnypuppy »

Any suggestions on how to get started within Rainmeter to do that? happy to write some command line scripts but not familiar how to do custom stuff in rainmeter
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Support for reading disk space on mounted NTFS folder

Post by mak_kawa »

Hi hunnypuppy

You are saying about subst command that mounts folder as a drive? If so, just an idea. But I don't use subst command, so I am afraid that this may be irrelevant...

Free space of a mounted drive is obtained by FreeDiskSpace measure for host drive because it is equal to that of host drive, right? And used space of mounted drive can be obtained by FolderInfo plugin for substituted folder, I think.

Code: Select all

[mFolderSize]
Measure=Plugin
Plugin=FolderInfo
Folder=(Folder path)
IncludeSubFolders=1
IncludeHiddenFiles=1
IncludeSystemFiles=1
InfoType=FolderSize
hunnypuppy
Posts: 5
Joined: September 15th, 2017, 1:52 am

Re: Support for reading disk space on mounted NTFS folder

Post by hunnypuppy »

dvo wrote:i think you have to mount it first, before you can see in any info
so you need a button with a right or left mouse up or down action

to help you on your way you can grab this skin
https://forum.rainmeter.net/viewtopic.php?f=4&t=26469&p=138244#p138244\
made this for switching monitors but the same script could be used for your buttons.... :welcome:
Hmm I think I may not have explained it properly. When you use Disk Manager and you can have it mount an entire disk to a folder. For example, I attach a new hard disk, say it's 1TB in size. Now I can create a empty folder on an existing disk e.g. C:\Videos and I can ask Disk Manager in windows to mount the entire 1TB hard disk to the folder C:\Videos

So the new disk is mounted directly into C:\Videos and not as a separate drive. If you look in Windows Explorer you'll see the "size" of C:\Videos it will say 1TB (the size of the disk), when I look inside C:\Videos it will show me the actual used space based on the size of the files.

The problem is that RainMeter only monitors drives for empty space. How do I tell it that C:\Videos is a mounted disk and report how much free space is available in C:\Videos?
hunnypuppy
Posts: 5
Joined: September 15th, 2017, 1:52 am

Re: Support for reading disk space on mounted NTFS folder

Post by hunnypuppy »

mak_kawa wrote:Hi hunnypuppy

You are saying about subst command that mounts folder as a drive? If so, just an idea. But I don't use subst command, so I am afraid that this may be irrelevant...

Free space of a mounted drive is obtained by FreeDiskSpace measure for host drive because it is equal to that of host drive, right? And used space of mounted drive can be obtained by FolderInfo plugin for substituted folder, I think.

Code: Select all

[mFolderSize]
Measure=Plugin
Plugin=FolderInfo
Folder=(Folder path)
IncludeSubFolders=1
IncludeHiddenFiles=1
IncludeSystemFiles=1
InfoType=FolderSize

Thanks this seemed to work with mounted drives to report the total used space within that folder (i.e. mounted drive). But how do I get the total space or free space for that folder (i.e. mounted drive)?
hunnypuppy
Posts: 5
Joined: September 15th, 2017, 1:52 am

Re: Support for reading disk space on mounted NTFS folder

Post by hunnypuppy »

For what it's worth, I figured out how to show the utilization for a mounted folder using PerfMon. Still looking for a way to get the total size of a folder mounted disk.

Code: Select all

[Variables]
; Variables declared here can be used later on between two # characters (e.g. #MyVariable#).
folder1=C:\MountedFolder
folder1Name=Mount

[MeasureDiskAccess2]
; Measures disk access of the disk drive.
Measure=Plugin
Plugin=PerfMon
PerfMonObject=LogicalDisk
PerfMonCounter=Disk Bytes/sec
PerfMonInstance=#folder1#

[MeterDiskLabel2]
Meter=String
MeterStyle=styleLeftText
X=10
Y=100
W=190
H=14
Text=#folder1Name# Utilization

[MeterDiskAccess2]
Meter=String
MeterStyle=styleRightText
MeasureName=MeasureDiskAccess2
X=200
Y=0r
W=190
H=14
Scale=1048576
;AutoScale=1
Text=%1MB/sec
NumOfDecimals=1
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Support for reading disk space on mounted NTFS folder

Post by mak_kawa »

Hi hunnypuppy

You are saying that subst virtual drive has specific free space other than that of the host drive?

But I think free/total space of a subst drive is almost meaningless, as I have already said, because they are equal to those of the host drive. fsutil volume diskfree (subst drive) from command line is likely to return same values as those for the host drive. Am I right?

Forgive me, if I misunderstood the situation.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Support for reading disk space on mounted NTFS folder

Post by mak_kawa »

It seems to be my misundestanding. What you are saying is mounting drive to a empty folder... Never mind about my previous posts. Sorry! :(
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Support for reading disk space on mounted NTFS folder

Post by Brian »

While this isn't documented anywhere, the FreeDiskSpace does support mounted folders on drives.

I mounted an extra drive F:\ as a folder on my C:\ drive under the folder C:\ZZZ\

Simple test skin:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,150

[Variables]
C=C:\
F=F:\
M=C:\ZZZ\

[C_Used]
Measure=FreeDiskSpace
Drive=#C#
InvertMeasure=1
UpdateDivider=120

[F_Used]
Measure=FreeDiskSpace
Drive=#F#
InvertMeasure=1
UpdateDivider=120

[M_Used]
Measure=FreeDiskSpace
Drive=#M#
InvertMeasure=1
UpdateDivider=120

[C_Total]
Measure=FreeDiskSpace
Drive=#C#
Total=1
UpdateDivider=120

[F_Total]
Measure=FreeDiskSpace
Drive=#F#
Total=1
UpdateDivider=120

[M_Total]
Measure=FreeDiskSpace
Drive=#M#
Total=1
UpdateDivider=120

[Drives]
Meter=String
MeasureName=C_Used
MeasureName2=C_Total
MeasureName3=F_Used
MeasureName4=F_Total
MeasureName5=M_Used
MeasureName6=M_Total
Padding=5,5,5,5
FontColor=255,255,255
Text=#C#	%1B/%2B#CRLF##F#	%3B/%4B#CRLF##M#	%5B/%6B
NumOfDecimals=1
AutoScale=1
AntiAlias=1
Here is what I got:
Mounted.png
-Brian
Post Reply