From owner-freebsd-questions@FreeBSD.ORG Sat Nov 14 00:02:02 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4192C1065676 for ; Sat, 14 Nov 2009 00:02:02 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from asmtpout012.mac.com (asmtpout012.mac.com [17.148.16.87]) by mx1.freebsd.org (Postfix) with ESMTP id 2B0738FC14 for ; Sat, 14 Nov 2009 00:02:02 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from cswiger1.apple.com ([17.227.140.124]) by asmtp012.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KT2006KHO2ZY780@asmtp012.mac.com> for freebsd-questions@freebsd.org; Fri, 13 Nov 2009 16:01:47 -0800 (PST) Message-id: From: Chuck Swiger To: David Allen In-reply-to: <2daa8b4e0911131554g1e13bdbbh123f52fb2572d5a0@mail.gmail.com> Date: Fri, 13 Nov 2009 16:01:46 -0800 References: <474730.92984.qm@web65506.mail.ac4.yahoo.com> <2daa8b4e0911131448h3444444ag67ad05bbbf7df60@mail.gmail.com> <07E2B7F8-3B7B-4B1C-AE6E-B5219BEDE769@mac.com> <2daa8b4e0911131554g1e13bdbbh123f52fb2572d5a0@mail.gmail.com> X-Mailer: Apple Mail (2.936) Cc: freebsd-questions@freebsd.org, James Phillips Subject: Re: APM X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Nov 2009 00:02:02 -0000 Hi-- On Nov 13, 2009, at 3:54 PM, David Allen wrote: >> I'd consider adding something to /etc/rc.d/mountcritlocal (which >> normally mounts the local filesystems) to setup a RAMdisk on /var and >> then do "rsync -a /var_template /var" (or use a dump/restore or tar >> pipeline). > > At the risk of sounding obtuse while asking for more help, I can work > out the rsync or dump part, but the rest I don't get. The > mountcritremote essentially just does a mount -a -t ..., yes? To > insert a few mdmfs commands followed by rsync commands, for example, > would require re-writing most the script. Is there a better place to > this? Quite possibly. I used NetBSD for a flash-based Soerkris boxes a while back, rather than NanoBSD. It looks like reading /etc/ rc.initdiskless might be informative. > The reason I ask is that some time ago I had a look at nanobsd which > is designed to run on RO flash media. The /var and /tmp directories > are created as memory devices that supposedly get re-populated from a > /cfg directory at boot. Right... > The /usr/src/tools/tools/nanobsd/nanobsd.sh setup script has a > function named setup_nanobsd_etc. Essentially, it writes out an > /etc/fstab file and does a 'touch /etc/diskless'. Unless there's > magic that happens behind the scenes with that /etc/diskless file, I > don't see how anything gets re-populated. The existence of /etc/diskless means /etc/rc runs /etc/rc.initdiskless: % grep diskless /etc/rc dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` if [ ${dlv:=0} -ne 0 -o -f /etc/diskless ]; then sh /etc/rc.initdiskless # Run these after determining whether we are booting diskless in order # to minimize the number of files that are needed on a diskless system, Regards, -- -Chuck