After checking the prerequisites ("Prerequisites for Maintaining DiskSuite Objects"), the overview ("Overview of Replacing and Enabling Slices in Mirrors and RAID5 Metadevices"), and the preliminary information ("Preliminary Information For Replacing and Enabling Slices in Mirrors and RAID5 Metadevices"), use the metadetach(1M), metaclear(1M), metatinit(1M), and metattach(1M) commands to replace an entire submirror.
# metastat d20 d20: Mirror Submirror 0: d21 State: Okay Submirror 1: d22 State: Needs maintenance ... # metadetach -f d20 d22 d20: submirror d22 is detached # metaclear d22 d22: Concat/Stripe is cleared # metainit d22 2 1 c1t0d0s2 1 c1t0d1s2 d22: Concat/Stripe is setup # metattach d20 d22 d20: components are attached |
The metastat command confirms that the two-way mirror d20 has a submirror, d22, in the "Needs maintenance" state. In this case, the entire submirror will be cleared and recreated. The metadetach command detaches the errored submirror from the mirror using the -f option (this forces the detach to occur). The metaclear command clears the submirror. The metainit command recreates submirror d22, with new slices. The metattach command attaches the rebuilt submirror, and a mirror resync begins automatically.
You temporarily lose the capability for data redundancy while the mirror is a one-way mirror.