[comp.unix.ultrix] Getting more Inodes

karl@grebyn.com (Karl Nyberg) (08/02/89)

I need more inodes for my news spool partition.  According to my manual page
for newfs (8) on paper, you use the:

	-i number of bytes per 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.

Well, increasing the number does indeed decrease the number of inodes.
However, decreasing the number, all the way down to 2, has absolutely no
effect whatsoever.  The system continues to make one inode per each 2048
bytes.  Am I missing something here?  Should I really be using mkfs (which
is getting passed the correct parameters, using the -v flag to newfs)?

-- Karl --

grr@cbmvax.UUCP (George Robbins) (08/03/89)

In article <12244@grebyn.com> karl@grebyn.com (Karl Nyberg) writes:
> 
> I need more inodes for my news spool partition.  According to my manual page
> for newfs (8) on paper, you use the:
> 
> 	-i number of bytes per inode
> 
> Well, increasing the number does indeed decrease the number of inodes.
> However, decreasing the number, all the way down to 2, has absolutely no
> effect whatsoever.  The system continues to make one inode per each 2048
> bytes.  Am I missing something here?  Should I really be using mkfs (which
> is getting passed the correct parameters, using the -v flag to newfs)?

There are interdependencies between various of the mkfs parameters such
that mkfs silently changes the supplied parameters when a limit is execeeded.

In particular, there is a limit on the maximum number of inodes per
cylinder group.  Overriding the size of the cylinder groups to make them
smaller will allow you to get more inodes.  I seem to recall that changing
block/frag size parameter will also do this, though perhaps indirectly by
affecting the cylinder group size.

You can verify what you are actually getting by using the dumpfs(8) utility.

See /usr/include/ufs/fs.h for some factoids and the section on the Berkeley
Fast File System in the Supplementary Documentation for added confusion.

-- 
George Robbins - now working for,	uucp: {uunet|pyramid|rutgers}!cbmvax!grr
but no way officially representing	arpa: cbmvax!grr@uunet.uu.net
Commodore, Engineering Department	fone: 215-431-9255 (only by moonlite)

chris@mimsy.UUCP (Chris Torek) (08/04/89)

In article <12244@grebyn.com> karl@grebyn.com (Karl Nyberg) writes:
>I need more inodes for my news spool partition. ... [newfs -i option]
>However, decreasing the number, all the way down to 2, has absolutely no
>effect whatsoever.  The system continues to make one inode per each 2048
>bytes.

I wrote a nice article explaining this problem in response to a message
asking about newfs on Suns, and then forgot to save it.

The short answer is `fixed in 4.3BSD-tahoe; beat on DEC to update their
ufs code; in the meantime, try -c'.

The long answer (rather shortened) is that there is a hardwired limit
of 2048 inodes per cylinder group.  The only way to get around this in
the current system is to make smaller cylinder groups.  This is not
always possible, however, as the rotational layout code depends on
the number of `cylinders per cycle' (essentially, how soon does the
rotational layout pattern repeat) and you cannot lower the number of
cylinders per group below fs_cpc.  fs_cpc is aggravated by disks with
an odd number of sectors---the closer the number of sectors to a power
of two, the lower fs_cpc will be.  In particular, some drives with
67 sectors per cylinder cannot have less than 8 cylinders per group.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris

chris@mimsy.UUCP (Chris Torek) (08/04/89)

In article <18890@mimsy.UUCP> I wrote:
>In particular, some drives with 67 sectors per cylinder

Er, make that `sectors per track'...
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris