Sunday, February 17, 2008

Replace failed drives in SVM

Suppose we have two internal disks in a system mirrored with SVM and which are being monitored by Nagios/BB/sitescope or a script. When a drive fails we get a message meta devices (drives) “Needs Maintenance”.

We can try reparing the drive if its not Production system.

# metareplace -e d10 c1t2d0s0

where d10 is mirror having d11 and d12 metadevices, d12 (c1t2d0s0) is on the disk which went bad.

If Resynching starts and completes without error disk is fine otherwise we have to replace disk. Below is the process to do that.

1. Detach all metadevices existing on failed disk.
# metadetach -f d10 d12
# metadetach -f d20 d22
# metadetach -f d30 d32

2. Remove the metadevices.

# metaclear d12 d22 d32

3. use metadb -d command to delete metadb existing on failed drive

4. Replace the disk

5. Copy the partition table form disk under SVM to new disk

6. use metadb to create meta database on new disk.

7. Create metadevices again on new disk.

8. Attach the metadevices to create mirror which will also sync them.

Important files in SVM

# more /etc/lvm/ -> (DO NO EDIT) records the locations of state database replicas

# more /etc/lvm/ -> (DO NO EDIT) contains auto generated config info for the default (unspecified or local) disk set

# /kernel/drv/md.conf -> (DO NO EDIT) contains the state database replica config info and is read by SVM at startup

# /etc/lvm/ -> contains SVM config info that can be used to reconstruct your SVM config (Manually)

No comments:

Post a Comment