NFS v2 works okay, but statvfs won't tell me about inodes

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

NFS v2 works okay, but statvfs won't tell me about inodes

sthaug@nethelp.no
Today I switched our F330 from NFS v3 to v2, since it's being used as
a News spool and can't really do anything useful with the extra NFS v3
info.

I got a nasty surprise when I found out that the Solaris 2.5.1 statvfs
system call no longer returned number of inodes. In fact the fields

        u_long  f_files;        /* total # of file nodes (inodes) */
        u_long  f_ffree;        /* total # of free file nodes */
        u_long  f_favail;       /* # of free nodes avail to non-superuser */

are all set to 4294967295 (ie. -1) on return from statvfs. When I was
using NFS v3, these fields had sensible values on return from the call.

I can of course telnet to the NetApp and check the number of inodes
directly, but I'd like to do it from the Solaris box which feeds the
NetApp with news articles. Any good suggestions?

Steinar Haug, Nethelp consulting, sthaug at nethelp.no


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

NFS v2 works okay, but statvfs won't tell me about inodes

Bruce Sterling Woodcock
> I can of course telnet to the NetApp and check the number of inodes
> directly, but I'd like to do it from the Solaris box which feeds the
> NetApp with news articles. Any good suggestions?

I ran into the situation running inn on our Solaris machine, because it
tries to do a df -i on the spool directory.  They changed df so that it
won't allow -i at all on an NFS mounted filesystem!  I never tried a
statvfs call directly to see if that would work... I had assumed it
wouldn't work for v3 either.

I just commented out the df -i check in inn and made sure I had enough
inodes on the filer.  I didn't pick a *huge* value, but about double what
I needed.  Inodes don't take up a whole lot of space when compared to the
overall filesystem, although a really big inode file can become a
performance consideration.  You seem to be using some other program
that calls statvfs directly (i.e. a C program)... unfortunately, that
won't work for v2 at all.

One possibility would be using a script to rsh to the filer from the
news server and parse the df -i output...

Bruce

--
Bruce Sterling Woodcock ------ Systems Administrator ][ sterling at netapp.com
Network & Systems Administration - Network Appliance ][ sterling at netcom.com


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

NFS v2 works okay, but statvfs won't tell me about inodes

sthaug@nethelp.no
> > I can of course telnet to the NetApp and check the number of inodes
> > directly, but I'd like to do it from the Solaris box which feeds the
> > NetApp with news articles. Any good suggestions?
>
> I ran into the situation running inn on our Solaris machine, because it
> tries to do a df -i on the spool directory.  They changed df so that it
> won't allow -i at all on an NFS mounted filesystem!  I never tried a
> statvfs call directly to see if that would work... I had assumed it
> wouldn't work for v3 either.

Well, it does - as long as you call statvfs directly with your own
program, of course.

> I just commented out the df -i check in inn and made sure I had enough
> inodes on the filer.  I didn't pick a *huge* value, but about double what
> I needed.

Yes, this is what I'm currently doing.

Steinar Haug, Nethelp consulting, sthaug at nethelp.no


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

NFS v2 works okay, but statvfs won't tell me about inodes

Guy Harris
> Well, it does - as long as you call statvfs directly with your own
> program, of course.

Or if you use "/usr/bin/df" rather than "/usr/ucb/df" - Sun don't appear
to have "improved" the standard SV "df" command not to report on inodes
on NFS-mounted file systems the way they "improved" the
BSD-compatibility "df" command.  (Of course, it reports -1 on V2-mounted
file systems, as the V2 protocol is busted and has no way of allowing a
server to report to a client the number of free inodes, but it works, as
far as I know, on V3-mounted file systems.)

> > I just commented out the df -i check in inn and made sure I had enough
> > inodes on the filer.  I didn't pick a *huge* value, but about double what
> > I needed.
>
> Yes, this is what I'm currently doing.

One could also possibly mount the file system twice - once with V2 and
once with V3 - and use the V2-mounted file system for all but checks for
free inodes and use the V3-mounted file system for the latter.  (You
probably want to avoid accessing *files* on both file systems, as the
client won't know that file XXX on one NFS mount is the same as file XXX
on another NFS mount, and could get confused.)


Loading...