mirroring two data disks (no system files on them)

Paul Mather paul at gromit.dlib.vt.edu
Sun Apr 24 21:33:09 PDT 2005


On Sun, 2005-04-24 at 22:47 -0400, Jeremy Claeson wrote:
> I'm still confused. I've seen some great emails on some things that
> seem pretty complicated to me, but I've yet to hear from anyone who
> can walk me through what I'm doing wrong. Maybe I'm doing something
> too complicated, can someone let me know that at least? Thanks! Please
> help and thanks in advance!
> 
> On 4/13/05, Jeremy Claeson <jclaeson at gmail.com> wrote:
> > I'm trying to do the same thing but I've not had any luck still. I'm
> > messing up somewhere in preparing the drives. I've got two 250GB
> > drives (ad4 and ad6). I'd like to mirror them as data disks.
> > 
> > Here's what I'm doing:
> > $ /stand/sysinstall
> > (fdisk and label ad4 as /usr/sambashares/data and writing that out to
> > disk. this works and I can access the disk)
> > $ /stand/sysinstall
> > (fdisk ad6 and write that out to disk)
> > $ gmirror label -v -n -b round-robin gm0s1 /dev/ad3s1
> > $ gmirror load
> > (Here everything looks ok but I get a warning:
> > "WARNING: Expected rawoffset 0, found 63"
> > "GEOM_MIRROR: Cannot add disk mirror/gm0s1c to gm0s1 (error=17).")
> > $ gmirror configure -a gm0s1
> > (at this point I get an error that says "Bad address" and then nothing
> > else works.)
> > 
> > [root at epiphyte jclaeson]# ls /dev/ad4* /dev/ad6*
> > /dev/ad4        /dev/ad4s1      /dev/ad4s1c     /dev/ad4s1d     /dev/ad6
> > 
> > [root at epiphyte jclaeson]# ll /dev/mirror/
> > total 1
> > dr-xr-xr-x  2 root  wheel          512 Apr 13 20:19 ./
> > dr-xr-xr-x  5 root  wheel          512 Apr 13 16:13 ../
> > crw-r-----  1 root  operator    4,  30 Apr 13 20:13 gm0
> > crw-r-----  1 root  operator    4,  31 Apr 13 20:13 gm0s1
> > crw-r-----  1 root  operator    4,  31 Apr 13 20:13 gm0s1
> > crw-r-----  1 root  operator    4,  33 Apr 13 20:13 gm0s1c
> > crw-r-----  1 root  operator    4,  33 Apr 13 20:13 gm0s1c
> > 
> > [root at epiphyte jclaeson]# bsdlabel ad4s1
> > # /dev/ad4s1:
> > 8 partitions:
> > #        size   offset    fstype   [fsize bsize bps/cpg]
> >   c: 488392002        0    unused        0     0         # "raw" part,
> > don't edit
> >   d: 488392002        0    4.2BSD     2048 16384 28552
> > 
> > [root at epiphyte jclaeson]# bsdlabel ad6s1
> > bsdlabel: /dev/ad6s1: No such file or directory
> > [root at epiphyte jclaeson]# bsdlabel ad6
> > bsdlabel: /dev/ad6: no valid label found
> > [root at epiphyte jclaeson]#
> > 
> > So, I'm sure I'm preppring the disks wrong, I'm just not sure what I'm
> > doing wrong.

In the above, you shouldn't be trying to bsdlabel the underlying
providers after having created your mirror using them.

Have you tried following the example in the gmirror man page?  If you
want to create a single filesystem covering the entire mirror composed
of entire disks from which you don't need to boot, you can dispense with
a partition table (slice) and even disklabel.  I.e., you can skip fdisk
and bsdlabel (or using sysinstall).  In other words, to create a "data"
mirror on ad4 and ad6, try something like:

  gmirror label -v -b round-robin data ad4 ad6
  newfs -U /dev/mirror/data
  mount /dev/mirror/data /usr/sambashares/data (or wherever)

You can add /dev/mirror/data to /etc/fstab, and add
'geom_mirror_load="YES"' to /boot/loader.conf to have the mirror mounted
automatically at boot.  (Or you can add "options GEOM_MIRROR" to your
kernel config file instead of loading it as a kernel module
via /boot/loader.conf.)

If you have been experimenting with ad4 and ad6, you might want to
dd /dev/zero over the beginning of the drive to get rid of any existing
partition table or disklabel.  You can also use "gmirror clear ad4 ad6"
to clear any existing mirror metadata on there.  If you want to have
multiple file systems on the mirror, you might want to
bsdlabel /dev/mirror/data between the "gmirror label" and newfs
commands.

Cheers,

Paul.
-- 
e-mail: paul at gromit.dlib.vt.edu

"Without music to decorate it, time is just a bunch of boring production
 deadlines or dates by which bills must be paid."
        --- Frank Vincent Zappa


More information about the freebsd-geom mailing list