Subject: re: Cached file system -- summary and /usr [second attempt]

From: [email-masked] (Philip Ross)
Date: Wed, 26 Jan 1994 08:58:07 +0000

There was a nice summary describing the use of cachefs under Solaris 2.3
from [email-masked] (John Caywood) on 20th Jan on this newsgroup.

One of the things stated in the message was that the cachefs cannot be used
for /usr. This is NOT true (even if Sun say it cannot be done it seems to
work just fine). I agree it doesn't work during startup but any time after
the system has booted a command such as the following overlay mounts /usr 
(eg. from a script in /etc/rc3.d)

mount -O -F cachefs -o ro,backfstype=nfs,cachedir=/export/cache/cache1 hyacinthus:/export/exec/Solaris_2.3_sparc.all/usr /usr

The important option seems to be -O so that it can hide the /usr mount
point used during booting.

Is there some reason why I shouldn't do this that will make me regret it?
It certainly eliminates the NFS READs leaving just the GETATTRs quite
nicely (once the cache has run for a bit).

any comments?

/----------------------------------------------------------------------------\
| Philip Ross, Computer Officer | email: [email-masked]              |
| Dept. Bio-Medical Physics     |    or  [email-masked]               |
| University of Aberdeen        |                                            |
| Foresterhill                  | [+44]-224-685645               (Fax)       |
| Aberdeen.  AB9 2ZD            | [+44]-224-681818 x53210        (Voice)     |
|----------------------------------------------------------------------------|
| 3 is not equal to 2, not even for large values of 2.                       |
\----------------------------------------------------------------------------/

---

From: [email-masked] (Casper H.S. Dik)
Date: 26 Jan 1994 10:06:16 GMT

>nicely (once the cache has run for a bit).

The reason why cachefs cannot be used for /usr on boot is that
the cachefs mount programs are missing.  The mount programs for
each fs are in /usr/lib/fs/<fstype>.  When /usr isn't mounted,
you can't mount /usr.

Why do nfs, hsfs and ufs mount work for /usr?  Simple:  there is
an extra set of statically or semi-staically linked mount programs in
/etc/lib/fs/<fstype>, but only for ufs, hsfs and nfs.

To get cachefs to mount at boot you need:

	- lofs mount
	- cachefs mount

Unfortunately, people don't have statically linked cachefs and lofs mount
programs.  My guess is that you can cachefs mount /usr as soon as you have
mounted /usr.  The sooner the better, or you'll be having two copies
of a number of programs/shared libraries running around.
(From daemons before and daemons/programs started after the cachefs mount)

Casper