Share via


WMI command “ select Name and DeviceID from Win32_Volume” is giving same value for both Name and DeviceID for System Reserved Volume partition.

Question

Sunday, July 21, 2019 2:13 PM

I am trying to get the details of all the partitions of one machine using WMI command. I need Name, Capacity and FreeSpace of each partitions, so used Win32_Volume command but this command is not giving appropriate Name for System Reserved Volume Partition. Name is coming as like this “ \\Volume{0df78724-c412-11e4-80b4-806e6f6e6963}". it is same as DeviceID.

For all other partitions the Name value is proper. But how to get the appropriate human readable name for system Reserved volume.

All replies (10)

Sunday, July 21, 2019 3:14 PM

That is correct. The system reserved and other OEM partitions are  to mounted to the system. They do not have a name. "Name" is the drive letter assigned. Unmounted volumes have a deviceID as the name.

"Get-Volume" will show you the labels on labeled partitions.

\(ツ)_/


Sunday, July 21, 2019 3:16 PM

You can also do this:

Get-WmiObject win32_volume |
     Select-Object label, CApacity, Freespace

\(ツ)_/


Sunday, July 21, 2019 3:53 PM

Is there any WMI command to get the Name of System Reserved Volume as HardDiskVolume1.


Sunday, July 21, 2019 4:07 PM

Is there any WMI command to get the Name of System Reserved Volume as HardDiskVolume1.

What is that? I don't think there is any such thing. A volume is on a partition and a partition is on a physical disk.

\(ツ)_/


Monday, July 22, 2019 8:42 AM

We have used WMI command Win32_PerfFormattedData_PerfDisk_LogicalDisk, that gives Name field value as HardDiskVolume1 for System Reserved Volume. but this command does not give Capacity. 

This command gives  PercentFreeSpace and FreeMegabytes, using the values we can derive the Capacity but if both value are zero when disk space is 100% full we can not derive the capacity. In order to overcome this issue we thought of the using win32_volume wmi command.

WMI command win32_volume is not giving the appropriate name value for system Reserved volume.




Monday, July 22, 2019 10:33 AM

Just use the "Name" to retrieve to volume.

Why not just use the volume.  You seem to be asking a circular question.

\(ツ)_/


Monday, July 22, 2019 11:15 AM

Thank for the reply.

If I understood we can use "Volume" instead of "HardDiskVolume1" after extracting it from the NAME field.

Is there a possibility of multiple system reserved Volume for the same machine?


Monday, July 22, 2019 11:58 AM

Here are some hints for navigating the storage system drives.

# get drive, media and partitions
$diskdrive = Get-WmiObject win32_diskdrive
$diskdrive.GetRelated('Win32_PhysicalMedia')
$diskdrive.GetRelated('win32_diskpartition')

# get logical disks and partition
$logicaldisk = Get-WmiObject Win32_LogicalDisk
$logicaldisk.GetRelated('win32_diskpartition')

# get volume info by matching drive letter to volume name

\(ツ)_/


Monday, July 22, 2019 12:10 PM

You can also do this:

$wmisplat = @{
    Class = 'MSFT_Volume'
    Filter = 'DriveType=3'
    Namespace = 'root\microsoft\windows\storage'
}
Get-WmiObject @wmisplat |
    Select-Object FileSystemLabel, Size, SizeRemaining, UniqueId

\(ツ)_/


Wednesday, July 31, 2019 7:08 AM

Hi,

Was your issue resolved?

If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

If no, please reply and tell us the current situation in order to provide further help.

Best Regards,

Lee

Just do it.