SUMMARY: newfs: bytes per inode

From: Robert L. Howard (rhoward@matd.gatech.edu)
Date: Fri Apr 15 1994 - 02:33:15 CDT


My original question:

>Is there any reason the bytes per inode must be a power of
>2? For my news spool, a number like 3072 (2048+1024) would
>be ideal. Can it be done?

The answer appears to be the value can be any number...

Thanks for all the help.
Replies attached,

Robert

------------------Summary Answers----------------------
From: john@oncology.uthscsa.edu (John Justin Hough)
=
= I have never not made that a power of two, but I have changed the
= logical blocksize and the fragsize or addressability to be 512 bytes.
= It worked. I have a filesystem where pretty much every file is about
= 1100 bytes and I wanted to minimize space wasteage.
=
= I've also change the number of cylinders per group for a file system
= with very big files - one file per group. This worked too.

From: hal@yin.UCSD.EDU (Hal Skelly)
=
= There is no real necessity to use powers of 2, it's just convenient. You
= can check inode counts for used and free with the df -i command.

From: Mike Raffety <mike_raffety@il.us.swissbank.com>
=
= The difference in free disk space between 2048 and 4096 is minimal.
= And yes, they must be a power of two, the way the cylinder group
= structures are designed.
= :
= No, I'm pretty sure the kernel would panic. The main difficulty is that
= many filesystem operations require a poer of two, because they're doing
= bit-shifting (e.g., "a << b") for performance reasons.
= :
= My GUESS is that newfs silently rounds or truncates to a power of two.

From: syd@dsinc.myxa.com (Syd Weinstein)
=
= None what so ever. It can be anything, its just a divisor.

From: jayl@lattice.com (Jay Lessert)
=
= newfs' -i flag does not need to be a power of 2. It does, however,
= need to conform to a strange set of rules involving #cyls/cyl group,
= depending on if #sectors/track is even or odd, etc., etc.
=
= You can play with -i using -N carefully watching the resulting
= mkfs command line to see what it is doing. Changing -c to 8
= is sometimes helpful.

From: shankar@ulysses.att.com
=
= Yes! it can be done. In fact, mine is around that, and it pretty
= much balances the inodes and disk space.

From: Eckhard.Rueggeberg@ts.go.dlr.de (Eckhard Rueggeberg)
=
= Yes. Choose ANY number.

From: don@mars.dgrc.doc.ca (Donald McLachlan)
=
= I have always done it as powers of w, but ...
=
= man newfs says ...
=
= -i bytes/inode
= This specifies the density of inodes in the file
= system. The default is to create an inode for
= each 2048 bytes of data space. If fewer inodes
= are desired, a larger number should be used; to
= create more inodes a smaller number should be
= given.
=
= and man mkfs (called by newfs) says
=
= nbpi The number of bytes for which one inode block is allo-
= cated. This parameter is currently set at one inode
= block for every 2048 bytes.
=
= Neither puts any restrictions on this number, why don't you find an
= unused partition and give it a try.

Robert

--
| Robert L. Howard              |   Georgia Tech Research Institute     |
| robert.howard@matd.gatech.edu |   SEAL / ATDD                         |
| (404) 528-7165                |   Atlanta, Georgia  30332             |
-------------------------------------------------------------------------
| "When we are planning for posterity, we ought to remember that virtue |
|  is not hereditary."  -- Thomas Paine                                 |



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:59 CDT