Unix Technical Forum

Diff. between f_bavail & f_bfree in statfs sys call??? (need a method to find the fs reserved space)

This is a discussion on Diff. between f_bavail & f_bfree in statfs sys call??? (need a method to find the fs reserved space) within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hi gurus, I would like to the know the diff between the following two elements of the statfs structure ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 02:48 AM
Raj
 
Posts: n/a
Default Diff. between f_bavail & f_bfree in statfs sys call??? (need a method to find the fs reserved space)

Hi gurus,

I would like to the know the diff between the following two elements
of the statfs structure in AIX...

fsblkcnt_t f_bfree; /* free block in fs */
fsblkcnt_t f_bavail; /* free blocks avail to non-superuser
*/

In AIX, both elements have the same value. But in other UNIX versions,
such as Solaris & HP_UX, they differ by a few megabytes. So that
difference amount gives me the filesystem sapce reserved for the
superuser.

Is there any reason for this behaviour in AIX?

I am in need of calculating the file system space reserved for
superuser in AIX. Is there any other method of getting it?

Any pointers on this topic would be helpful.

TIA!

Cheers
Raj.

PS: attaching statfs structure for a reference!

---------------------------

/*
* file system statistics
* NOTE: f_version is UNUSED NOW, but should be set to 0!
* NOTE: all other reserved fields should be cleared by the vfs
implementation
*/
struct statfs {
int f_version; /* version/type of statfs, 0 for now
*/
int f_type; /* type of info, zero for now */
ulong_t f_bsize; /* optimal file system block size */
fsblkcnt_t f_blocks; /* total data blocks in file system */
fsblkcnt_t f_bfree; /* free block in fs */
fsblkcnt_t f_bavail; /* free blocks avail to non-superuser
*/
fsfilcnt_t f_files; /* total file nodes in file system */
fsfilcnt_t f_ffree; /* free file nodes in fs */
#if !defined(_KERNEL) && defined(__64BIT__)
fsid64_t f_fsid; /* file system id */
#else
fsid_t f_fsid; /* file system id */
#endif
int f_vfstype; /* what type of vfs this is */
ulong_t f_fsize; /* fundamental file system block size
*/
int f_vfsnumber; /* vfs indentifier number */
int f_vfsoff; /* reserved, for vfs specific data
offset */
int f_vfslen; /* reserved, for len of vfs specific
data */
int f_vfsvers; /* reserved, for vers of vfs specific
data */
char f_fname[32]; /* file system name (usually mount
pt.) */
char f_fpack[32]; /* file system pack name */
int f_name_max; /* maximum component name length for posix */
};
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 02:49 AM
Stephane Gassies
 
Posts: n/a
Default Re: Diff. between f_bavail & f_bfree in statfs sys call??? (need a method to find the fs reserved space)

Hi Raj,
under AIX, there is no "root-reserved" disk space.
The value is then allways 0.
Regards,
Stephane

Raj a écrit:
>
> Hi gurus,
>
> I would like to the know the diff between the following two elements
> of the statfs structure in AIX...
>
> fsblkcnt_t f_bfree; /* free block in fs */
> fsblkcnt_t f_bavail; /* free blocks avail to non-superuser
> */
>
> In AIX, both elements have the same value. But in other UNIX versions,
> such as Solaris & HP_UX, they differ by a few megabytes. So that
> difference amount gives me the filesystem sapce reserved for the
> superuser.
>
> Is there any reason for this behaviour in AIX?
>
> I am in need of calculating the file system space reserved for
> superuser in AIX. Is there any other method of getting it?
>
> Any pointers on this topic would be helpful.
>
> TIA!
>
> Cheers
> Raj.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 02:49 AM
Raj
 
Posts: n/a
Default Re: Diff. between f bavail & f bfree in statfs sys call??? (need a method to find the fs reserved space)

> Hi Raj,
> under AIX, there is no "root-reserved" disk space.
> The value is then allways 0.
>


Hi Stephane,

Thanks for your reply. Is there a way to allocate some space reserved
for root while creating a file system?

The reserved space is zero for the file systems that are created with
default values. So if there is a way to mention the reserved size
during an fs creation, I can chek it out.

TIA!

Cheers
Raj.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-05-2008, 02:50 AM
Stephane Gassies
 
Posts: n/a
Default Re: Diff. between f bavail & f bfree in statfs sys call??? (need a method to find the fs reserved space)

Hi again, Raj,

As I wrote, there is no root-reserved disk space.
That is why you cannot allocate space reserved for root.
AIX does not allow root-only access to a reserved part.

Just forget it under AIX.

Raj a écrit:
>
> > Hi Raj,
> > under AIX, there is no "root-reserved" disk space.
> > The value is then allways 0.
> >

>
> Hi Stephane,
>
> Thanks for your reply. Is there a way to allocate some space reserved
> for root while creating a file system?
>
> The reserved space is zero for the file systems that are created with
> default values. So if there is a way to mention the reserved size
> during an fs creation, I can chek it out.
>
> TIA!
>
> Cheers
> Raj.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com