Out of inodes. SunOS4.0, gripe.

Gregory N. Bond gnb at bby.oz
Mon Aug 7 16:13:18 AEST 1989


In article <FLEE.89Aug4114513 at shire.cs.psu.edu> flee at shire.cs.psu.edu (Felix Lee) writes:
   Ran out of inodes yesterday on our /usr/spool partition.  A painful
   experience.  C News is mostly graceful in the presence of full disks,
   but does nothing to protect you from running out of inodes.

   We ran out of inodes because the best we can get from SunOS4.0.3 on
   these huge NEC disks we have is one inode per 6.25kbytes.  If you
   average less than 6.25kbytes per file you run out of inodes before you
   run out of disk space.  Pretty silly.

   The reason it's 6.25kbytes per inode is the (historical) maximum
   inodes per cylinder group is 2048, and cylinder groups are 14mbytes.
   Cylinder groups are that large because, (a) there are 27 * 67 sectors
   per cylinder, (b) there are 16 sectors per block, therefore (c) you
   need 16 cylinders to fit an even number of blocks without wastage.

   Unworkarounds are (a) decrease block size (SunOS wants at least 8K),
   (b) increase MAXIPG from 2048 (no kernel source), (c) allow wastage in
   cylinder groups (ditto).

   Workarounds?  Right now we're expiring news at a (relatively) furious
   rate.  The filesystem is at 65% capacity and using 85% of the inodes.

I hit this problem last week, on SunOs 3.5 and CDC Sabre-V 1.2Gb disk.
Our workaround: Lie to /etc/mkfs about the disk geometry.  Everything
still works, but the optimisations in the file system don't optimise
quite as well.  No noticable speed difference on this site.

First, do /etc/newfs on the disk, with -v option.  This tells you what
the mkfs command is, something like
      /etc/mkfs -N /dev/rrf0a 49800 83 15 8192 1024 16 10 60 2048 t 0
				  ^  ^  ^
which is 83 sectors, 15 heads for our disk.  If either of these was
even, divide by two, and you automagically get twice the number of cyl
groups and twice the number of inodes with virtually no performance
loss (as the kernel thinks each physical cyl is two logical cyls). 

In our case, we lied a little differently and said
      /etc/mkfs -N /dev/rrf0a 49200 41 15 8192 1024 16 10 60 2048 t 0
which lost 600 Blocks (300K) but still doubled the inode count.  This
is not a perfect 2-1 mapping, so the optimisation in the filesystem
won't be as effective, but its better than expire -e 4!  It's been
going a few days, including 3Mb of news in, no problems.  It's quite
safe, as the device-driver interface is in abs blockno terms, not
head/cyl/sect; the info is only used by mkfs in determining the layout
of cylinder groups and superblocks on the partition.

Lest you distrust me on this, I got the info from Robert Elz
(kre at munnari.oz.au) who posted this answer in comp.sys.sun a while
ago.  He knows.  (Check the /etc/passwd file on the 4.3 tape).

Greg.
--
Gregory Bond, Burdett Buckeridge & Young Ltd, Melbourne, Australia
Internet: gnb at melba.bby.oz.au    non-MX: gnb%melba.bby.oz at uunet.uu.net
Uucp: {uunet,pyramid,ubc-cs,ukc,mcvax,prlb2,nttlab...}!munnari!melba.bby.oz!gnb



More information about the Comp.unix.wizards mailing list