gmirror re-insert disk into array

I've a machine with two drives mirrored using gmirror. When I moved it recently one of the SATA cables must have been dislodged as the array is now marked as DEGRADED, and only one drive is found.
Code:
# gmirror status
      Name    Status  Components
mirror/gm0  DEGRADED  ad4
Unfortunately, I didn't catch this immediately so the disconnected drive is several days out of sync.
My question is this: after I restart the machine (changing cables & connectors and making sure both drives are found), can I just issue the following:
Code:
gmirror insert gm0 /dev/ad3
Will gmirror know to rebuild ad3 from ad4 as ad4 is the only drive in the array?
 
always take a look in the manual pages!

man gmirror

there is a example section too

---

if ad3 is empty i would proceed like written in the manpage or

http://www.freebsd.org/doc/en/books/handbook/geom-mirror.html
19.4.3 Recovering From Disk Failure

---

But if it still contains data, i would disconnect ad3 and after boot up run

Code:
gmirror forget gm0

--

after shutdown and reconnecting ad3 boot again and run

Code:
gmirror insert gm0 /dev/ad3
 
Aha, I had spotted the forget command that in the man page but was a little wary of using it as the example specified "One disk failed. Replace it with a brand new one", which in my case isn't true as the drive still has data on it. Of course, that irrelevant as insert ad3 will rebuild from ad4.
My (unfounded) worry was that gmirror could use ad3 as the disk to sync from.
 
:) well "forget" sounds a bit dramatic. first time i used it i was confused too.

Code:
forget      Forget about components which are not connected.  This com-
                 mand is useful when a disk has failed and cannot be recon-
                 nected, preventing the remove command from being used to
                 remove it.
 
Back
Top