From owner-freebsd-questions@FreeBSD.ORG Fri Nov 13 23:54:09 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 E3C1E106566C for ; Fri, 13 Nov 2009 23:54:09 +0000 (UTC) (envelope-from the.real.david.allen@gmail.com) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mx1.freebsd.org (Postfix) with ESMTP id B9A558FC1A for ; Fri, 13 Nov 2009 23:54:09 +0000 (UTC) Received: by pzk15 with SMTP id 15so2559116pzk.3 for ; Fri, 13 Nov 2009 15:54:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=CThJKrT9XH30udhmsTo6Au4ffkVJlWMwCQDQAbMnykk=; b=bvt0W5NLU7lY0jGYSHXIko5rEQs0L2ER9YO47NYkzeS2oIMWXGtgyKO+o4C09zw5sE 8dX19esWm7xpi/pFUlfB9Wj549njo6VaPSqIRpZRqfyXGUAcy5fq0LdkrSNXC72I2t3+ RK+8afxQDSzynWxcuQJThwI5mCNSKvPupdKyQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Ypoy33NobfYPEQqGyoJ99oHHuZ/W4dPrykDR3829NiJWo9aQbDIC5+rK1V++TTnede fz0elw9FrAiWWfBNjThCObW6I7JV2ivDkc5Ti6IwGsN139GHw/GUOisn2zXZfHL68rpT cSscus5fhiShRbdVMrGOqOCTTrGyVsPgdMG04= MIME-Version: 1.0 Received: by 10.142.5.29 with SMTP id 29mr536490wfe.75.1258156449366; Fri, 13 Nov 2009 15:54:09 -0800 (PST) In-Reply-To: <07E2B7F8-3B7B-4B1C-AE6E-B5219BEDE769@mac.com> References: <474730.92984.qm@web65506.mail.ac4.yahoo.com> <2daa8b4e0911131448h3444444ag67ad05bbbf7df60@mail.gmail.com> <07E2B7F8-3B7B-4B1C-AE6E-B5219BEDE769@mac.com> Date: Fri, 13 Nov 2009 16:54:09 -0700 Message-ID: <2daa8b4e0911131554g1e13bdbbh123f52fb2572d5a0@mail.gmail.com> From: David Allen To: Chuck Swiger Content-Type: text/plain; charset=ISO-8859-1 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: Fri, 13 Nov 2009 23:54:10 -0000 On 11/13/09, Chuck Swiger wrote: > Hi, David-- > > On Nov 13, 2009, at 2:48 PM, David Allen wrote: >> There are options available in /etc/defaults/rc.conf to do just that, >> but how does one copy over the contents of /var at system boot? > > 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? 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. 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. Put simply, I'm stuck somewhere between that script and your suggestions thus far. Thanks.