Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Oct 2009 14:04:45 +0100
From:      krad <kraduk@googlemail.com>
To:        Nick Barnes <nb@ravenbrook.com>
Cc:        freebsd-questions@freebsd.org, Ravenbrook SysAdmins <sysadmins@ravenbrook.com>
Subject:   Re: how does gmirror start up?
Message-ID:  <d36406630910130604v5fd627ech201ddf87ff4c4b98@mail.gmail.com>
In-Reply-To: <59889.1255436565@thrush.ravenbrook.com>
References:  <59889.1255436565@thrush.ravenbrook.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2009/10/13 Nick Barnes <nb@ravenbrook.com>

> I am running a 6.3 system and have had various problems with disk
> reliability on a key filesystem, probably down to SCSI hardware or
> drivers.  I'm intending to replace that SCSI disk with a pair of SATA
> disks ad6/7, using gmirror as gm0 (while keeping ad4 as our boot
> disk).  I have set up the mirror and right now I'm part-way through
> using rsync to transfer the data.  But I have a question concerning
> the underlying operation of GEOM, which is troubling me.  I have read
> the various man pages and handbook pages relating to GEOM and gmirror,
> but they don't seem to answer this.
>
> When I reboot the system, gmirror comes up (because of the line in
> /boot/loader.conf) and gm0 appears, backed by ad6/7.  Where is this
> configuration information stored?  That is, how does the system know
> to make gm0, with ad6/7 as the backing store.
>
> I would expect there to be a file somewhere in /etc with this config
> information, but I don't see it in the documentation.  From reading
> gmirror(8), I understand that there is a label sector at the ends of
> ad6 and ad7, identifying them as parts of gm0.  But that config
> information is back-to-front: at boot time the system knows from
> /etc/fstab that it needs gm0; how does it find the underlying disks?
>
> Does the system search the ends of all physically-attached disks,
> looking for GEOM labels, and automatically make any corresponding GEOM
> devices?  Surely not (that would mean, for instance, that if I took
> one of these disks out of this machine and put it into another FreeBSD
> system then that machine would automatically set up gm0 with this
> disk).
>
> Possibly I'm just being dense.  Can someone enlighten me?
>
> Nick Barnes
> Ravenbrook Limited
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscribe@freebsd.org"
>


you are right there is a label at the end of the disk, and if you put the
drives in another machine with another gmirror enabled box it would see the
mirror. If you stack geom classes then the label it stored at the end of the
container as if it were a disk. eg if you used gjournal on top of gmirror.

Its a very common practise for hardware controllers as well. The dell perc
controllers definitely have this labelling as you can import foreign configs
into the cards nvram from disk



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