LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Thread Tools
Old 03-09-2005, 09:14 PM   #1
Fippy
LQ Newbie
 
Registered: Mar 2005
Posts: 2
Thanked: 0
/proc/partitions disk usage


[Log in to get rid of this advertisement]
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.
Fippy is offline     Reply With Quote
Old 03-10-2005, 02:26 PM   #2
druuna
Senior Member
 
Registered: Sep 2003
Location: netherlands
Distribution: lfs
Posts: 3,269
Thanked: 78
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.
druuna is offline     Reply With Quote
Old 03-10-2005, 02:34 PM   #3
Fippy
LQ Newbie
 
Registered: Mar 2005
Posts: 2
Thanked: 0

Original Poster
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.
Fippy is offline     Reply With Quote
Old 07-25-2008, 08:21 AM   #4
teluguswan
Member
 
Registered: Oct 2005
Posts: 107
Thanked: 0
Quote:
Originally Posted by druuna View Post
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
teluguswan is offline     Reply With Quote
Old 07-25-2008, 10:17 AM   #5
druuna
Senior Member
 
Registered: Sep 2003
Location: netherlands
Distribution: lfs
Posts: 3,269
Thanked: 78
Hi,

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

BTW: Glad to be of service!
druuna is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/proc/stat file problem for cpu usage arunka Programming 2 06-20-2009 11:49 PM
/proc/partitions showing wrong partitions netstv Linux - General 1 07-10-2006 02:11 PM
Comuting CPU usage from /proc ziggyboy Linux - Software 1 09-27-2004 01:52 PM
Calculating total %cpu usage from /proc/stat gaijin Programming 1 07-07-2004 03:45 AM
finding cpu usage with /proc breadcrust Programming 16 06-18-2004 06:53 PM


All times are GMT -5. The time now is 09:31 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration