mirror without destroying existing contents

Steve Franks stevefranks at ieee.org
Fri Mar 16 15:18:36 UTC 2007


I get the following:

#gmirror label -v -b split -s 1024 data ad0
can't store metadata on ad0: operation not permitted.

Ideas?  Same behavior with /dev/ad0.  Does this only work with da0
disks, not sata drives?  I'm logged in as root, not su.  The drive is
on a promise non-raid sata card (the sw raid chipset on my asus bios
lost support going from 6.1 to 6.2 - something about some new method
not supported by the bios according to Soren).

Thanks,
Steve

On 3/13/07, John Nielsen <lists at jnielsen.net> wrote:
> 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
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>


-- 
Steve Franks, KE7BTE
Staff Engineer
La Palma Devices, LLC
http://www.lapalmadevices.com
(520) 312-0089


More information about the freebsd-questions mailing list