Rebuild 'rootdg' With Added Volumes

Problem

How to rebuild rootdg - with added volumes

Solution

The following instructions are for when the customer has added volumes to the rootdg after encapsulation.
The customer then needed to capture the rootdg configuration, so he could upgrade the OS from Solaris 9 to Solaris 10.
0. save VM configuration for 4 volumes
# vxprint -hmvpsrQq -g rootdg opw_tmp opw_log oracle opw_mag > /backup_vol
# vxprint -g rootdg > vxprint-rootdg.orig
1. destroy dg
# vxdg destroy rootdg
# vxdiskunsetup -C c1t0d0s2
# vxdiskunsetup -C c1t1d0s2
------perform OS upgrade and reboot.
2. re-encapsulate root disk
# vxdiskadm
and select option 2 Encapsulate one or more disks
then, follow instructions.
3. reboot the system
4.  Check the rootdg configuration and compare to original vxprint from above step 0.
# vxprint -g rootdg -ht
5. restore and start volume
Needed to rename the sd to what it was in the old configuration before use of vxmake to recover the missing volumes:
To fix this rename these 'new' sd's as follows:
# vxedit -g rootdg rename rootdisk-04 rootdisk-07
# vxedit -g rootdg rename rootdisk-03 rootdisk-09
# vxedit -g rootdg rename rootdisk-05 rootdisk-10
Then rename them to match the old configuration:
# vxedit -g rootdg rename rootdisk-07 rootdisk-03
# vxedit -g rootdg rename rootdisk-10 rootdisk-04
# vxedit -g rootdg rename rootdisk-09 rootdisk-05
And rename the rootdisk6vol to oracle:
# vxedit -g rootdg rename rootdisk6vol oracle
6. Now at this point run the vxmake command to recover those other volumes:
# vxmake -g rootdg -d /backup_vol
7. Check the volumes
# vxprint -g rootdg -ht
If any volumes are not enabled:

# vxvol -g rootdg -f start <volume>