Scoket Joe
Scoket Joe

Reputation: 107

How to use C# to confirm a computer has the harddisk raid or not?

Can I use C# to confirm a computer has harddisk raid or not? WMI only can know how many harddisk on the computer. There are no keywords can know the computer has the raid or not.

Upvotes: 1

Views: 1314

Answers (1)

Dai
Dai

Reputation: 155145

Generally speaking, no.

Windows does provide an implementation of software RAID, called "Dynamic Disks", however it is not in common use.

When consumer-grade machines and laptops use RAID, it's usually with a RAID controller built into the motherboard's chipset. In servers and workstations it's often provided by a dedicated add-in card (LSI, Adaptec, etc) which often provides additional functionality such as a large non-volatile cache with a back-up battery, and can connect the computer to an external SAN or Direct Attached Storage system (think: a rack full of HDDs connected with a hefty cable - this isn't eSATA).

In both of these cases, the hardware RAID controller presents the RAID volumes to the OS as generic volumes. An OS does need drivers to use the controllers, but there is no guarantee that the drivers provide the necessary metadata to query RAID status using things like WMI or the Virtual Disk Service. This is the case on all of the Dell PowerEdge servers I operate - they have their own RAID management system that isn't integrated with Windows at all (so poorly, in fact, that I can't stop Windows Server complaining about the Disk caching settings).

But I have a question: why do you care if the user is using RAID volumes or not? Someone could be using RAID0, for example, which provides zero protection (just a performance boost).

You could detect the presence of RAID by checking the controller names against a database of known RAID controllers, but that would require regular maintenance.

Upvotes: 5

Related Questions