Using IoGetDeviceInterfaces() with RAID

Hi Everyone,

Our kernel mode, nonPnp driver needs to enumerate the disks in the local computer and collect disk geometry, physical serial number, and volume information. Today, I implemented code that used IoGetDeviceInterfaces() to get a list of disk devices. This code correctly detected all the various disks that I attached to the system (Internal Sata, Internal IDE, USB Sata, USB IDE, USB thumbdrive. So far, so good…

Unfortunately, I don’t have a RAID card in the test computer, so I am hoping that someone can tell me what IoGetDeviceInterfaces() will return for a RAID array? Will it return a single physical device represented by the IO card or will it return information for each drive attached to the IO card? I suspect that it will return a single physical device for the IO card. If this is the case, do you know of any resources that talk about accessing information for each physical disk in a RAID array?

I would really appreciate your help with these questions!

Thanks,
Mike

(SATA Internal)
??\IDE#DiskST3500514NS_____________________________SN11____#5&1714ff57&0&0.0.0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}

(IDE Internal)
??\IDE#DiskWDC_WD800BB-75FRA0______________________77.07W77#6&60d312c&0&0.0.0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}

(USB Sata Drive)
??\USBSTOR#Disk&Ven_Ext_Hard&Prod__Disk&Rev_#ABCDEF0123456789&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}

(USB IDE Drive)
??\USBSTOR#Disk&Ven_FUJITSU&Prod_MHV2080AT_PL&Rev_0083#4F26&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}

(USB Thumb Drive)
??\USBSTOR#Disk&Ven_Crucial&Prod_Gizmo!&Rev_1100#FOOKVULBZCAPO2WYZ1CY&0#

There is a standard for collecting information about the configuration
of storage devices such as raid devices - google CIM and storage. Many
vendors actually implement some or all of it. Of course this is a high
level management interface for system center like applications, not
really for kernel mode stuff. Which means that vendors support the
standard by implementing an agent that talks something proprietary to
their adapters. They also generally provide some sort of vendor
specific CLI for, again from user mode, managing and querying the
configuration of adapters/raid units etc.

Mark Roddy

On Fri, Mar 25, 2011 at 11:16 PM, wrote:
> Hi Everyone,
>
> Our kernel mode, nonPnp driver needs to enumerate the disks in the local computer and ?collect disk geometry, physical serial number, and volume information. ?Today, I implemented code that used IoGetDeviceInterfaces() to get a list of disk devices. ?This code correctly detected all the various disks that I attached to the system (Internal Sata, Internal IDE, USB Sata, USB IDE, USB thumbdrive. ?So far, so good…
>
> Unfortunately, I don’t have a RAID card in the test computer, so I am hoping that someone can tell me what IoGetDeviceInterfaces() will return for a RAID array? ?Will it return a single physical device represented by the IO card or will it return information for each drive attached to the IO card? ?I suspect that it will return a single physical device for the IO card. ?If this is the case, do you know of any resources that talk about accessing information for each physical disk in a RAID array?
>
> I would really appreciate your help with these questions!
>
> Thanks,
> Mike
>
>
> (SATA Internal)
> ???\IDE#DiskST3500514NS ________________________SN11 #5&1714ff57&0&0.0.0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
>
> (IDE Internal)
> ???\IDE#DiskWDC_WD800BB-75FRA0______________________77.07W77#6&60d312c&0&0.0.0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
>
> (USB Sata Drive)
> ???\USBSTOR#Disk&Ven_Ext_Hard&Prod__Disk&Rev
#ABCDEF0123456789&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
>
> (USB IDE Drive)
> ??\USBSTOR#Disk&Ven_FUJITSU&Prod_MHV2080AT_PL&Rev_0083#4F26&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}
>
> (USB Thumb Drive)
> ??\USBSTOR#Disk&Ven_Crucial&Prod_Gizmo!&Rev_1100#FOOKVULBZCAPO2WYZ1CY&0#
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

Disks created by RAID or FC HBAs and iSCSI should appear just fine
with what you currently have. After all, they are controlled by just
another port/miniport model that uses PnP to instantiate disks with the system.

If all you are interested in is the disk information then this is as
far as you need to go. If you want to create some understanding of
which disks are on which bus then you will have to dig deeper and I
would suggest such work would be very much easier in user mode.

Slightly confusing in your question is that you ask about the
physical drives associated with a RAID card. LUNs as logical drives
will just appear as system disks. Knowing what’s behind a RAID card
is something different and probably meaningless in most
circumstances. VDS or CIM would be the mechanisms to use
here. However, asking the same question of a FC HBA or iSCSI is
quite meaningless, the only information to trust is the LUN information.

Mark,

At 03:16 26/03/2011, xxxxx@a-bit-of-help.com wrote:

Hi Everyone,

Our kernel mode, nonPnp driver needs to enumerate the disks in the
local computer and collect disk geometry, physical serial number,
and volume information. Today, I implemented code that used
IoGetDeviceInterfaces() to get a list of disk devices. This code
correctly detected all the various disks that I attached to the
system (Internal Sata, Internal IDE, USB Sata, USB IDE, USB
thumbdrive. So far, so good…

Unfortunately, I don’t have a RAID card in the test computer, so I
am hoping that someone can tell me what IoGetDeviceInterfaces() will
return for a RAID array? Will it return a single physical device
represented by the IO card or will it return information for each
drive attached to the IO card? I suspect that it will return a
single physical device for the IO card. If this is the case, do you
know of any resources that talk about accessing information for each
physical disk in a RAID array?

I would really appreciate your help with these questions!

Thanks,
Mike

(SATA Internal)

??\IDE#DiskST3500514NS_____________________________SN11____#5&1714ff57&0&0.0.0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}

(IDE Internal)

??\IDE#DiskWDC_WD800BB-75FRA0______________________77.07W77#6&60d312c&0&0.0.0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}

(USB Sata Drive)

??\USBSTOR#Disk&Ven_Ext_Hard&Prod__Disk&Rev_#ABCDEF0123456789&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}

(USB IDE Drive)
??\USBSTOR#Disk&Ven_FUJITSU&Prod_MHV2080AT_PL&Rev_0083#4F26&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}

(USB Thumb Drive)
??\USBSTOR#Disk&Ven_Crucial&Prod_Gizmo!&Rev_1100#FOOKVULBZCAPO2WYZ1CY&0#


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Hi Mark & Mark,

Thank you for taking the time to explain my options… I really did not have any idea whether our current code would work in collecting basic information from drives attached to a RAID controller, so your comments have really cleared things up. Next week, I will assemble a test computer with a RAID card so I can experiment.

Thank you again for your help and have a great weekend!

Mike

Just be aware that vendors implement lots of weird options when it comes to storage. IF they use the Microsoft supplied port/miniport model you’ll be fine. OTOH, if a vendor implements their own PORT driver (as at least one large vendor does), you need to hope that port driver does the right thing.

Peter
OSR

>IoGetDeviceInterfaces() will return for a RAID array?

For most RAIDs, the actual physical drives are hidden from the OS, the OS sees only LUNs.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com