Relevance Physical Drives Problem

Hello,
I am having some issue with detecting how many actual physical drives are installed in a system at a given time for reporting purposes. The machine I have in question has two physical drive with a total of three partitions, can someone point me in the right direction with the relevance I should be using? Here is what I got and am getting errors from:
q: number of "fixed_drives"
A: 1
T: 0.032 ms

q: number of drives whose (type of it = “DRIVE_FIXED”)
A: 3
T: 0.162 ms

Actual answer should be two for what I am looking for.

Thank You,
David

Try WMI: (if this is a windows system)

this is the closest I get to the wmi query, and this is the result for a dual physical drive system:
q: number of “Fixed hard disk media” of wmi
A: 1
T: 4.102 ms

That is not a valid WMI query. That is equivalent to:

number of "blah"

As @jgstew mentions wmi may be the only solution here. If you are looking for physical drives its a bit more confusing (this is like physical processors)

The “drives” inspector returns logical drives which could be on a single physical drive.

If its UNIX you are looking for the count of /dev/sda and /dev/sdb etc but the drives we might be seeing are those partitions which are /dev/sda1 and /dev/sdb1 and /dev/sdb2

1 Like

I understand what you are both saying, I guess the better question I should be asking is if there is a way to detect appropriately the number of physical hard drives that are present on a system with out it picking up the partitions, but only the actual physical hard drive count, because I can’t seem to find a way.

Would something like this meet your requirements?

number of selects "DeviceID from Win32_DiskDrive WHERE MediaType = 'Fixed hard disk media'" of wmi

If you remove the number of
selects "DeviceID from Win32_DiskDrive WHERE MediaType = 'Fixed hard disk media'" of wmi

This will report the deviceIDs for those drives.

The captions could also prove useful…
selects "caption from Win32_DiskDrive WHERE MediaType = 'Fixed hard disk media'" of wmi

That first line of relevance that you provided worked like a charm. I am still learning relevance as I am new IBM management software as a whole and this helps me a lot. Also the other lines that you provided I did also find useful. Thank You!

1 Like

Check out these related analyses that have a bunch of different properties related to hard drives. They are very good examples of what is possible.

1 Like