172

Creating and administering disk groups

Removing a disk from a disk group

Removing a disk from a disk group

Note: Before you can remove the last disk from a disk group, you must disable the disk group as described in “Disabling a disk group” on page 207. Alternatively, you can destroy the disk group as described in “Destroying a disk group” on page 208.

A disk that contains no subdisks can be removed from its disk group with this command:

#vxdg [-g diskgroup] rmdisk diskname

For example, to remove mydg02 from the disk group, mydg, use this command:

#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 -koption allows you to remove the disk even if subdisks are present. For more information, see the vxdg(1M) manual page.

Caution: Use of the -koption to vxdg can result in data loss.

Once the disk has been removed from its disk group, you can (optionally) remove it from VxVM control completely, as follows:

#vxdiskunsetup devicename

For example, to remove c1t0d0 from VxVM control, use these commands:

#vxdiskunsetup c1t0d0

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 item 2 (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, then 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:

Page 171
Image 171
HP Veritas Volume Manager 5.0 -UX 11i v3 manual Removing a disk from a disk group, # vxdg -g diskgroup rmdisk diskname