Tuesday, April 17, 2012

Move disks between VxVM diskgroups

This is not easily done. However you may be able to move a volume from one diskgroup to another, beware, some people have messed this up. Here are the basic steps




Lets say you have two diskgroups sourcedg and targetdg. The sourcedg has a volume data1 that you want in targetdg. data1 is a simple volume with a subdisk on disk01, c1t0d0





backup the data in volume data1 in case this goes wrong.

Save the VM configuration for that particular volume (don't store the file in the volume)

vxprint -g sourcedg -hmQq data1 > /data.file

vxdisk list > /vxdisk.file (save the disk name/device mappings)

Unmount, stop and remove the volume data1, yes thats right remove it! (removing a volume does not actually destroy the data on the disks, it simply deletes the mappings of the volume/plex/subdisk)

Remove the disks that the data1 resided on, and add them to the new diskgroup with the same DM name.

vxdg -g sourcedg rmdisk disk01

vxdg -g targetdg adddisk disk01=c1t0d0

Rebuild the volume mapping form the saved file

vxmake -g targetdg -d /data.file

Start the volume>

vxvol start data01



The above example is very simple as the volume sat on only one disk. If that disk was used by other volumes that are not to be moved to the newdg , then we have a problem. You can only move the disk out of a DG, when all the subdisks are gone.