wiki:ReplaceVeritasDiskOnSolaris

Replace Veritas (3.x) Disk On Solaris (8)

Summary of flow

  • Remove disk from Veritas
  • Remove disk from Solaris
  • Replace disk
  • Add disk to Solaris
  • Add disk to Veritas

Plan B, sometimes if you have a buggy Vertas 3.2

  • Remove all signs of the plex and disk from disk group
  • Menu 1 - Initialize the disk and add it to a group
  • Menu 6 - Initate mirror of partitions and setup to boot

Ensure Veritas removes bad drive

The disk is likely in a "failed" or "removed" state, but experience says we need to ensure it is offline.

vxdisk list
vxdisk offline c1t1d0s2
vxdisk list

Tell Solaris to remove bad drive

After Vertas has removed the drive, we need to tell Solaris to remove it.

/usr/sbin/luxadm -e offline /dev/rdsk/c1t1d0s2

Tell Solaris to cleanup device paths, this command prunes the old disk paths out of the device tree

/usr/sbin/devfsadm -C -c disk

Ensure the disk path does not exist according to Solaris, for example:

ls -ld /dev/rdsk/c1t1d0s2 # shouldn't find it

Physically replace disk

Remove old physical hard drive and insert new physical hard drive. Even if you want to rebuild on a failed disk to make sure it wasn't a glitch, you still need to remove it physically and put it back in.

Create necessary entries in Solaris device tree

devfsadm -c disk
ls -ld /dev/rdsk/c1t1d0

Insert disk into Veritas system

Tell VX to re-read device tree,

vxdctl enable

To initialize new disk,

vxdisksetup -i c1t1d0

Add the disk to the disk group,

vxdg -g rootdg -k adddisk rootmirror=c1t1d0

If it's a boot disk, we need to set it up - this runs vxeeprom etc,

vxbootsetup rootmirror

Initiate the recovery causing a resync,

vxrecover -sb -g rootdg rootmirror

Plan B, sometimes if you have a buggy Vertas 3.2

Remove all signs of the plex and disk from disk group

vxprint -htg rootdg
# all plexes that are bad remove
vxplex dis rootmirrorX-02
vxplex dis rootvol-02
vxplex dis space-02
vxplex dis swapvol-02
vxprint -htg rootdg
vxedit -rf rm rootdiskPriv
vxedit -rf rm rootdiskX-02
vxedit -rf rm rootvol-02
vxedit -rf rm space-02
vxedit -rf rm swapvol-02
# remove the disk media name
vxdg rmdisk rootmirror
vxprint -htg rootdg

Run "vxdiskadm" and choose menu option 1. Initialize the disk, do not accept the default name -- name it "rootdisk" or "rootmirror".

Or, these commands should do the same:

vxdisk online c1t1d0
vxdisksetup -i c1t1d0
vxdg -g rootdg adddisk rootmirror=c1t1d0

Run "vxdiskadm" and choose menu option 6. Mirror the partitions from the good disk to the new disk. Or, these commands should do the same:

# mirrors rootdisk to rootmirror 
vxmirror -V -g rootdg rootdisk rootmirror
# setup boot
vxbootsetup rootmirror
# check eeprom variable
eeprom nvramrc
# make sure it looks like the devalias is setup for both root disks.

Other Notes!

Other commands to display info:

prtvtoc /dev/rdsk/c1t1d0s2
vxstat -g rootdg
vxinfo
vxdisk list c1t1d0
vxprint
disks
devlinks
vxtask list # to see if sync is done
eeprom nvramrc