Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Apr 2005 00:32:59 -0400
From:      Paul Mather <paul@gromit.dlib.vt.edu>
To:        Jeremy Claeson <jclaeson@gmail.com>
Cc:        freebsd-geom@freebsd.org
Subject:   Re: mirroring two data disks (no system files on them)
Message-ID:  <1114403579.78883.80.camel@zappa.Chelsea-Ct.Org>
In-Reply-To: <16a400ac050424194712d4eca0@mail.gmail.com>
References:  <4250A400.50200@videotron.ca> <4250F778.3040903@zvala.cz> <4251F631.3050707@videotron.ca> <20050404213800.A29631@denninger.net> <16a400ac05041317272eb1ea01@mail.gmail.com> <16a400ac050424194712d4eca0@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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@epiphyte jclaeson]# ls /dev/ad4* /dev/ad6*
> > /dev/ad4        /dev/ad4s1      /dev/ad4s1c     /dev/ad4s1d     /dev/ad6
> > 
> > [root@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@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@epiphyte jclaeson]# bsdlabel ad6s1
> > bsdlabel: /dev/ad6s1: No such file or directory
> > [root@epiphyte jclaeson]# bsdlabel ad6
> > bsdlabel: /dev/ad6: no valid label found
> > [root@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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1114403579.78883.80.camel>