Subject: abusing mfs to make read-only
To: None <>
From: matthew sporleder <>
List: tech-embed
Date: 05/07/2007 23:29:07
In an effort to save my CF card some writes, I added this to my fstab:
/dev/wd0b       /var/run mfs rw,-s1m 0 0
/dev/wd0b       /var/log mfs rw,-s10m 0 0

(I would use tmpfs, but this is 3.1)

and then modified /etc/rc.d/syslogd like so: (in syslogd_precmd())
        #       Touch files in syslog.conf -- MSPO
        if [ -f /etc/syslog.conf ]; then
                awk '{ if (($2 ~ /^\/var/) && ($0 !~ /^#/)) { system("touch " $2
); } }' /etc/syslog.conf
        #       END MSPO
        return 0

This should boot and read from the CF card like normal (I'm not using
a crunchgen here) and then set the only places I write to be in

Can anyone think of another place writes might happen?

Comments appreciated,