HP-UX System Administrator's Guide: Logical Volume Management (5900-3028, March 2013)
2. Decide on the new size of the logical volume.
For example, if the logical volume is mounted to a file system, the new size must be greater
than the space the data in the file system currently occupies. The bdf command shows the
size of all mounted volumes. The first column shows the space allocated to the volume; the
second shows how much is actually being used. The new size of the logical volume must be
larger than the size shown in the second column of the bdf output.
3. Reduce the size of the logical volume as follows:
# lvreduce -L 500 /dev/vg01/lvol5
This command reduces the logical volume/dev/vg01/lvol5 to 500 MB.
NOTE: On the HP-UX 11i v3 March 2010 Update, the size of a logical volume cannot be reduced
if it has any type of snapshots associated with it. With the HP-UX 11i v3 September 2010 Update,
only logical volumes with associated space efficient snapshots cannot be reduced. For information
about snapshots, see “Creating and Administering Snapshot Logical Volumes” (page 104).
Adding a Mirror to a Logical Volume
NOTE: Mirroring requires the optional product HP MirrorDisk/UX.
TIP: This task is easier to perform with HP SMH. HP SMH confirms that enough disk space is
available for the mirror copy and that the available space meets any allocation policy.
To add a mirror to a logical volume, follow these steps:
1. Decide how many mirror copies to create.
For this example, you will create one mirror; that is, you will keep two copies of the data
online, the original and one mirror copy.
2. Make sure that there is enough free space in the volume group that contains the logical volume
you want to mirror.
The volume group needs at least as much free space as the logical volume you want to mirror
currently has allocated to it—that is, you will double the amount of physical space this volume
requires.
To use strict mirroring (which HP recommends because it keeps the mirror copy on a separate
disk) this free space must be on a disk or disks not currently used by the volume you want to
mirror.
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 104).
Common LVM Tasks 55