LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   /proc/partitions disk usage (https://www.linuxquestions.org/questions/linux-general-1/proc-partitions-disk-usage-299814/)

Fippy 03-09-2005 08:14 PM

/proc/partitions disk usage
 
I am trying to use /proc to programatically obtain equivalent data to that found via "df".

I can't seem to find out Blocks Used and Available from anywhere in /proc.
None of my research seems to explain what all those esoteric fields in /proc/partitions are, and if they are related to disk usage.

Does anyone know where "df" gets Used and Available from please?

Thanks,
Fippy.

druuna 03-10-2005 01:26 PM

Hi,

Guess you are using a 2.6 kernel?

Take a look here for an explanation of all the fileds:

https://www.redhat.com/archives/fedo.../msg01010.html

df gets its info by calling, among others, the statfs function (man statfs for more info). Run strace df to see for yourself.

Hope this helps.

Fippy 03-10-2005 01:34 PM

Thanks, I always wondered what all those fields are. I'm using Kernel 2.4 actually.

Alas, that data still doesn't get me disk partition usage stats. :(
I don't think /proc has that info.
The best I have come up with is to use /proc/partitions and /etc/mtab to get a list of partitions and then cycle through each doing a statfs.

Thanks for your help.
Fippy.

teluguswan 07-25-2008 07:21 AM

Quote:

Originally Posted by druuna (Post 1522026)
Hi,

Guess you are using a 2.6 kernel?

Take a look here for an explanation of all the fileds:

https://www.redhat.com/archives/fedo.../msg01010.html

df gets its info by calling, among others, the statfs function (man statfs for more info). Run strace df to see for yourself.

Hope this helps.


thanks for the link of redhat very good information about this

druuna 07-25-2008 09:17 AM

Hi,

@teluguswan: Nice to see that people actually read 'old' threads :)

BTW: Glad to be of service!


All times are GMT -5. The time now is 05:55 AM.