gmirror: replacing failed disks

Christian Hiris 4711 at chello.at
Tue Jan 18 21:56:11 PST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 19 January 2005 05:36, Doug Poland wrote:
> On Tue, Jan 18, 2005 at 09:02:48AM -0600, Doug Poland wrote:
> > >> GEOM_MIRROR: Component ad4 (device gm0s1) broken, skipping.
> > >> GEOM_MIRROR: Cannot add disk ad4 to gm0s1 (error=22).
> > >
> > > You can set 'kern.geom.mirror.debug=2' in /boot/loader.conf. This
> > > tells you more about what happens. I tested all this at a very early
> > > stage of development, so gmirror's behaviour might have changed.
> > > There is also a small chance that some bits in my brain got lost
> > > since I tested his :)
> >
> > I set this while the OS is running.  GEOM_MIRROR responds every 5
> > seconds....
> >
> > GEOM_MIRROR[1]: Disk ad6 (device gm0s1) marked as clean.
> > GEOM_MIRROR[2]: Metadata on ad6 updated.
> > GEOM_MIRROR[1]: Disk ad6 (device gm0s1) marked as dirty.
> > GEOM_MIRROR[2]: Metadata on ad6 updated.
> >
> > Can I get gmirror to attempt to connect to ad4 again?  I tried an
> > atcontrol reinit 2, that didn't do it.  I also tried gmirror rebuild
> > gm0s1 ad4, but gmirror said: "No such provider: ad4".
>
> Sorry to reply to my own post, but when I rebooted the box, this is what
> I see in /var/log/messages concerning gmirror:
>

 ... snip ...

> GEOM_MIRROR[2]: Metadata on ad6 updated. Jan 18 21:07:17 sgwww02 kernel:
> GEOM_MIRROR[1]: Disk ad6 (device gm0s1) marked as dirty. Jan 18 21:07:17
> sgwww02 kernel: GEOM_MIRROR[2]: Metadata on ad6 updated.
>
> and on and on...
>
> Not sure what to do to get gmirror to recogonize this disk.

Hi Doug, seems to me, that when you pulled drive ad4, data on it were damaged. 
Thanks for trying this with ad4 as provider! 

Now simply try to simulate a replacement with a fresh disk, as you would do in 
real life. Please set 'sysctl -w kern.geom.mirror.debug=0' and remove the 
according line from your /boot/loader.config. The procedure below is similar 
to the example in the gmirror manpage, just added 2. and 3. to make ad4 
appear as a fresh disk and re-create the slice ad4s1.         

1.   Let ad6 forget about all other gms01's  providers
     # gmirror forget gms01

2.   Clean up ad4  

2.1. Blank out the first few blocks of ad4
     # dd if=/dev/zero of=/dev/ad4 bs=512 count=128 

2.2. Blank out gmirror metadata on ad4 
     # dd if=/dev/zero of=/dev/ad4 bs=512 skip=156301400

3.   Initialize ad4 and create slize ad4s1
     # fdisk -v -B -I /dev/ad4

4.   Add /dev/ad4s1 to mirror gm0s1
     # gmirror insert gm0s1 /dev/ad4s1

Cheers,
ch 

- -- 
Christian Hiris <4711 at chello.at> | OpenPGP KeyID 0x3BCA53BE 
OpenPGP-Key at hkp://wwwkeys.eu.pgp.net and http://pgp.mit.edu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (FreeBSD)

iD8DBQFB7fZ309WjGjvKU74RAu8bAJ90bGmDZ5WRG+cLWSvnR6dLt+whSgCaAkDS
lNzBZNp+DVOlzNuA30rmKXQ=
=ZPkt
-----END PGP SIGNATURE-----


More information about the freebsd-questions mailing list