[news.software.b] i-nodes and Cnews

jamesd@techbook.com (James Deibele) (04/08/91)

We'd like to start retaining news for a longer time.  The problem is that
we're running System V R3.2 and the i-node limit for a file-system seems
to be locked around 64K.  I can set higher values, but they don't work.
I've heard that people get around this by patching Cnews so that it will 
recognize directories on different file-systems.

Is there a way of handling this that is more generally accepted than others?
Does it make a difference if the file-system is mounted via NFS?  

I'd think other people would be having problems with this too.  When I first
started out just over a year ago, I had 15 days of news.  Due in part to other
files and directories on /usr, but also to the increased flow, I've cut back
a day about every other month.  I'd really like to get back to about two weeks
(well, with the obligatory knock on alt.romance.chat) worth of news.

Thanks for any help.

--
Public Access UNIX at +1 503 644-8135 (1200/2400) Voice: +1 503 646-8257
TECHbooks offers many technical books at discounted prices.  E-mail to 
info@techbook.com or fax to +1 503 248-6320 for details.

geoff@world.std.com (Geoff Collyer) (04/09/91)

James Deibele:
>we're running System V R3.2 and the i-node limit for a file-system seems
>to be locked around 64K.  I can set higher values, but they don't work.
>I've heard that people get around this by patching Cnews so that it will 
>recognize directories on different file-systems.

If your system supports symbolic links, you don't need to change C News
at all; just mount the other file system(s) in appropriate places (e.g.
under /usr/spool/news, or elsewhere with symbolic links from under
/usr/spool/news).  C News will create symbolic links as necessary under
/usr/spool/news.  You will need to invoke expire with -l though.

