From owner-freebsd-questions@FreeBSD.ORG Wed Sep 3 14:07:18 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6536916A4BF for ; Wed, 3 Sep 2003 14:07:18 -0700 (PDT) Received: from oahu.WURLDLINK.NET (oahu.wurldlink.net [66.193.144.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5FBBF43FAF for ; Wed, 3 Sep 2003 14:07:17 -0700 (PDT) (envelope-from vince@oahu.WURLDLINK.NET) Received: from oahu.WURLDLINK.NET (vince@localhost.WURLDLINK.NET [127.0.0.1]) by oahu.WURLDLINK.NET (8.12.9/8.12.9) with ESMTP id h83L5COt051233; Wed, 3 Sep 2003 11:05:15 -1000 (HST) Received: from localhost (vince@localhost)h83L5Cvo051230; Wed, 3 Sep 2003 11:05:12 -1000 (HST) Date: Wed, 3 Sep 2003 11:05:12 -1000 (HST) From: Vincent Poy To: Joshua Oreman In-Reply-To: <20030903141048.GC28275@webserver> Message-ID: <20030903105953.X64375-100000@oahu.WURLDLINK.NET> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: questions@freebsd.org Subject: Re: Ghost for FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Sep 2003 21:07:18 -0000 On Wed, 3 Sep 2003, Joshua Oreman wrote: > On Wed, Sep 03, 2003 at 01:12:25PM +0000 or thereabouts, Mark wrote: > > ----- Original Message ----- > > From: "Vincent Poy" > > To: "Mike Tancsa" > > Cc: > > Sent: Wednesday, September 03, 2003 2:22 PM > > Subject: Re: Ghost for FreeBSD > > > > > > > cd /mnt/root > > > /sbin/dump -L -f- /|restore -rf- > > > cd /mnt/var > > > /sbin/dump -L -f- /var|restore -rf- > > > cd /mnt/usr > > > /sbin/dump -L -f- /usr|restore -rf- > > > > I have heard this before, but I never understand this part. :) How does > > creating a /mnt/root directory, and restoring in that directory get my / > > slice back? Then the restored data will just sit in /mnt/root! What good > > does it there? > > > > Or should I create /mnt/root as partition, about equal in size to the root > > partition, and then restore therein, and do the old switcheroo in /etc/fstab > > later, to make it the root partion? > > > > I have successfully restored /var and /usr, on occasion; but that is rather > > easy, as they can be unmounted. With the root partition, that is not > > possible, of course. Short of having to switch cables on harddisks, is there > > a software method that will allow me to restore/switch the root partion? > > To mirror the root partition to another: > # mkdir /mnt/root > # mount /dev/ /mnt/root > # cd /mnt/root > # /sbin/dump -f- / | restore -rf- That was how I did it originally but dump said to add the -L flag for live filesystems so I changed it to: mkdir /mnt/root mount /dev/ /mnt/root cd /mnt/root /sbin/dump -L -f- / | restore -rf- > You will not *need* to umount the root partition. > (If you wanted to hot-swap between them, I'm not sure it's possible on FBSD. > There is a ``pivot_root'' syscall on linux, though.) Yep, I just do it as a script on a nightly basis and kill sendmail before the dump/restore and then later run sendmail automatically after the dump/restore so I don't lose anything in the dump/restore process. I don't think you can hotswap but /stand/sysinstall's disk labeler sure has a way to mount the second drive if you actually put in / and /usr as mountpoints and write it. > To mirror another partition, do mostly the same thing, but replace / > with the partition in the dump line (and make sure the correct > destination is mounted on your current directory for the restore). Yeah, I made the mistake originally when I tested it two days ago and put / for /mnt/usr and I noticed it dump/restore in less than a minute and then realize I forgot to change it to /usr. > Dump/restore is pretty much the accepted way of doing this. One thing I'm trying to figure out is dump will tell you to use -L for a live filesystem but what happens if certain files change on the original slices while it's doing the dump/restore. Cheers, Vince - vince@WURLDLINK.NET - Vice President ________ __ ____ Unix Networking Operations - FreeBSD-Real Unix for Free / / / / | / |[__ ] WurldLink Corporation / / / / | / | __] ] San Francisco - Honolulu - Hong Kong / / / / / |/ / | __] ] HongKong Stars/Gravis UltraSound Mailing Lists Admin /_/_/_/_/|___/|_|[____] Almighty1@IRC - oahu.DAL.NET Hawaii's DALnet IRC Network Server Admin