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
- vxprint -g sourcedg -hmQq data1 > /data.file
- vxdisk list > /vxdisk.file
(save the disk name/device mappings)
- vxdg -g sourcedg rmdisk disk01
- vxdg -g targetdg adddisk disk01=c1t0d0
vxmake -g targetdg -d /data.file
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.
I always advise people to test this before REALLY trying it.After installing ESMvxbu.bin, you get some good scripts below /usr/vx/utils The intension of these scripts is to assist in moving selected volumes from one diskgroup to another (or a new one).
Package contents | |
---|---|
1.save_info | used to save information |
2.remove_from_DG | remove volumes from the diskgroup |
3.make_new_DG | Builds the volumes up again in the new DG |
RUNME | Documentation, sorry, it's in norwegian |
count_configs | counts which disks have VxVM config copies |
remove_disk | used by remove_from_DG |
remove_volume | used by remove_from_DG |
OK, this is what you do: First: Be sure to save your entire config as it is:
#/usr/vx/Save_All_DG /usr/vx
Then on with the job:
#cd /usr/vx/utils
(Continue to run this script until it sucseeds, It might fail, and tell
you to do something, like umount a filesystem etc....)
#./1.save_info
#./2.remove_from_DG
#3.make_new_DG
Now everything should be fine again, you can now edit /etc/vfstab, to switch diskgroup, and remount the filesystems or start some databases...
remember one thing; you can't empty the entire "rootdg" you should have something in it. I usually have what I call a "minimal rootdg"**; which only consist of a simple slice, usually 20Mb on slice 7 on the root-disk.
On an existing system, do like this: (make sure you have the slice!)
#sh
#SLICE=c0t0d0s7
#vxdctl add disk $SLICE type=simple
#vxdisk -f init $SLICE type=simple
#vxdg adddisk $SLICE
With a fresh install of VxVM, just do like this after the pkgadd of
vxvm:
#SLICE=c0t0d0s7
#vxconfigd -m disable
#vxdctl init
#vxdg init rootdg
#vxdctl add disk $SLICE type=simple
#vxdisk -f init $SLICE type=simple
#vxdg adddisk $SLICE
#vxdctl enable
#vxdctl initdmp
#rm /etc/vx/reconfig.d/state.d/install-db
(No need for rebooting at all....)
I really hope you can use some of this, send me an email if you liked it!
What we are doing here is this:
A lot of places, we don't want to mirror the bootdisk. Reason: When the original bootdisk have failed and has been fixed, then both rootdisk an rootmir are initialized, not encaptulated. This makes it difficult for the technicians that switch disks. It's also difficult if you by some other reason needs the "original" partitioning.
Typically we do this where there is one of this conditions:
We have a script that "clones" the bootdisk instead of mirroring it. This script sed's through all vfstab etc (also /etc/vx/volboot) ( contact me for further information.)
OK, now if the "rootdisk" dies, the machine will crash (of course)
But it will reboot immediatly on the secondary disk.
Where we have machines standing alone, which won't tolerate any downtime, we often use DiskSuite to mirror bootdisks/rootdg