LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux 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
  Search this Thread
Old 03-09-2005, 08:14 PM   #1
Fippy
LQ Newbie
 
Registered: Mar 2005
Posts: 2

Rep: Reputation: 0
/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.
 
Old 03-10-2005, 01:26 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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.
 
Old 03-10-2005, 01:34 PM   #3
Fippy
LQ Newbie
 
Registered: Mar 2005
Posts: 2

Original Poster
Rep: Reputation: 0
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.
 
Old 07-25-2008, 07:21 AM   #4
teluguswan
Member
 
Registered: Oct 2005
Posts: 116

Rep: Reputation: 15
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
 
Old 07-25-2008, 09:17 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

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

BTW: Glad to be of service!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:29 PM.

Main Menu
Advertisement
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
Twitter: @linuxquestions
Open Source Consulting | Domain Registration