Find it

Friday, October 23, 2009

Replace Faulty Disk - Solaris Volume Manager

One of disk went crazy this morning let us fix it.

Following is an illustrated how to replace a faulty disk.
  • Configuration: -
  • - all disk are SCSI disks
  • - disks mirror by Solaris Volume Manager
  • - faulty disk was c0t0d0, and the other sub-mirror disk was c0t1d0

The following steps and set of commands can be followed during disk replacement:

1. Check whether there are any replicas on faulty disk, then remove them if any;

# metadb

If yes delete them.

# metadb -d c0t0d0s7

Verify if there are no existing replicas left on faulty disk;

# metadb | grep c0t0d0

2. Run "cfgadm" command to remove the failed disk.

# cfgadm -c unconfigure c1::dsk/c0t0d0

Insert and configure the new disk.

# cfgadm -c configure c1::dsk/c0t0d0 >>>>> Verify that disk is properly configured;

# cfgadm -al

If necessary run following related disk commands:

# devfsadm
# format >>>> verifying new disk


4. Create desired partition table on the new disk with prtvtoc command;

# prtvtoc /dev/rdsk/c0t1d0s2 | fmthard -s - /dev/rdsk/c0t0d0s2 >>>> Make sure disk sizes are same.

5. Recreate replicas on new disk:

# metadb -a -f -c 3 /dev/dsk/c0t0d0s7

6. Run metareplace to enable and resync the new disk.

# metareplace -e d0 c0t0d0s0

In case SVM device-id not up-to-date, run "metadevadm" which will update the new disk device-id.

# metadevadm -u c0t0d0

NOTE: metadevadm is used for update metadevice information. Use this command when the pathname stored in the metadevice state database no longer correctly addresses the device or when a disk drive has had its device ID changed.

1 comment: