Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
First of all, sorry for my english.

I've been writing a code for listing all the partitions of a disk and I've found a problem. The Win32_DiskDrive property "Partitions" of WMI show me that one test disk have 5 partitions, but I only can list four of them (the last two partitions appear as they were only one). These last two partitions are primary, but one is a SWAP partition and the other is a Linux partition, and I think that is the problem.

I hope someone can help me. Thanks to all.
Posted

1 solution

What about the Win32_DiskPartition[^] class? As the Win32_DiskDrive WMI class represents a physical disk drive as seen by a computer running the Windows operating system I am not wondering that you don't see the linux swap partition, since it is not handled by Windows.
 
Share this answer
 
Comments
Gabi Cea 18-Jun-13 14:19pm    
The Win32_DiskPartition property "Partition" tell me that the disk have 5 partitions, but when I use the class Win32_DiskPartition to list them, I can only list 4...
Zoltán Zörgő 18-Jun-13 16:12pm    
It should list all. Have you checked with a professional partition manager to see what exactly do you have? The logical "partition set" might be listed as an additional partition.
Sergey Alexandrovich Kryukov 18-Jun-13 16:20pm    
Correct, a 5.
—SA
Gabi Cea 19-Jun-13 16:27pm    
I looked the partitions using the Windows Disk Management aplication, and it show me 5 partitions... I don´t have used a professional partition manager, but I think It will show me the same.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900