1

When I run:

>>> psutil.disk_usage('/')
sdiskusage(total=451000901632, used=11184947200, free=77055238144, percent=12.7)

Used is totally wrong compared to what my laptop about page says, as well as used + free != total

What do each of these separate columns actually refer to?

TIA

andriy
  • 105
  • 2
  • 8

1 Answers1

3

The documentation states:

total, used and free space expressed in bytes, plus the percentage usage

The documentation also details some quirks that could lead to surprising results.

For Python 3, this is available as shutil.disk_usage, with the same units.

Joe
  • 29,416
  • 12
  • 68
  • 88