Disks fail at some point in time. Thus the volume managers are built to handle these failures. Now in case of VxVM if a disk in a disk groups fails we can replace it online if its mirrored. The procedure to replace a failed disk under VxVM is quite simple.
Now, I have a failed disk under Disk group “mydg”. The volume “myvol” is mirrored so the data would remain intact after failure. The vxprint output of mydg is as follows, which shows that one of the plex is in DISABLED, NODEVICE state
# vxprint -htg mydg .......... dg mydg default default 5000 1382967597.23.geeklab dm disk01 c1t2d0s2 auto 65536 2027168 - dm disk02 - - - - NODEVICE v myvol - ENABLED ACTIVE 204800 SELECT - fsgen pl myvol-01 myvol ENABLED ACTIVE 204800 CONCAT - RW sd disk01-01 myvol-01 disk01 0 204800 0 c1t2d0 ENA pl myvol-02 myvol DISABLED NODEVICE 204800 CONCAT - WO sd disk02-01 myvol-02 disk02 0 204800 0 - NDEV
Also if you see the vxdisk command output you would see the failed disk:
# vxdisk -eoalldgs list DEVICE TYPE DISK GROUP STATUS OS_NATIVE_NAME ATTR c1t0d0s2 auto:sliced rootdisk rootdg online c1t0d0s2 - c1t1d0s2 auto:sliced rootmirror rootdg online c1t1d0s2 - c1t2d0s2 auto:cdsdisk disk01 mydg online c1t2d0s2 - c1t4d0s2 auto:cdsdisk - - online c1t4d0s2 - c1t5d0s2 auto:cdsdisk - - online c1t5d0s2 - c1t6d0s2 auto:cdsdisk - - online c1t6d0s2 - c1t8d0s2 auto:cdsdisk - - online c1t8d0s2 - - - disk02 mydg failed was:c1t3d0s2
Now we can replace the failed disk directly with the help of vxdiskadm command. Choose option 5 to replace a failed disk
# vxdiskadm Volume Manager Support Operations Menu: VolumeManager/Disk ........ (other options removed for brevity) 5 Replace a failed or removed disk ......... Select an operation to perform: 5
List the failed disks under VxVM using “list” option, and select the failed disk disk02 from disk group mydg. We would have to choose an alternate disk for the replacement of the failed disk. The new disk (c1t4d0) will automatically be named disk02 under VxVM.
Replace a failed or removed disk Menu: VolumeManager/Disk/ReplaceDisk Use this menu operation to specify a replacement disk for a disk that you removed with the "Remove a disk for replacement" menu operation, or that failed during use. You will be prompted for a disk name to replace and a disk device to use as a replacement. You can choose an uninitialized disk, in which case the disk will be initialized, or you can choose a disk that you have already initialized using the Add or initialize a disk menu operation. Select a removed or failed disk [
,list,q,?] list Disk group: rootdg DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE Disk group: mydg DM NAME DEVICE TYPE PRIVLEN PUBLEN STATE dm disk02 - - - - NODEVICE Select a removed or failed disk [ ,list,q,?] disk02 The following devices are available as replacements: c1t4d0 c1t5d0 c1t6d0 c1t8d0 You can choose one of these devices to replace disk02. Choose "none" to abort the replacement of disk02. Choose a device, or select none [ ,none,q,?] (default: c1t4d0) VxVM INFO V-5-2-382 The requested operation is to use the initialized device c1t4d0 to replace the removed or failed disk disk02 in disk group mydg. Continue with operation? [y,n,q,?] (default: y)
Now we can use FMR (Fast Mirror Resynchronization) to perform a quick and efficient resynchronization of stale mirrors.
Use FMR for plex resync? [y,n,q,?] (default: n) y VxVM INFO V-5-2-282 Replacement of disk disk02 in group mydg with disk device c1t4d0 completed successfully. Replace another disk? [y,n,q,?] (default: n) n
I hope the post was informative. Stay tuned and subscribe for more interesting posts on VxVM and Solaris.
How to replace failed root disk under Solaris Volume Manager (SVM)