Option 6 "Mirror volumes on a disk" in the vxdiskadmutility is by default limited to creating one additional mirror pervolume. If a volume already has two or more mirrors (plexes), noadditional mirrors will be created. However, there are conditions where itis desirable to create a 3-way mirror for a volume.
The following erroroccurs when attempting to use vxdiskadm option 6 to create a 3-waymirror:
Currentconfiguration:
==================================
v opt gen ENABLED ACTIVE 821205 ROUND -
pl opt-01 opt ENABLED ACTIVE 821205 CONCAT - RW
sddisk05-01 opt-01 disk05 0 821205 0 c2t4d0 ENA
pl opt-03 opt ENABLED ACTIVE 821205 CONCAT - RW
sddisk04-04 opt-03 disk04 2891889 821205 0 c2t2d0 ENA
v rootvol root ENABLED ACTIVE 124740 ROUND -
plrootvol-03 rootvol ENABLED ACTIVE 124740 CONCAT - RW
sddisk04-02 rootvol-03 disk04 717255 124740 0 c2t2d0 ENA
plrootvol-02 rootvol ENABLED ACTIVE 124740 CONCAT - RW
sddisk05-03 rootvol-02 disk05 1538460 124740 0 c2t4d0 ENA
==================================
vxdiskadm option 6 outputmessage:
==================================
mirror volumes on adisk
Menu: Volume Manager/Disk/Mirror
This operation can be used tomirror volumes on a disk. These volumes can be mirrored onto anotherdisk or onto any available disk space. Volumes will not be mirrored ifthey are already mirrored. Also, volumes that are comprised of more thanone subdisk will not be mirrored.
Mirroring volumes from the boot diskwill produce a disk that can be used as an alternate boot disk.
At theprompt below, supply the name of the disk containing the volumes to bemirrored.
Volume Manager Support Operations
Mirror volumes on adisk
Menu: Volume Manager/Disk/Mirror
This operation can be used tomirror volumes on a disk. These volumes can be mirrored onto another diskor onto any available disk space. Volumes will not be mirrored if they arealready mirrored. Also, volumes that are comprised of more than onesubdisk will not be mirrored.
Mirroring volumes from the boot disk willproduce a disk that can be used as an alternate boot disk.
At the promptbelow, supply the name of the disk containing the volumes to bemirrored.
Enter disk name [,list,q,?] disk04
Itis possible to mirror volumes from disk disk04 onto any available disk space, orto mirror onto a specific disk. To mirror to a specific disk, select thename of that disk.
To mirror to any available disk space, select"any".
Enter destination disk [,list,q,?] (default: any)disk02
The requested operation is to mirror all volumes on diskdisk04 in disk group rootdg onto available disk space on diskdisk02.
Note: This operation can take a long time tocomplete.
Continue with operation? [y,n,q,?] (default: y)y
Mirroring of disk disk04 failed.
Error:
vxmirror: Novolumes to mirror
Mirror volumes on a different disk? [y,n,q,?] (default:n)
===================================
vxdiskadm option 6 usesthe "/etc/vx/bin/vxmirror" utility to actually perform the work of mirroring thevolumes on a disk. By making a minor modification to this utility, it ispossible to allow for the creation of 3-way mirrors.
In vxmirror, itspecifically checks to see that the volume only has one plex before it willmirror it. The following lines perform this task:
...
# with -a, get all volumes thatare candidates for mirroring, otherwise
# limit to volumes that are onthe given disk. Volumes that are candidates
# for mirroring are volumes thatare not currently mirrored and that
# are composed of subdisks ononly one disk.
if [ -n "$a_all" ]
then
vnames=`vxprint -g"\$g_diskgroup" -F "%vname" -s \
-e "(!sd_is_log) &&assoc.assoc.v_pl_num == 1 &&
!any(assoc.aslist.sd_disk !=sd_disk)" | sort -u`
else
vnames=`vxprint -g"\$g_diskgroup" -F "%vname" -s \
-e "(!sd_is_log) &&sd_dm_name==\\"\$dmname\\" &&
assoc.assoc.v_pl_num == 1&&
!any(assoc.aslist.sd_disk !=sd_disk)" | sort -u`
fi
...
The suggested change, if desired to create more than twoplexes using this utility, is to change both occurrences of"assoc.assoc.v_pl_num == 1" with "assoc.assoc.v_pl_num >= 1".
Thismodification will allow the convenience of adding 3-way mirrors to all volumeson a disk at once. It is possible to accomplish the same result by addingmirrors on a per-volume basis by using the "vxassist" command. Inthis example, the following commands would be used:
# vxassist -g rootdg mirrorrootvol disk02
# vxassist -g rootdg mirroropt disk02