Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > L


HP-UX 11i Version 3: February 2007

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index


lvm — Logical Volume Manager (LVM)


The Logical Volume Manager (LVM) is a subsystem for managing disk space. The HP LVM subsystem offers value-added features, such as mirroring (with the optional HP MirrorDisk/UX software), high availability (with the optional HP ServiceGuard software), and striping, that enhance availability and performance.

Unlike earlier arrangements where disks were divided into fixed-sized sections, LVM allows the user to consider the disks, also known as physical volumes, as a pool (or volume) of data storage, consisting of equal-sized extents. The default size of an extent is 4 MB.

An LVM system consists of arbitrary groupings of physical volumes, organized into volume groups. A volume group can consist of one or more physical volumes. There can be more than one volume group in the system. Once created, the volume group, and not the disk, is the basic unit of data storage. Thus, whereas earlier one would move disks from one system to another, with LVM, one would move a volume group from one system to another. For this reason it is often convenient to have multiple volume groups on a system.

Volume groups can be subdivided into virtual disks, called logical volumes. A logical volume can span a number of physical volumes or represent only a portion of one physical volume. The pool of disk space that is represented by a volume group can be apportioned into logical volumes of various sizes. The size of a logical volume is determined by its number of extents. Once created, logical volumes can be treated just like disk partitions. Logical volumes can be assigned to file systems, used as swap or dump devices, or used for raw access.


LVM information can be created, displayed, and manipulated with the following commands:


Change logical volume characteristics


Stripe, create logical volume in volume group


Display information about logical volumes


Increase space, increase mirrors for logical volume


Prepare logical volume to be root, primary swap, or dump volume


Decrease number of physical extents allocated to logical volume


Remove one or more logical volumes from volume group


Remove logical volume link to root, primary swap, or dump volume


Change characteristics of physical volume in volume group


Create physical volume for use in volume group


Display information about physical volumes within volume group


Move allocated physical extents from one physical volume to other physical volumes


Create or update volume group configuration backup file


Display or restore volume group configuration from backup file


Set volume group availability


Create volume group


Display information about volume groups


Export a volume group and its associated logical volumes


Extend a volume group by adding physical volumes


Import a volume group onto the system


Modify volume group attributes


Remove physical volumes from a volume group


Remove volume group definition from the system


Scan physical volumes for volume groups

The following commands are also available if the HP MirrorDisk/UX software is installed:


Merge two logical volumes into one logical volume


Split mirrored logical volume into two logical volumes


Synchronize stale mirrors in logical volumes


Synchronize stale logical volume mirrors in volume groups

Device Special Files

In this release of HP-UX 11i, the Mass Storage Stack supports two naming conventions for the device special files used to identify devices (see intro(7)). Devices can be represented using:

  • Persistent device special files, (/dev/disk/disk3), or

  • Legacy device special file names, (/dev/dsk/c0t6d6).

While LVM supports the use of both conventions within the same volume group, the examples shown in the LVM man pages are all using the legacy device special file convention.

Alternate Links (PVLinks)

In this release of HP-UX, LVM continues to support Alternate Links to a device to allow continued access to the device, if the primary link fails. This multiple link or multipath solution increases data availability, but continues disallowing the use of multiple paths simultaneously.

A new feature was introduced in the Mass Storage Subsystem on HP-UX 11i Version 3 that supports multiple paths to a device and allows simultaneous access to these paths. The Mass Storage Subsystem will balance the I/O load across the valid paths. Multipathing is the default unless the scsimgr command is used to enable legacy multipathing and also the active path is a legacy device special file. See scsimgr(1M) for details.

Even though the Mass Storage Subsystem supports 32 multiple paths per physical volume on this version of HP-UX, LVM does not support more than eight paths to any physical volume. As a result, commands like vgcreate and vgextend will not succeed in adding more than eight paths per physical volume. Additionally, vgimport and vgscan cannot write more than eight paths per physical volume in the /etc/lvmtab file. If users want to use any specific path other than these eight paths, then they have to vgreduce one of the alternate paths in the volume group and add that specific path using vgextend.

It is no longer required or recommended to configure LVM with alternate links. However, it is possible to maintain the traditional LVM behavior. To do so, both of the following criteria must be met:

  • Only the legacy device special file naming convention is used in the volume group configuration.

  • The scsimgr command is used to enable the legacy multipath behavior for each physical volume in the volume group.


The basic steps to take to begin using LVM are as follows:

  • Identify the disks to be used for LVM.

  • Create an LVM data structure on each identified disk (see pvcreate(1M)).

  • Collect all the physical volumes to form a new volume group (see vgcreate(1M)).

  • Create logical volumes from the space in the volume group (see lvcreate(1M)).

  • Use each logical volume as if it were a disk section (create a file system, or use for raw access).

To configure disk /dev/dsk/c0t0d0 as part of a new volume group named vg01:

First, initialize the disk for LVM with the pvcreate command.

pvcreate /dev/rdsk/c0t0d0

Then, create the pseudo device file that is used by the LVM subsystem.

mkdir /dev/vg01 mknod /dev/vg01/group c 64 0x010000

The minor number for the group file should be unique among all the volume groups on the system. It has the format 0xNN0000, where NN ranges from 00 to ff.

Create the volume group, vg01, containing the physical volume, /dev/dsk/c0t0d0, with the vgcreate command.

vgcreate /dev/vg01 /dev/dsk/c0t0d0

You can view information about the newly created volume group with the vgdisplay command.

vgdisplay -v /dev/vg01

Create a logical volume of size 100 MB, named usrvol, on this volume group with the lvcreate command.

lvcreate -L 100 -n usrvol /dev/vg01

This creates two device files for the logical volume, /dev/vg01/usrvol, which is the block device file, and /dev/vg01/rusrvol, which is the character (raw) device file.

You can view information about the newly created logical volume with the lvdisplay command.

lvdisplay /dev/vg01/lvol1

Any operation allowed on a disk partition is allowed on the logical volume. Thus, you can use usrvol to hold a file system.

newfs /dev/vg01/rusrvol mount /dev/vg01/usrvol /usr

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.