I have a Windows 2008R2 server that's reporting the following error:
The file system structure on the disk is corrupt and unusable. Please
run the chkdsk utility on the volume \Device\HarddiskVolume2.
Using Powershell and WMI how do I identify which volume this is when querying Win32_Volume
.
For example if I do:
Get-WmiObject Win32_Volume
I get a list of all the volumes on the server, however none of the Win32_Volume
class properties use (what appears be) this "friendly" name – \Device\HarddiskVolume2
. I can see there's a DeviceID
property which returns a value like this:
DeviceID : \\?\Volume{4bc3df2a-65c7-11e0-9c33-806e6f6e6963}\
There's also a Name
property but that's just the drive letter assigned to the volume. None of the other properties have a value remotely resembling what is reported in the event log.
I know I could parse the output from fltmc volumes
or DISKPART
to get this information, but there must be a way to obtain this using WMI in a PowerShell script.
I have also looked at the Win32_DiskDrive
, Win32_DiskPartition
and Win32_LogicalDisk
classes but there is no mention of property values resembling \Device\HarddiskVolume2
.
Best Answer
Take a look at this code: http://poshcode.org/4768 it seems to do the conversions you need to see what you want, you might be able to tweak it to fit your needs, let me know if you need help with that but I think you can figure out on your own.