I'd like to know where on a linux system, information about the amount of free disk space is stored. Ultimately I'd like to parse this for use in a program.
I know I can see this info by just typing df, but I'd now love to find out how that program finds out about the free disk space.
For a while, I thought this info might be stored in /proc/partitions:
Code:
~>cat /proc/partitions
major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq
3 0 39082680 ide/host0/bus0/target0/lun0/disc 8947 18132 216204 54330 1395 830 17944 1240 -1 1221250 41762912
3 1 10241406 ide/host0/bus0/target0/lun0/part1 7 0 49 30 0 0 0 0 0 30 30
3 2 1 ide/host0/bus0/target0/lun0/part2 0 0 0 0 0 0 0 0 0 0 0
3 5 514048 ide/host0/bus0/target0/lun0/part5 1 0 8 10 0 0 0 0 0 10 10
as I have no idea what the rio, rmerge and all following feilds mean. But then I disovered that on some systems these aren't there:
Code:
~>cat /proc/partitions
major minor #blocks name
8 0 120627360 sda
8 1 120624021 sda1
8 16 120627360 sdb
So obviously the information must be stored somewhere else.
Anyone know the answer?
Any replies most appreciated,
--Matt