HP-UX System Administrator's Guide: Logical Volume Management (5900-3028, March 2013)

Removing a Mirror from a Logical Volume
To remove a mirror copy, use the lvreduce command, specifying the number of mirror copies
you want to leave. For example, to remove all mirrors of a logical volume, enter the following
command:
# lvreduce -m 0 /dev/vg00/lvol1
This reduces the number of mirror copies to 0, so only the original copy is left.
To remove the mirror copy from a specific disk, use lvreduce and specify the disk from which
to remove the mirror copy. For example:
# lvreduce -m 0 /dev/vg00/lvol1 /dev/disk/disk4
NOTE: On the HP-UX 11i v3 March 2010 Update, the number of mirror copies of a logical
volume cannot be changed if the logical volume has snapshots associated with it. With the HP-UX
11i v3 September 2010 Update, this limitation has been removed; and logical volumes with
associated snapshots can have their mirror count changed. For information about snapshots see
“Creating and Administering Snapshot Logical Volumes” (page 104).
Renaming a Logical Volume
To change the name of a logical volume, follow these steps:
1. Make sure that the logical volume has two existing device files, a block device file and a
character or raw device file. They must have the same name, except that the character device
file name has a leading r. For example, to rename a logical volume in volume group vg00
from lvol1 to database, list the contents of the /dev/vg00 directory. For example:
# cd /dev/vg00
# ls -l
total 0
crw-r----- 1 root sys 64 0x000000 Nov 16 02:49 group
brw-r----- 1 root sys 64 0x000001 Nov 16 02:49 lvol1
brw-r----- 1 root sys 64 0x000002 Nov 16 02:49 lvol2
brw-r----- 1 root sys 64 0x000003 Nov 16 02:49 lvol3
brw-r----- 1 root sys 64 0x000004 Nov 16 02:49 lvol4
crw-r----- 1 root sys 64 0x000001 Nov 16 02:49 rlvol1
crw-r----- 1 root sys 64 0x000002 Nov 16 02:49 rlvol2
crw-r----- 1 root sys 64 0x000003 Nov 16 02:49 rlvol3
crw-r----- 1 root sys 64 0x000004 Nov 16 02:49 rlvol4
2. Use the mv command to rename both files. For example:
# mv /dev/vg00/lvol1 /dev/vg00/database
# mv /dev/vg00/rlvol1 /dev/vg00/rdatabase
3. Update all references to the old name in any other files on the system. These include /etc/
fstab for mounted file systems or swap devices and existing mapfiles from a vgexport
command.
Removing a Logical Volume
CAUTION: Removing a logical volume makes its contents unavailable and likely to be overwritten.
In particular, any file system contained in the logical volume is destroyed.
To remove a logical volume, follow these steps:
1. Make sure that the logical volume is not in use either as a file system or as raw disk space for
an application. Use the fuser command as follows:
# fuser -cu /dev/vg01/lvol5
If the logical volume is in use, confirm that the underlying applications no longer need it. You
might need to stop the applications.
2. Use the lvremove command to remove the logical volume. For example:
56 Administering LVM