/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. |
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, 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. |
Quote:
thanks for the link of redhat very good information about this |
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. |