Date: Tue, 13 Mar 2007 15:41:52 -0400 From: John Nielsen <lists@jnielsen.net> To: freebsd-questions@freebsd.org Cc: Steve Franks <stevefranks@ieee.org> Subject: Re: mirror without destroying existing contents Message-ID: <200703131541.52223.lists@jnielsen.net> In-Reply-To: <539c60b90703131212m731986b1p8603a86eca00d6b2@mail.gmail.com> References: <539c60b90703131212m731986b1p8603a86eca00d6b2@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703131541.52223.lists>