zhengzheng / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Negative used value on smbfsm osx 10.9.1 #484

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Disk usage on my nas (smb) reports used diskspace as negative value. 

What version of psutil are you using? What Python version?
latest psutil. python 2.7.5

On what operating system? Is it 32bit or 64bit version?
OSX 10.9.1 64 bit

Please provide any additional information below.

usage(total=616329322496, used=-3369346490368, free=3985675812864, 
percent=-546.7)
partition(device='//GUEST:@Tower._smb._tcp.local/AUTODOWNLOAD', 
mountpoint='/Volumes/AUTODOWNLOAD', fstype='smbfs', 
opts='rw,nosuid,ignore-ownership')

Original issue reported on code.google.com by Pre...@gmail.com on 24 Feb 2014 at 10:12

GoogleCodeExporter commented 8 years ago
Mmm... you're talking about this, right?

>>> psutil.disk_usage('/Volumes/AUTODOWNLOAD')

That looks like a precision issue. Point is psutil uses os.statvfs() in order 
to determine disk usage so the problem should originate from that (hence it's 
"Python's fault" hehe).

Can you paste the output of "import os; 
print(os.statvfs('/Volumes/AUTODOWNLOAD'))"?

Original comment by g.rodola on 24 Feb 2014 at 10:33

GoogleCodeExporter commented 8 years ago
posix.statvfs_result(f_bsize=1048576, f_frsize=1024, f_blocks=601884104, 
f_bfree=3892261432, f_bavail=3892261432, f_files=4294967295, 
f_ffree=4294967295, f_favail=4294967295, f_flag=2, f_namemax=255)

Original comment by Pre...@gmail.com on 24 Feb 2014 at 10:53

GoogleCodeExporter commented 8 years ago
Problem is f_bavail (available size) which is way higher than f_blocks (total 
size), and that of course doesn't make sense.
I guess os.statvfs() just doesn't work well with SMB filesystems.

Original comment by g.rodola on 24 Feb 2014 at 11:49

GoogleCodeExporter commented 8 years ago
It works fine on my rpi againste the same share. Seems to be a osx issue, I'll 
see if I can tried a older osx version and try there. At least the free size is 
correct :p

Original comment by Pre...@gmail.com on 25 Feb 2014 at 12:15

GoogleCodeExporter commented 8 years ago
The problem only accures with osx against a unraid share (ntfs). The size is 
correct if i mount a physical drive.

Original comment by Pre...@gmail.com on 11 Mar 2014 at 12:01

GoogleCodeExporter commented 8 years ago
Yep, I'd be keen on assuming this is an OSX bug. I guess the best we can do is 
to signal this in the doc. 

Original comment by g.rodola on 11 Mar 2014 at 1:02

GoogleCodeExporter commented 8 years ago
I havnt had the chance to test it on other osx version other then 10.9.1.

Original comment by Pre...@gmail.com on 29 Mar 2014 at 7:22

GoogleCodeExporter commented 8 years ago
psutil has been migrated from Google Code to Github (see: 
http://grodola.blogspot.com/2014/05/goodbye-google-code-im-moving-to-github.html
).
Please do NOT reply here but use this instead:
https://github.com/giampaolo/psutil/issues/484

Original comment by g.rodola on 26 May 2014 at 3:06

GoogleCodeExporter commented 8 years ago
I will assume this is an OSX bug and close this issue.

Original comment by g.rodola on 2 Jan 2015 at 12:33