-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different output of psutil.disk_partitions() vs psutil.disk_io_counters(perdisk=True) with respect to disk/device naming #942
Comments
Mmm that's weird. Can you paste the actual output? |
Here is the output of an interactive Python session on my PC :
Notice two things :
I actually have two harddrives in use |
That's by design. Windows only lets you query IO counters based on physical disk, not partitions. And yes, |
I think it would make more sense if device would be something like PhysicalDrive0 on Windows.
I.e. it comes close to the documented example from Linux where device looks like „sda" when the partition/volume is "/dev/sda1"
When looking at the mounted partitions/volumes using standard Windows tools ( e.g. "Disk Management" or „diskpart" )
its obvious that the tool is able to link the partition/volume with a named device.
… That's by design. Windows only lets you query IO counters based on physical disk, not partitions.
That is, if PhysicalDrive0 has two partitions, C:\ and D:\ (as is your case), you cannot filter IO activity only for C:\ or D:.
And yes, device and mountpoint on Windows are always the same string.
Maybe we can change that so the instead of device='C:\\' you get device='PhysicalDrive0', although I'm not sure whether it's possible.
|
Looking back at this. I agree |
@giampaolo any update on this front? |
Nope, I looked into it for a while and I don't know how to do it. |
On Windows 7 / Python 3.4 64bit the output of calls to
psutil.disk_partitions()
and
psutil.disk_io_counters(perdisk=True)
differs with respect to the underlying device / disk / drive information.
I.e.
psutil.disk_partitions()
returns device like "C:\"but
psutil.disk_io_counters(perdisk=True)
returns disk key "PhysicalDrive0".From OS perspective both are the same - but from user perspective there is no obvious connection between device "C:\" and disk "PhysicalDrive0".
It would be nice if
disk_partitions()
anddisk_io_counters(perdisk=True)
would use the same naming for the device / drive / disk, e.g. PhysicalDrive0Looking at the package documentation of those two methods it seems the output is more misleading under Windows than under e.g. Linux.
The documentation uses e.g. device='/dev/sda1' and disk key 'sda1'.
Which looks similar but is still not the same !?
The text was updated successfully, but these errors were encountered: