mirror without destroying existing contents

John Nielsen lists at jnielsen.net
Fri Mar 16 16:08:45 UTC 2007

On Friday 16 March 2007 11:18, Steve Franks wrote:
> I get the following:
> #gmirror label -v -b split -s 1024 data ad0
> can't store metadata on ad0: operation not permitted.

That most likely means that you currently have a filesystem on ad0 mounted. If 
that's the case you should be glad that the OS was smarter than you. What 
steps had you taken prior to this?

> 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).

Gmirror should work with any GEOM provider, and definitely works with SATA 
disks. As long as your controller is supported to the point of seeing and 
accessing the disks connected to it the software raid support is irrelevant 
(that's what you're using gmirror for).


> 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.

More information about the freebsd-questions mailing list