Subject: Re: shared/readonly root filesystem
To: Ignatios Souvatzis <ignatios@theory.cs.uni-bonn.de>
From: Todd Vierling <tv@pobox.com>
List: port-arm32
Date: 09/25/1998 13:00:38
On Fri, 25 Sep 1998, Ignatios Souvatzis wrote:

: given this little sharkpool here, and before I reinvent the safety match:
: 
: Is there any ready-to-use recipe to set up a mostly- or totally-shared-root-fs
: given NetBSD_current as base?

Yes.  That was in fact used in the original Shark distros, and here's a
rundown of how that worked.

You can share /, as long as IP and hostname are obtained automatically
(you'll probably need to use the hostname to select an appropriate
net-swap via swapfile or somesuch).  What you will need to do is:

- tar up /var as a skeleton into /etc/var.tar.gz and clean it out:
  cd /export/shark/var; tar czf ../etc/var.tar.gz *; rm -rf *

- make /var be a mfs partition in the /etc/fstab of the clients; for
  simplicity, you can symlink the client's /tmp to /var/tmp so that it's all
  mfs and cleaned on boot.

- extract /etc/var.tar.gz into /var after explicitly mounting /var in
  netstart.local, for example:

##### netstart.local begin #####
if [ -f /etc/var.tar.gz ]; then
        mount /var
        chmod 755 /var
        tar -C /var -xzpf /etc/var.tar.gz
fi
##### netstart.local end #####

- make sure all machines have different swap (if they have swap at all).
  typically, you could put something in rc.local such as:

##### begin #####
if [ -f /swapfiles/`hostname` ]; then
	swap -a /swapfiles/`hostname`
fi
##### end #####

These come from my own Shark configuration, which is running -current as of
Aug 18.

-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)