If you have a pure System V that lacks symbolic links, help is on the way.
At least one person has already modified C News to copy files to implement
cross-posting.  Something similar will probably become official (though
it's going to make spacefor more complicated).

>Does it make a difference if the file-system is mounted via NFS?  

Yes, you can encounter all the usual problems due to a downed file server
or due to NFS not implementing Unix file system semantics.  If you don't
mind various components of the news system hanging or getting "disk i/o"
errors when a file server goes down, the former is not a problem for
you.  We have tried to deal with the latter, but are rethinking that
decision:  using fsync() to force NFS to report i/o errors is more
expensive than we like, and running relaynews (and possibly the input
subsystem) anywhere but on the machine with the news file systems is
asking for trouble (and will be slow due to synchronous NFS writes).
-- 
Geoff Collyer		world.std.com!geoff, uunet.uu.net!geoff

de5@ornl.gov (Dave Sill) (04/09/91)

In article <1991Apr8.203030.7210@world.std.com>, geoff@world.std.com (Geoff Collyer) writes:
>
>If your system supports symbolic links, you don't need to change C News
>at all; just mount the other file system(s) in appropriate places (e.g.
>under /usr/spool/news, or elsewhere with symbolic links from under
>/usr/spool/news).  C News will create symbolic links as necessary under
>/usr/spool/news.  You will need to invoke expire with -l though.

Why would C News create symbolic links?  If you've symlinked an
additional filesystem under /usr/spool/news, wouldn't it just follow
the symlink and create regular files?  I assume the -l option to
expire is required to make it follow symlinks.

>If you have a pure System V that lacks symbolic links, help is on the way.
>At least one person has already modified C News to copy files to implement
>cross-posting.

How does copying cross-posted articles help?  You're still using an
i-node.  I must be missing something.

-- 
Dave Sill (de5@ornl.gov)	  It will be a great day when our schools have
Martin Marietta Energy Systems    all the money they need and the Air Force
Workstation Support               has to hold a bake sale to buy a new bomber.

henry@zoo.toronto.edu (Henry Spencer) (04/10/91)

In article <1991Apr9.164220.13618@cs.utk.edu> Dave Sill <de5@ornl.gov> writes:
>Why would C News create symbolic links?  If you've symlinked an
>additional filesystem under /usr/spool/news, wouldn't it just follow
>the symlink and create regular files?

You have a slight misunderstanding here; the issue is cross-posted articles,
where the news system tries to make only *one* copy.  In that case, if the
places where links are supposed to be are on different filesystems, it has
to make symbolic links.

>I assume the -l option to
>expire is required to make it follow symlinks.

No, there is no "following" needed; the issue is that expire has to know
that it shouldn't blow away the first link to the article -- because some
or all of the others may be symlinks to that copy -- until all the others
have departed.

>How does copying cross-posted articles help?  You're still using an
>i-node...

On a different file system.
-- 
"The stories one hears about putting up | Henry Spencer @ U of Toronto Zoology
SunOS 4.1.1 are all true."  -D. Harrison|  henry@zoo.toronto.edu  utzoo!henry

geoff@world.std.com (Geoff Collyer) (04/10/91)

Whoa, Dave, let's back up.  The original query was from someone on a
system that lacks symbolic links or any file system type that can support
over 64k inodes per file system (e.g. V7 or pre-SVR4 System V).  He wants
to keep more than 64k news articles on-line at a time.

Traditionally, crossposted articles have been stored as a single file
with multiple links (e.g. "Newsgroups:
comp.unix.wizards,comp.unix.internals" causes an article to be stored as
a file with two links:  /usr/spool/news/comp/unix/wizards/123456 and
/usr/spool/news/comp/unix/internals/324516).  This saves space compared
to making copies.

If C News can't make the necessary (hard) links, it will make symbolic
links instead, on systems that have them (e.g. SVR4, 4BSD, Eunice).  So
on a system that has small i-numbers (typically two bytes) but does have
symbolic links (e.g. V8), one can just mount other file system(s) in
appropriate places (e.g. under /usr/spool/news, or elsewhere with
symbolic links from under /usr/spool/news).  expire -l causes expire to
remove the lexically-first file name only when it is ready to remove the
last of the file names for a given article, since all names but the first
may be symbolic links in such circumstances.

Making copies rather than links wastes space but permits one to use
multiple file systems for /usr/spool/news on systems that lack symbolic
links (or indeed to deal with crossposted articles on systems that lack
any form of links).  This is in the works.
-- 
Geoff Collyer		world.std.com!geoff, uunet.uu.net!geoff

kevin@cfctech.cfc.com (Kevin Darcy) (04/18/91)

In article <1991Apr9.171737.13113@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes:
>In article <1991Apr9.164220.13618@cs.utk.edu> Dave Sill <de5@ornl.gov> writes:
>
>>How does copying cross-posted articles help?  You're still using an
>>i-node...
>
>On a different file system.

Indeed. Maybe this would clarify things:


Script started on Wed Apr 17 18:23:44 1991
$ df -t | sed -n '/news/,$p'
/news     (/dev/dsk/c1t5d0s8):    22584 blocks     5997 i-nodes
                   total:    49920 blocks    6240 i-nodes
/news/spool (/dev/dsk/c1t5d0s9):    41511 blocks     8238 i-nodes
                   total:   347520 blocks   65496 i-nodes
/news/spool/rec (/dev/dsk/c1t5d0sa):    30011 blocks     3340 i-nodes
                   total:   127872 blocks   25568 i-nodes
/news/spool/alt (/dev/dsk/c1t5d0sb):    25770 blocks     5807 i-nodes
                   total:   104064 blocks   20800 i-nodes
$ exit

Script done on Wed Apr 17 18:23:58 1991



See? Each of the spool partitions has up to ~64K inodes. With 3 like this, I
could theoretically store up to ~192K articles (not counting directories, etc.)
With 4 partitions, ~256K, and so on...

Of course, I don't have the space (or the inclination) to store that many 
articles, so I just run 3 partitions, and "comfortable" numbers of inodes for 
each. Still, (65496 + 25568 + 20800 = 111864) inodes is quite a bit to play
with. 

AT&T 3B2/1000 Model 80 running SysVr3.2.2.

>-- 
>"The stories one hears about putting up | Henry Spencer @ U of Toronto Zoology
>SunOS 4.1.1 are all true."  -D. Harrison|  henry@zoo.toronto.edu  utzoo!henry

------------------------------------------------------------------------------
kevin@cfctech.cfc.com 		  | Kevin Darcy, Unix Systems Administrator
...sharkey!cfctech!kevin 	  | Technical Services (CFC)
Voice: (313) 948-4863 		  | Chrysler Corporation
Fax:   (313) 948-4975 		  | 27777 Franklin, Southfield, MI 48034
------------------------------------------------------------------------------

eah@xenitec.on.ca (Ed Hew happily using ksh) (04/22/91)

In article <1991Apr9.211906.20833@world.std.com> geoff@world.std.com (Geoff Collyer) writes:
>	[....]
>If C News can't make the necessary (hard) links, it will make symbolic
>links instead, on systems that have them (e.g. SVR4, 4BSD, Eunice).  So
>on a system that has small i-numbers (typically two bytes) but does have
>symbolic links (e.g. V8), one can just mount other file system(s) in
>appropriate places (e.g. under /usr/spool/news, or elsewhere with
>symbolic links from under /usr/spool/news).
>	[....]
>-- 
>Geoff Collyer		world.std.com!geoff, uunet.uu.net!geoff

....and now for the good news for those of us running SCO SysVr3.2.x
....I have it on reliable authority (he'd strangle me if I mentioned
his name) that SCO has implimented symlinks (and some other goodies)
for their next release of SysVr3.2 .  The bad news is that I don't
think there's a release date yet.  I just know that my patience will
finally be rewarded.  It's nice to get something you explicitly
asked for.  :-)
--
  Ed. A. Hew  <edhew@xenitec.on.ca>,  XeniTec Consulting Services
  or if you're really stuck:  ..!{watmath|lsuc}!xenitec!eah
  [sco.opendesktop newsgroup <=> mlist gateway maintainer]