HP-UX System Administrator's Guide: Logical Volume Management (5900-3028, March 2013)
2. Find the names of all logical volumes and physical volumes in the volume group. Enter the
following command:
# vgdisplay -v /dev/vgnn
3. Make sure that none of those logical volumes are in use. This may require stopping applications
using any logical volumes in the volume group, and unmounting file systems contained in the
volume group.
Use the fuser command on each logical volume:
# fuser -cu /dev/vgnn/lvoln
4. Remove each of the logical volumes as follows:
# lvremove /dev/vgnn/lvoln
For more information, see “Removing a Logical Volume” (page 56).
5. Remove all but one of the physical volumes as follows:
# vgreduce /dev/vgnn /dev/disk/diskn
For more information, see “Removing a Disk from a Volume Group” (page 51).
6. Use the vgremove command to remove the volume group as follows:
# vgremove vgnn
Backing Up a Mirrored Logical Volume
NOTE: Mirroring requires the optional product HP MirrorDisk/UX.
You can split a mirrored logical volume into two logical volumes to perform a backup on an offline
copy while the other copy stays online. When you complete the backup of the offline copy, you
can merge the two logical volumes back into one. To bring the two copies back in synchronization,
LVM updates the physical extents in the offline copy based on changes made to the copy that
remained in use.
You can use HP SMH to split and merge logical volumes, or use the lvsplit and lvmerge
commands.
To back up a mirrored logical volume containing a file system, using lvsplit and lvmerge,
follow these steps:
1. Split the logical volume /dev/vg00/lvol1 into two separate logical volumes as follows:
# lvsplit /dev/vg00/lvol1
This creates the new logical volume /dev/vg00/lvol1b. The original logical volume /dev/
vg00/lvol1 remains online.
2. Perform a file system consistency check on the logical volume to be backed up as follows:
# fsck /dev/vg00/lvol1b
3. Mount the file system as follows:
# mkdir /backup_dir
# mount /dev/vg00/lvol1b /backup_dir
4. Perform the backup using the utility of your choice.
5. Unmount the file system as follows:
# umount /backup_dir
6. Merge the split logical volume back with the original logical volume as follows:
# lvmerge /dev/vg00/lvol1b /dev/vg00/lvol1
NOTE: lvsplit is not supported on snapshot logical volumes. lvmerge is not supported for
snapshots as well as logical volumes having snapshots.
68 Administering LVM