From owner-freebsd-questions@FreeBSD.ORG Tue Mar 13 19:42:06 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 08F9816A400 for ; Tue, 13 Mar 2007 19:42:06 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from ns1.jnielsen.net (ns1.jnielsen.net [69.55.238.237]) by mx1.freebsd.org (Postfix) with ESMTP id D56CC13C480 for ; Tue, 13 Mar 2007 19:42:05 +0000 (UTC) (envelope-from lists@jnielsen.net) Received: from localhost (jn@ns1 [69.55.238.237]) (authenticated bits=0) by ns1.jnielsen.net (8.12.9p2/8.12.9) with ESMTP id l2DJg4Xl079101; Tue, 13 Mar 2007 15:42:05 -0400 (EDT) (envelope-from lists@jnielsen.net) From: John Nielsen To: freebsd-questions@freebsd.org Date: Tue, 13 Mar 2007 15:41:52 -0400 User-Agent: KMail/1.9.5 References: <539c60b90703131212m731986b1p8603a86eca00d6b2@mail.gmail.com> In-Reply-To: <539c60b90703131212m731986b1p8603a86eca00d6b2@mail.gmail.com> X-Face: #X5#Y*q>F:]zT!DegL3z5Xo'^MN[$8k\[4^3rN~wm=s=Uw(sW}R?3b^*f1Wu*.<=?utf-8?q?of=5F4NrS=0A=09P*M/9CpxDo!D6?=)IY1w<9B1jB; tBQf[RU-R<,I)e"$q7N7 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200703131541.52223.lists@jnielsen.net> X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on ns1.jnielsen.net X-Virus-Status: Clean Cc: Steve Franks Subject: Re: mirror without destroying existing contents 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: Tue, 13 Mar 2007 19:42:06 -0000 On Tuesday 13 March 2007 15:12, Steve Franks wrote: > Anyone made a mirror w/o destroying what's in the disk already? The > atacontrol man page is less than adequate in this respect...is is even > possible? If you want to use gmirror (which I recommend), the most conservative approach is as follows. This can probably be adapted to other mirroring techniques/software as well. Verify that your backups are up-to-date and reliable. Create a "degraded" single-member mirror on the blank disk (or a partition/slice on said disk). (gmirror label command) Make sure that the size of the disk/slice/partition is equal to or smaller than the size of the disk/slice/partition which already contains your data. Create (a) new filsystem(s) on the new mirror. (newfs and possibly bsdlabel, depending on how/if you want to break it up) Transfer your data from the existing filesystem to the new filesystem (dump/restore -- it's easier than it sounds). (Alternative: restore from the backup you created to begin with.) Verify data transfer, make relevant changes to /etc/fstab, possibly other intermediate steps. Destroy the original filesystem (possibly using dd and /dev/zero) (not strictly necessary, but wiping at least the first part of the disk/slice/partition can help avoid potential confusion (for you and the system) later.) Insert the original disk/slice/partition into your new mirro (gmirror insert command). This approach can take longer than some others (due to the transfer requirement), but the finished product is less likely to contain surprises. I have successfully used this approach to migrate several types of volumes to gmirror sets, including boot partitions. JN