Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Jan 2005 14:14:14 -0600
From:      Doug Poland <doug@polands.org>
To:        questions@freebsd.org
Subject:   gmirror: replacing failed disks
Message-ID:  <20050116201414.GA76014@polands.org>

next in thread | raw e-mail | index | archive | help
Hello,

I've got a bootable gmirror running on identical SATA drives on
5.3-STABLE.  The technique I've used to build the gmirror can be found
on http://people.freebsd.org/~rse/gmirror, under the heading "GEOM
mirror Approach 2: Single Slice, Preferred, More Flexible".  Now I'd
like to experiment with replacing a "failed" drive.  This particular box
has hot-swappable drives, so all I need to do is pull a drive out while
the box is running.  

The man page states:

   One disk failed. Replace it with a brand new one:

           gmirror forget data
           gmirror insert data da1

(My system has a provider gm0s1 with ad4 and ad6 as consumers, so I'll
use those device names)

Simulate ad4 failing:

pull the drive
put the drive back in, reboot if necessary to detect drive

# gmirror forget gm0s1
# dd if=/dev/zero of=/dev/ad4 bs=512 count=79

# size=`fdisk ad6 | grep ', size ' | head -1 | sed -e 's;^.*size \([0-9]*\).*$;\1;'` (echo "p 1 165 63 $size"; echo "a 1") | fdisk -v -B -f- -i /dev/ad4
  OR 
# fdisk -v -B -I /dev/ad4

# gmirror insert gm0s1 /dev/ad4s1

(Now wait two hours for the drives synchronize)

That should work, yes?  How does gmirror know about /dev/ad4s1 if that
drive was previously unformatted or brand new?


-- 
Regards,
Doug



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