Tim wrote:
On Mon, 2007-07-09 at 16:57 -0700, John Wendel wrote:
I'm building a new box and I'd like to install the root filesystem on
a compact flash card. Not too hard. But I want / to be read-only, to
avoid premature wear out of the flash.
It seems that I need to use a "union filesystem" that will let me
mount some writable directories (/etc, /var, ???) from another
device.
Another avenue that you might want to explore is changing the mount
options so that nothing is written to the drive unless you intend it.
i.e. Ignoring updating "access times", etc. That lets you keep things
writable, if you'd like to do so.
I don't think you can put /etc/ on another device. But you definitely
can mount /var/ from another location. /var/, /usr/, and few others can
easily be mounted from other drives just the same as they can be on
other partitions on a hard drive.
John,
Another alternative is using a RAMDISK (tmpfs) for those partitions that
you deem writable. Or, you can put the entire / partition in the
RAMDISK (like initrd). On one system I did a read-only CF with a tmpfs
file system for things that changed often, but were not needed across
reboots and minimal bootable initrd, to have a rescue image should
something go wrong with the main CF partition. LILO was used to choose
which to boot.
Generally, /etc does not need to be written very often and depending on
what your system will be used for, you can probably get away with only
/var as writable. If the only things in /var that are changing are the
logs, you can always configure syslog into remote mode.
These embedded system were done several years ago and busybox was the
saving grace to get everything to fit in 256MB CF (big at the time) or
an 8MB initrd (for rescue).
Bob...