From owner-freebsd-questions@FreeBSD.ORG Thu May 27 06:40:54 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4441D106564A for ; Thu, 27 May 2010 06:40:54 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 9490C8FC19 for ; Thu, 27 May 2010 06:40:53 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-0.2, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_50 0.80) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: o4R6Li1A002768 Received: from kobe.laptop (77.49.120.100.dsl.dyn.forthnet.gr [77.49.120.100]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-9.1) with ESMTP id o4R6Li1A002768 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 27 May 2010 09:21:50 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.4/8.14.4) with ESMTP id o4R6LcOK005198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 27 May 2010 09:21:38 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.4/8.14.4/Submit) id o4R6Lcfg005195; Thu, 27 May 2010 09:21:38 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Steve Bertrand References: <4BFDD9EC.4090801@ipv6canada.com> Date: Thu, 27 May 2010 09:21:37 +0300 In-Reply-To: <4BFDD9EC.4090801@ipv6canada.com> (Steve Bertrand's message of "Wed, 26 May 2010 22:33:16 -0400") Message-ID: <87bpc1yidq.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "questions@freebsd.org" Subject: Re: Cloning question 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: Thu, 27 May 2010 06:40:54 -0000 On Wed, 26 May 2010 22:33:16 -0400, Steve Bertrand wrote: > I've written a few "howto"'s on backup/restore/cloning in the past, but > now I have a question that I hope to have quickly answered. > > I'm not looking for criticism on my approach, only on whether it will > work. With that said, I'll lay out my scenario and my questions. > > Scenario: > > - live web server (300 domains), shut the box down and booted up a copy > of the system on new hardware > > - changed the normal system items (nic, fstab etc) > > - new box is running fine under old system, but I need to transfer the > old system data (all of it...*all* data) to the new disk sub-structure > > - new box has RAID card, but not compatible w/FBSD > > - new box has had RAID card disabled, so new disks show up as standard > adX drives > > Questions: > > - while running the 'new' box under the 'old' system, can I: > --- atacontrol create RAID1 ad4 ad6 > --- fdisk > --- label: to items under /mnt, as to prepare for copy > > - stop all services (or go into single-user), and dump each slice from > orig to new > > ...if so, please advise of the dump command that I'd be using. > > Normally I'd use rsync, but this situation can sustain some downtime to > ensure a complete and utter mirror. If you want to use dump/restore to copy the root partition from ad0s1a to ad4s1a you can use: # newfs -L NEWROOT /dev/ad4s1a # mount -t ufs /dev/ufs/NEWROOT /mnt # cd /mnt # dump -0auL -C 32 -f - / | restore -rf - When this is run in single-user mode, the partiion mounted at /mnt should have a copy of the root filesystem. Repeat the dump-restore pipe for other filesystems, e.g.: # newfs -L NEWDATA /dev/ad4s2a # mount -t ufs /dev/ufs/NEWDATA /mnt/data # cd /mnt/data # dump -0auL -C 32 -f - /data | restore -rf - # newfs -L NEWHOME /dev/ad4s3a # mount -t ufs /dev/ufs/NEWHOME /mnt/home # cd /mnt/home # dump -0auL -C 32 -f - /home | restore -rf - ... When you have dumped all your filesystems to properly mounted graft points under /mnt, update /mnt/etc/fstab and boot the new disk.