3.
Use the
lvextend
command with the
-m
option to add the number of additional copies you
want. For example:
# lvextend -m 1 /dev/vg00/lvol1
This adds a single mirror copy of the given logical volume.
To force the mirror copy onto a specific physical volume, add it at end of the command line.
For example:
# lvextend -m 1 /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 103)
.
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 103)
.
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
56
Administering LVM