How do I correlate logical drives and physical disks in C#?

436 Views Asked by At

I'm struggling to understand how to link the information of logical drives (C:, D:\ etc) is on which physical drive (HDD, SATA, NVMe etc).

I'm able to pull the information separately using ManagementObject queries of both MSFT_PhysicalDisk and Win32_LogicalDisk classes but combining the two accurately is proven a real head scratcher.

A quick google threw up that I needed to use Win32_DiskDriveToDiskPartition and Win32_LogicalDiskToPartition classes but reading them just made my head hurt more. Any help would be appreciated but I'm basically after a way to show both class information side by side accurately:

ie:

  • C:\ is an SSD
  • D:\ is an NVMe
  • E:\ is an HDD

Cheers!

0

There are 0 best solutions below