On 2009-05-11, David Walker <davidianwal...@gmail.com> wrote:
> I have an ALIX (one of those little x86 boxes).
> As it uses CF as storage (limited read/write cycles) I want to mount
> it read only.

I use a bunch of CF based systems, and mount most of them read-write.
I've done so for years, and haven't had any problems as a result.

I've got a 64MB card that was written regularly for 5+ years that
still works (decommissioned as the motherboard it was attached to
died).

I've had cards fail, but mostly after just a month or two, and other
identical cards bought at the same time in the same conditions (similar
number of write/erase cycles) have been totally ok, so I'm putting that
down to individual bad cards.

I mount read-only on some machines to avoid fscks: for remote systems
where untrained staff might need to power-cycle or if I'm worried about
power failure. That's the only reason.

> As OpenBSD writes information to disk during normal use I would like
> to mount as much as possible in RAM (mfs) so that normal operation
> continues.
> For instance during boot, unless I mount /dev in RAM I get a whole
> bunch of error messages (a whole bunch). :]
> Also the pf log spits errors at me quite regularly - no surprises there.
>
> Originally I mounted /dev and /var in RAM with the following (cat fstab):
> /dev/wd0a / ffs rw 1 1
> swap /dev mfs rw,-P=/populate/dev,-s=16384 0 0
> swap /var mfs rw,-P=/populate/var,-s=32768 0 0
> swap /tmp mfs rw,-s=16384 0 0
>
> Hey I solved my first problem (I think).
> I was going to ask how to populate (-P) the mfs mounts without having
> to duplicate the original directories on my CF (/populate).
> I think I could populate them straight from the original directories. :]

If it were some other filesystem, you could mount once, cp, umount,
then mount under the different path. Not really an option for a ramdisk
which is destroyed at umount time though...

I keep two copies of /dev, one in /dev (for single-user boots etc),
and one in /dev_src which is used to populate the MFS. At upgrade time
you need to copy the new MAKEDEV in, and re-run it.

You can have a smaller /dev if you adjust the -i value. e.g.
swap /dev mfs rw,nosuid,-s=4096,-i=1024,-P=/dev_src 0 0

> Anyway, are there other ways to populate mfs mounts with system files?
> Is there any way to mount only the specific files I need?
> For instance if I never use a specific log file is there any way to
> not mount it?

No.

You could adjust the path of some file in syslog.conf and
newsyslog.conf though. There is also the option of using a circular
memory-buffer for logs, see syslogd(8) -s, syslogc(8), syslog.conf(5),
but you probably need to write to some other things in /var (e.g.
/var/run, /var/tmp; they could be symlinks though).

At least if a file is never used, it's not going to take a lot of
space on the ram disk :-)


_______________________________________________
Openbsd-newbies mailing list
Openbsd-newbies@sfobug.org
http://mailman.theapt.org/listinfo/openbsd-newbies

Reply via email to