[comp.arch] R/O root

matt@oddjob.UChicago.EDU (Java Man) (01/15/88)

In article <22611@hi.unm.edu> kurt@hi.unm.edu (Kurt Zeilenga) writes:
) We use symbolic links from /etc to /usr/etc so that root is "static".   Could
) you use them instead of modifying files?

If I were out to set up a r/o root, I'd make a r/o /usr also - there
are even more seldom-modified files there.

In fact, when some disks died around here and I had to turn this
standalone machine into a server quickly, I made a few symlinks and
let the bereaved clients mount my /usr read-only.
________________________________________________________
Matt	     University		matt@oddjob.uchicago.edu
Crawford     of Chicago     {astrovax,ihnp4}!oddjob!matt

david@elroy.Jpl.Nasa.Gov (David Robinson) (01/19/88)

Having just recently learned of Sun's reorganizing of its disk layout
for filesystems in SunOS 4.0, they do allow you to mount both / and
/usr as read-only filesystems.  The root has been striped of all
"dynamic" or machine dependant files. Most of /etc went to either
/usr/etc or a seperate directory tree for machine specific stuff.  By
doing this the root is only 1 megabyte and may be mounted read-only.

You could put this into ROM but for other reasons I would hesitate from
doing this. As mentioned before, upgrades would be painful.
-- 
	David Robinson		elroy!david@csvax.caltech.edu     ARPA
				david@elroy.jpl.nasa.gov	  ARPA
				{cit-vax,ames}!elroy!david	  UUCP
Disclaimer: No one listens to me anyway!

guy@gorodish.Sun.COM (Guy Harris) (01/19/88)

> Having just recently learned of Sun's reorganizing of its disk layout
> for filesystems in SunOS 4.0, they do allow you to mount both / and
> /usr as read-only filesystems.  The root has been striped of all
> "dynamic" or machine dependant files. Most of /etc went to either
> /usr/etc or a seperate directory tree for machine specific stuff.  By
> doing this the root is only 1 megabyte and may be mounted read-only.

WRONG.  "/usr" may have been stripped of all dynamic stuff; however, much of it
got moved *to* the root file system.  All of the *programs* in "/etc" went to
"/usr/etc"; all of the configuration files stayed in "/etc", and some moved
from "/usr/lib" to "/etc" (e.g., "sendmail.cf".)  Directories such as
"/usr/spool", "/usr/adm", etc.  that might want to live on "/" if they don't
get too big or that might want to live on their own file system if they *do*
get big moved to "/var"; symbolic links have been left in the old places so
that references to "/usr/adm/messages", etc.  still work.

You could, perhaps, arrange to make "/" a read-only file system by making
"/etc" and "/var" both refer to some third read-write file system and by
changing "/etc/rc.boot" not to make "/" a read-write file system (the kernel
mounts it read-only, and only once it's passed "fsck" is it remounted
read-write), but I don't think we plan to guarantee this or support it.
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy@sun.com

faustus@ic.Berkeley.EDU (Wayne A. Christopher) (01/19/88)

How can all the programs in /etc be moved to /usr/etc?  How can you even
mount /usr unless you have /etc/mount?  (Or do you put that in /bin?)

	Wayne

jin@hplabsz.HPL.HP.COM (Tai Jin) (01/20/88)

If the root filesystem is mounted read-only, will pipes continue to work?

idc@cs.hw.ac.uk (Ian Crorie) (01/20/88)

In article <5247@elroy.Jpl.Nasa.Gov> david@elroy.Jpl.Nasa.Gov (David Robinson) writes:
>Having just recently learned of Sun's reorganizing of its disk layout
>for filesystems in SunOS 4.0, they do allow you to mount both / and
>/usr as read-only filesystems.  

Well I've always thought that *all* file systems should
be read only.   Think of the performance improvements
that would follow, not to mention never having to worry
about 100% full /usr/users partitions.

(;-)

ron@topaz.rutgers.edu (Ron Natalie) (01/21/88)

Sure, in addition to having rootdev and swapdev defines, one only needs
to add pipedev.

-Ron

garyb@hcx1.SSD.HARRIS.COM (01/22/88)

> If the root filesystem is mounted read-only, will pipes continue to work?

What variant of unix are you using?  Most SystemV-like unix's I have seen
allow the specification of a "pipedev" which is the filesystem that will be
used for pipe space (inodes and such).  The BSD systems I have seen use
the kernel socket routines to implement pipes.  I know of no Unix that
requires that the root file system be used for pipe space, althogh I'm sure
someone out there will enlighten me...

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| Gary Barton                             |  ..from the home of the HCX..    |
| Software Development                    | Harris Computer Systems Division |
+-----------------------------------------+----------------------------------+
| garyb@hcx1.ssd.harris.com               | 2101 W. Cypress Creek Rd.        |
| {uunet,cbosgd,mit-eddie}!hcx1!garyb     | Ft. Lauderdale. FL 33309         |
| {mtune,gatech}!codas!novavax!hcx1!garyb | (305) 974-1700                   |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

chris@mimsy.UUCP (Chris Torek) (01/24/88)

[I have redirected followups to comp.unix.wizards.]

>>If the root filesystem is mounted read-only, will pipes continue to work?

In article <93900011@hcx1> garyb@hcx1.SSD.HARRIS.COM writes:
>[Some Unix variants use] a "pipedev" [to define] the filesystem that
>will be used for pipe space (inodes and such).  The BSD systems I have
>seen [these are 4.2BSD and later --Chris] use the kernel socket routines
>to implement pipes.  I know of no Unix that requires that the root
>file system be used for pipe space ....

While those systems that have a pipedev, which include all 2BSDs,
3BSD, 4.0BSD, 4.1BSD, V6, V7, 32V, System III, and some System Vs
[*], in principle (by the very fact that they provide a pipedev)
allow pipes to be stored on a different file system, I suspect any
such usage was rare.  If you make pipedev != rootdev on such a
system, you will not be able to create pipes until the pipe device
is mounted.  On the other hand, this would reduce the activity on
the root, and hence the chance of something untoward occuring
there.

At any rate, when we ran 4.1BSD, we always had pipedev == rootdev.

-----
[*] System V variants would be much easier to name if we just
peeled off the `System V' part of the label and left the *real*
name showing:  `That Vax runs System 2.2 Unix' is more wieldy
than `That Vax runs System V Release 2 Version 2 Unix'.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris

mangler@cit-vax.Caltech.Edu (Don Speck) (01/29/88)

In article <14227@oddjob.UChicago.EDU>, matt@oddjob.UChicago.EDU (Java Man) writes:
> If I were out to set up a r/o root, I'd make a r/o /usr also - there
> are even more seldom-modified files there.

A pair of my vaxen have had a read-only /usr on a dual-ported
disk since 1985.  It's a pain to update, though; every couple
of months they come down to bring their /usr into sync with the
vax that has /usr/src.

Mounting read-only is the price of dual-porting.  I dual-ported
it because /usr is 200 MB (/usr/font and /usr/local are HUGE).

Don Speck   speck@vlsi.caltech.edu  {amdahl,ames!elroy}!cit-vax!speck
		  ^^^^ vax with read-only /usr