列出所有磁盘分区 [英] Listing all disk partitions

查看:127
本文介绍了列出所有磁盘分区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,对不起我的英语。



我一直在写一个代码来列出磁盘的所有分区,我发现了一个问题。 WMI的Win32_DiskDrive属性Partitions向我显示一个测试磁盘有5个分区,但我只能列出其中的四个(最后两个分区只显示一个)。最后两个分区是主分区,但一个是SWAP分区,另一个是Linux分区,我认为这就是问题。



我希望有人可以提供帮助我。谢谢大家。

解决方案

Win32_DiskPartition [ ^ ]课程?由于 Win32_DiskDrive WMI类表示运行Windows操作系统的计算机所看到的物理磁盘驱动器我不想知道您没有看到linux交换分区,因为它不是由Windows处理的。

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.

解决方案

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.


这篇关于列出所有磁盘分区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