Subject: Re: Tips for prolonging solid state drives?
To: Chris Wareham <chriswareham@chriswareham.demon.co.uk>
From: Geert Hendrickx <ghen@telenet.be>
List: netbsd-users
Date: 12/17/2007 13:51:11
On Mon, Dec 17, 2007 at 09:47:38PM +0000, Chris Wareham wrote:
> matthew sporleder said on 17/12/07 15:32:
> >
> >I'm using mfs for /var/log and don't have too many problems with it.
> >I had to trick some stuff into touching files before apps would work,
> >but it wasn't that bad.
> >
> >http://www.mspo.com/netbsdreadmostly.html
> >
> >Also follow the notes I make in there about:
> >http://mail-index.netbsd.org/tech-embed/2007/06/12/0000.html  <--
> >read-only stuff.
> >
> >Right now I'm working on cleaning up /var/spool and will update my
> >article when I do.
> >
> 
> Hi Matthew,
> 
> Thanks for the links. I now have /tmp, /var/run and /var/log mounted as
> mfs filesystems as per your notes. At boot up, syslogd complains about
> not being able to write to /var/log despite a critical_filesystems_local
> entry in /etc/rc.conf, but everything seems OK. I plan on digging
> through /etc/defaults to see if syslogd starting up can be delayed until
> all filesystems have been mounted.


Putting this in /etc/rc.conf.d/dhcpd is a cleaner solution:

lease_db=/var/run/${name}.leases
required_files="/etc/${name}.conf"
start_precmd="dhcpd_precmd"

dhcpd_precmd()
{
	if [ ! -f ${lease_db} ]; then
		touch ${lease_db}
	fi
}


I use this on my Soekris NET4501 router together with some of the other
suggestions (/tmp and /var/run on tmpfs, /var rw and / ro), but I send
syslog messages to a remote host.

	Geert