mount_seed_tmpfs
matthew sporleder <[email protected]> Sat, 9 May 2009 15:52:47 -0400
| Newsgroups | gmane.os.netbsd.devel.embedded |
|---|---|
| Message-ID | <[email protected]> |
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