tech-embed archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
mount_seed_tmpfs
For running read-only systems I know it's sometimes common to run /var
in a tmpfs/mfs and to seed the files/directories with a tar file at
startup. I have never been a big fan of the tar file idea, so I wrote
mount_seed_tmpfs which will populate a tmpfs filesystem from the disk
before taking over the mount point.
So the command:
mount -t seed_tmpfs -o -s10M /var/log /var/log
will create a (hidden to df) mount of a 10M tmpfs, copy everything
from /var/log to it, and then null mount the hidden tmpfs on-top of
/var/log.
Using it in /etc/fstab is a two step process (mostly for safety)
/var/log /var/log2 seed_tmpfs noauto,rw,-s10M - -
And then in /etc/rc.conf:
critital_local_filesystems="/ /var/log2"
You can find a slightly longer description here:
http://mspo.com/blog/2009/05/netbsd-seedtmpfs-tool-for-easier.html
Or the script:
http://mspo.com/code/mount_seed_tmpfs
Comments welcome,
Matt
Home |
Main Index |
Thread Index |
Old Index