From owner-freebsd-questions Tue Feb 19 10: 0:14 2002 Delivered-To: freebsd-questions@freebsd.org Received: from blues.hodgsonhouse.com (blues.hodgsonhouse.com [24.72.10.211]) by hub.freebsd.org (Postfix) with ESMTP id 94FF037B402 for ; Tue, 19 Feb 2002 10:00:02 -0800 (PST) Received: by blues.hodgsonhouse.com (Postfix, from userid 500) id 973E47F5D0; Tue, 19 Feb 2002 11:58:20 -0600 (CST) Date: Tue, 19 Feb 2002 11:58:20 -0600 From: Tillman Hodgson To: Kris Kennaway Cc: freebsd-questions@freebsd.org Subject: Re: /altroot? Message-ID: <20020219115820.B30854@hodgsonhouse.com> References: <20020218162141.A27310@hodgsonhouse.com> <20020219084644.A97852@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020219084644.A97852@xor.obsecurity.org>; from kris@obsecurity.org on Tue, Feb 19, 2002 at 08:46:44AM -0800 X-Editor: Vim Rocks! http://www.vim.org X-Mailer: Mutt Rocks! http://www.mutt.org Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Feb 19, 2002 at 08:46:44AM -0800, Kris Kennaway wrote: > On Mon, Feb 18, 2002 at 04:21:42PM -0600, Tillman Hodgson wrote: > > Howdy, > > > > Does FreeBSD have built-in functionality similar to OpenBSDs /altroot? > > It might help if you explained what this is. Sure. From OpenBSD's /etc/daily: # If ROOTBACKUP is set to 1 in the environment, and # if filesystem named /altroot is type ffs, on /dev/* and mounted "xx", # use it as a backup root filesystem to be updated daily. [ "X$ROOTBACKUP" = X1 ] && { rootdev=`awk '$2 == "/" && $1 ~ /^\/dev\// && $3 == "ffs" && \ $4 ~ /rw/ \ { print substr($1, 6) }' < /etc/fstab` rootbak=`awk '$2 == "/altroot" && $1 ~ /^\/dev\// && $3 == "ffs" && \ $4 ~ /xx/ \ { print substr($1, 6) }' < /etc/fstab` [ X$rootdev != X -a X$rootbak != X ] && { sync echo "" echo "Backing up root filesystem:" echo "copying /dev/r$rootdev to /dev/r$rootbak" dd if=/dev/r$rootdev of=/dev/r$rootbak bs=16b seek=1 skip=1 \ conv=noerror fsck -y /dev/r$rootbak } } I could add that as a script in /etc/periodic/daily, but I'd prefer to use built-in functionality rather than duplicate it if it exists. - Tillman -- Write clearly - don't sacrifice clarity for "efficiency". - The Elements of Programming Style (Kernighan & Plaugher) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message