Subject: Re: multiple partitions...
To: Michael G. Schabert <mikeride@prez.buf.servtech.com>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: port-mac68k
Date: 04/20/1998 10:55:06
On Sat, 18 Apr 1998, Michael G. Schabert wrote:

> >On Sat, 18 Apr 1998, Michael G. Schabert wrote:
> >
> >	Thats pretty much it - plus 'protecting' partitions from filling up
> >	and causing problems on other partitions (if /var is a separate
> >	partition, then it filling up does not affect /, /usr, /home etc.
> >
> >	The 'classic' method of partitioning a disk would be
> >
> >	/	Kept small and pretty unchanging, the odds are if the
> >		machine crashes badly it will be the least likely to be
> >		damaged, allowing single user boot to fix. (Making /tmp
> >		a symlink to /var/tmp can help).

Also, one reason for this was that (/ != /usr) was that ther had to be a
reboot after fsck'ing teh root partition. Thus if it was small, that
reboot could happen quickly.

Make /tmp a symlink to /var/root_tmp. /tmp is cleaned on reboot, /var/tmp
is not. The things in /var/tmp are supposed to be things which should
survive a reboot and in /tmp are not. Things like vi save files are in
/var/tmp..  Or, make /tmp a ram disk!

> >	/usr	Large partition full of binaries. Since its so much larger
> >		than /, its more susceptable to any crashes.

Nowadays, I'd leave /usr on /, and make /usr/{pkg,pkgsrc,local} seperate
partitions (or links onto another one).

> >	/var	Continually active, most likely to suffer problems if
> >		machine crashes. Also most likely to fill up.
> >
> >	/home	Keeps user data safe from (or from causing problems to)
> >		the system data.

Yep. Basically the idea's to not keep all your eggs in one basket. Only
the partitions which are in write use will get hosed. :-) Plus, esp. w/
/var, an errant program can't fill the whole disk up.

> >	rc does not take care of the root partition as such - it mounts
> >	it read-only. All partitions should be fscked before mounting.
> 
> Yes, this was what I was unaware of...I was thinking "MacOSish" I guess in
> thinking that a volume had to be mounted in order to fix it. I didn't
> realize that fsck doesn't need for it to mount.
> 
> >	The quickest way to get all the local filesystems in single user
> >	mode is to:
> >
> >		fsck -p
> >		mount -va
> 
> 
> OK, I think that I found the problem...remember when there were problems
> with rc when users had to add a / as an argument to the fsck line in rc
> during one of the upgrades? Well, I had left mine so that that line read
> fsck -p /. At the time, you'd get a syntax error without the /, & it'd give
> you the syntax line from man. Since at that time, I only had 1 BSD
> partition, it didn't matter. Now that I have the two, I'll assume that
> leaving it as fsck -p / tells fsck to only check the root partition. I
> changed that line so that it just reads fsck -p, & the next time I boot
> into NetBSD, I'll try to crash the system to test. On that note, anyone
> know a "safe" way to mark a filesystem unclean? I know that I could just
> force fsck to check anyway, but that defeats the purpose of testing my rc
> ;-).

Dig into fsck, and find the datastructure which contains the "dirty" flag.
Then just make a  program to set it, when fed a raw partition. :-)

Take care,

Bill