Before you can remove the last disk from a disk group, you must disable the disk group.
As an alternative to disabling the disk group, you can destroy it.
If a disk contains no subdisks, you can remove it from its disk group with the following command:
# vxdg [-g diskgroup ] rmdisk diskname
For example, to remove mydg02 from the disk group mydg, enter the following:
# vxdg -g mydg rmdisk mydg02
If the disk has subdisks on it when you try to remove it, the following error message is displayed:
VxVM vxdg ERROR V-5-1-552 Disk diskname is used by one or more subdisks Use -k to remove device assignment.
Using the -k option lets you remove the disk even if it has subdisks.
After you remove the disk from its disk group, you can (optionally) remove it from VxVM control completely. Enter the following:
# vxdiskunsetup devicename
For example, to remove the disk hdisk9 from VxVM control, enter the following:
# vxdiskunsetup hdisk9
You can remove a disk on which some subdisks of volumes are defined. For example, you can consolidate all the volumes onto one disk. If you use vxdiskadm to remove a disk, you can choose to move volumes off that disk. To do this, run vxdiskadm and select Remove a disk from the main menu.
If the disk is used by some volumes, this message is displayed:
VxVM ERROR V-5-2-369 The following volumes currently use part of disk mydg02: home usrvol Volumes must be moved from mydg02 before it can be removed. Move volumes to other disks? [y,n,q,?] (default: n)
If you choose y, all volumes are moved off the disk, if possible. Some volumes may not be movable. The most common reasons why a volume may not be movable are as follows:
If vxdiskadm cannot move some volumes, you may need to remove some plexes from some disks to free more space before proceeding with the disk removal operation.