How to change a failed disk on a mirrored volume – Veritas Storage

14 08 2008

Title in portuguese: “Como substituir um disco falho em um volume espelhado – Veritas Storage”.

In this article I will show how to change a failed disk on a Veritas Mirrored volume.

In this example we are assuming the VolM volume as a mirrored volume composed by two disks.

The volume is active and synch. We will simulate a physical failure in a disk that composes this mirrored volume.

We will replace this failed disk and synch the volume with a new disk.

To check that the volume is Active and Synch:

bash-3.00# vxprint
v  VolM         –            ENABLED  ACTIVE   20480    SELECT
pl VolM-01      VolM         ENABLED  20480    -        ACTIVE   –       -
sd c1t1d0-02    VolM-01      ENABLED  20480    0        -        -       -
pl VolM-02      VolM         ENABLED  ACTIVE   20480    CONCAT    -        RW
sd c1t2d0s2-02  VolM-02    ENABLED 10240    20480    0         c1t2d0   ENA

Let’s suppose that occurred a physical failure with one disk (c1t2d0).

To check the Volume Status:

bash-3.00# vxprint
v  VolM         fsgen        ENABLED  20480    -        ACTIVE   –       -
pl VolM-01      VolM         ENABLED  20480    -        ACTIVE   –       -
sd c1t1d0-02    VolM-01      ENABLED  20480    0        -        -       -
pl VolM-02      VolM         DISABLED 20480    -        NODEVICE –       -
sd c1t2d0s2-02  VolM-02      DISABLED 20480    0        NODEVICE –       -

At this point, you can notice that the volume is still active but the
Plex VolM-02 composed by a sub-disk from Disk c1t2d0 is not active due
to a physical problem. Volume VolM is still active because it was
configured using a mirror layout therefore the whole data is also stored
in the good disk (c1t1d0).
Note: If this volume was configured as a simple strippe volume, sorry, you would have no data now.

The next steps will describe how to add a new disk to Solaris in order to replace the failed one and recover the mirror.

1-)  Connect the new disk on the server

2-) Force solaris to recognize the new disk:

bash-3.00# devfsadm
bash-3.00# prtvtoc /dev/dsk/[device-name]

3-) To VxVM recognize the disk:

bash-3.00# vxdctl enable

The next step is to add this disk as the replacement of the failed disk.
Then, you need to add this new disk to a Disk Group using the same tag
as the failed disk.
In this example, faulted disk had the tag (c1t2d0s2).

4-) To add the new disk to the Disk Group DG1 as the replacement of the failed disk :

Note: -k force the system to take disk media from failed disk and assign to new disk.

bash-3.00# vxdg -k -g DG1 adddisk c1t2d0s2=c1t4d0

5-)To reattach the disk to the Disk Group:

bash-3.00# vxreattach

6-)To recover the volume and resynchronize the mirror:

bash-3.00# vxrecover -bs -g DG1 VolM

7-)To check if the volume is properly recovered:

bash-3.00# vxprint
v  VolM         fsgen        ENABLED  20480    -        ACTIVE   –       -
pl VolM-01      VolM         ENABLED  20480    -        ACTIVE   –       -
sd c1t1d0-02    VolM-01      ENABLED  20480    0        -        -       -
pl VolM-02      VolM         ENABLED  20480    -        ACTIVE   –       -
sd c1t2d0s2-02  VolM-02      ENABLED  20480    0        -        -

8-)To check that new disk is using the tag of failed disk:

bash-3.00# vxdisk -o alldgs list
DEVICE       TYPE            DISK         GROUP        STATUS
c1t0d0s2     auto:none       –            -            online invalid
c1t1d0s2     auto:cdsdisk    c1t1d0       DG1          online
c1t4d0s2     auto:cdsdisk    c1t2d0s2     DG1          online

Feel free to comment this article in order to improve its quality.

Reference:Veritas Storage Foundation 5.0 for UNIX Fundamentals.


Actions

Information

3 responses

23 03 2009
UDAY

Its Really Helpful. Thanq

29 07 2009
sab

You may need to add one more step before adding the disk to the Diskgroup. The missing step is “initializing” the disk. You need to “initialize” the disk before it can be added to the disk group.

9 09 2009
aashok

very good and useful doc.

Leave a comment