Use the fdisk or sfdisk commands to obtain a printout of the root disk partition table before you encapsulate the root disk. For more information, see the appropriate manual pages. You may need this information should you subsequently need to recreate the original root disk.
See the Veritas Storage Foundation and High Availability Solutions Troubleshooting Guide.
# vxencap -c -g diskgroup rootdisk=sda
where diskgroup must be the name of the current boot disk group. If no boot disk group currently exists, one is created with the specified name. The name bootdg is reserved as an alias for the name of the boot disk group, and cannot be used. You must reboot the system for the changes to take effect.
Both the vxdiskadm and vxencap procedures for encapsulating the root disk also update the /etc/fstab file and the boot loader configuration file (/boot/grub/menu.lst or /etc/grub.conf (as appropriate for the platform) for GRUB or /etc/lilo.conf for LILO):
Entries are changed in /etc/fstab for the rootvol, swapvol and other volumes on the encapsulated root disk.
A special entry, vxvm_root, is added to the boot loader configuration file to allow the system to boot from an encapsulated root disk.
The contents of the original /etc/fstab and boot loader configuration files are saved in the files /etc/fstab.b4vxvm, /boot/grub/menu.lst.b4vxvm or /etc/grub.conf.b4vxvm for GRUB, and /etc/lilo.conf.b4vxvm for LILO.
To mirror the root disk onto another disk after encapsulation
Select Mirror Volumes on a Disk from the vxdiskadm main menu to create a mirror of the root disk. (These automatically invoke the vxrootmir command if the mirroring operation is performed on the root disk.)
The disk that is used for the root mirror must not be under Volume Manager control already.
# vxrootmir mirror_da_name mirror_dm_name
mirror_da_name is the disk access name of the disk that is to mirror the root disk, and mirror_dm_name is the disk media name that you want to assign to the mirror disk. The alternate root disk is configured to allow the system to be booted from it in the event that the primary root disk fails. For example, to mirror the root disk, sda, onto disk sdb, and give this the disk name rootmir, you would use the following command:
# vxrootmir sdb rootmir
The operations to set up the root disk mirror take some time to complete.
The following is example output from the vxprint command after the root disk has been encapsulated and its mirror has been created (the TUTIL0 and PUTIL0 fields and the subdisk records are omitted for clarity):
Disk group: rootdg TY NAME ASSOC KSTATE LENGTH PLOFFS STATE ... dg rootdg rootdg - - - - dm rootdisk sda - 16450497 - - dm rootmir sdb - 16450497 - - v rootvol root ENABLED 12337857 - ACTIVE pl mirrootvol-01 rootvol ENABLED 12337857 - ACTIVE pl rootvol-01 rootvol ENABLED 12337857 - ACTIVE v swapvol swap ENABLED 4112640 - ACTIVE pl mirswapvol-01 swapvol ENABLED 4112640 - ACTIVE pl swapvol-01 swapvol ENABLED 4112640 - ACTIVE