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 System Administrator's Guide: Logical Volume Management: HP-UX 11i Version 3 > Chapter 1 Introduction

LVM Device File Usage

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

All LVM components are represented by device special files located in the /dev directory. Device special files act as agents for managing the interactions with the disk space. The LVM device files are created by both HP SMH and HP-UX commands. This section describes the device special files used by LVM, and naming conventions for LVM objects.

Legacy Device Files versus Persistent Device Files

As of HP-UX 11i Version 3, disk devices can be represented by two different types of device files in the /dev directory, legacy and persistent.

Legacy device files were the only type of mass storage device files in releases prior to HP-UX 11i Version 3. They have hardware path information such as SCSI bus, target, and LUN encoded in the device file name and minor number. For example, the legacy device file /dev/dsk/c3t2d0 represents the disk at card instance 3, target address 2, and lun address 0.

Persistent device files are not tied to the physical hardware path to a disk, but instead map to the disk's unique worldwide identifier (WWID). Thus, the device file is unchanged if the disk is moved from one interface to another, moved from one switch or hub port to another, or presented from a different target port to the host. The name of a persistent device file follows a simpler naming convention: /dev/disk/diskn, where n is the instance number assigned to the disk. Neither the device file name nor the minor number contain any hardware path information.

In addition, if the disk has multiple hardware paths, it is represented by a single persistent device file. Persistent device files transparently handle multipathed disks and supersede LVM's multipathing functionality described in “Increasing Hardware Path Redundancy Through Multipathing”. If a disk has multiple hardware paths, which LVM refers to as pvlinks, the persistent device special file acts as a single access point for all the links. I/O requests are distributed across all available links by the mass storage stack, with a choice of load balancing algorithms. If a link fails, the mass storage stack automatically disables the failed link and I/O continues on all remaining links. Any failed or nonresponsive links are monitored, so that when a failed link recovers, it is automatically and transparently reincorporated into any load balancing. New disks and links are also automatically discovered and added to load balancing. If the disk's connectivity changes—addition, removal, or modification of a link—applications using the persistent device file are not affected, provided at least one link is still active. New disks are automatically discovered.

You can use either persistent or legacy device files for LVM disks. LVM recommends the use of persistent device special files, because they support a greater variety of load balancing options.

NOTE: To use LVM's alternate link functionality, you must use legacy device files, and disable multipathing through those legacy device files, as described in “Increasing Hardware Path Redundancy Through Multipathing”.

Naming Conventions for LVM

You must refer to LVM devices or volume groups by name when using them within HP SMH or with HP-UX commands. By default, the LVM device files created by both HP SMH and HP-UX commands follow a standard naming convention. However, you can choose customized names for volume groups and logical volumes.

Physical Volume Names

Physical volumes are identified by their device file names, as follows:

Table 1-2 Physical Volume Naming Conventions

Device File Name

Type of Device

/dev/disk/diskn

Persistent block device file

/dev/disk/diskn_p2

Persistent block device file, partition 2

/dev/rdisk/diskn

Persistent character device file

/dev/rdisk/diskn_p2

Persistent character device file, partition 2

/dev/dsk/cntndn

Legacy block device file

/dev/dsk/cntndns2

Legacy block device file, partition 2

/dev/rdsk/cntndn

Legacy character device file

/dev/rdsk/cntndns2

Legacy character device file, partition 2

 

Each disk has a block device file and a character or raw device file, the latter identified by the r. Which name you use depends on what task you are doing with the disk.

For the boot disk on HP Integrity servers, make sure to use the device files with the _p2 suffix or s2 suffix, because they represent the HP-UX partition on the boot disk. On HP 9000 servers, use the device file without a partition number.

Use a physical volume’s raw device file for the following tasks only:

  • Preparing a physical volume for LVM using the pvcreate command. Here you use the device file for the disk; for example, /dev/rdisk/disk14. (The absence of a partition suffix indicates that you are referring to the entire disk.)

  • Removing LVM information from a physical volume using the pvremove command.

  • Restoring your volume group configuration using the vgcfgrestore command.

  • Performing a consistency check on a physical volume using the pvck command.

  • Modifying the volume group identifier on a physical volume using the vgchgid command.

  • Changing the disk type of a physical volume using the vgmodify command.

For all other tasks, use the block device file. For example, when you add a physical volume to a volume group using the vgextend command, you use the disk’s block device file for the disk, such as /dev/disk/disk14.

All disk device files are created automatically when a new disk is discovered. For more information, see insf(1M).

Volume Group Names

Each volume group must have a unique name, up to 255 characters. For example, typical volume group names are vg01, vgroot, or vg_sales. Although the name does not need to start with vg, HP recommends using this prefix. By default, HP SMH uses the names of the form /dev/vgnn. The number nn starts at 00 and is incremented in the order that volume groups are created. By default, the root volume group is vg00.

Logical Volume Names

Logical volumes are identified by their device file names, which can either be assigned by you or assigned by default when you create a logical volume using the lvcreate command.

When assigned by you, you can choose any name up to 255 characters.

When assigned by default, these names take the form /dev/vgnn/lvolN (the block device file form) and /dev/vgnn/rlvolN (the character device file form). The number N starts at 1 and increments in the order that logical volumes are created within each volume group.

When LVM creates a logical volume, it creates both block and character device files. LVM then places the device files for a logical volume in the appropriate volume group directory. For example, the default block name for the first logical volume created in volume group vg01 has the following full path name:

/dev/vg01/lvol1

If you create a logical volume to contain a sales database, you can name it explicitly as follows:

/dev/vg01/sales_db_lv

After the logical volume in the previous example is created, it has two device files: /dev/vg01/sales_db_lv for the block device file and /dev/vg01/rsales_db_lv for the character, or raw, device file.

Physical Volume Group Names

Physical volume groups are useful for mirroring and are discussed in “Increasing Performance Through I/O Channel Separation”. The only naming restriction is that within a volume group, each physical volume group must have its own unique name. For example, the volume group /dev/vg02 might have two physical volume groups named pvg1 and pvg2.

Device Number Format

The device files associated with LVM reside in the /dev directory. For each volume group, a directory under /dev is named after the volume group. In that directory is a single “group” device file and separate block and character device files for each logical volume.

The following is a sample listing:

# ls -l /dev/vg01 total 0 crw-r--r-- 1 root root 64 0x010000 Mar 28 2004 group brw-r----- 1 root root 64 0x010001 Jul 29 16:53 lvol1 brw-r----- 1 root root 64 0x010002 Jul 29 16:53 lvol2 crw-r----- 1 root root 64 0x010001 Mar 28 2004 rlvol1 crw-r----- 1 root root 64 0x010002 Mar 28 2004 rlvol2

By default, volume group numbering begins with zero (vg00), while logical volumes begin with one (lvol1). This is because the logical volume number corresponds to the minor number and the volume group's group file is assigned minor number 0.

Physical volumes use the device files associated with their disk. LVM does not create device files for physical volumes.

Version 1.0 Device Number Format

Table 1-3 lists the format of the device file number for Version 1.0 volume groups.

Table 1-3 Version 1.0 Device Number Format

Major Number

Volume Group Number

Reserved

Logical Volume Number

64

0–0xff

0

0–0xff

0=group file

 

For Version 1.0 volume groups, the major number for LVM device files is 64. The volume group number is encoded into the top eight bits of the minor number, and the logical volume number is encoded into the low eight bits. Logical volume number 0 is reserved for the group file.

Version 2.x Device Number Format

Table 1-4 lists the format of the device file number for Version 2.x volume groups.

Table 1-4 Version 2.x Device Number Format

Major Number

Volume Group Number

Logical Volume Number

128

0–0x7ff

0–0x7ff

0=group file

 

For Version 2.x volume groups, the major number for LVM device files is 128. The volume group number is encoded into the top twelve bits of the minor number, and the logical volume number is encoded into the low twelve bits. Logical volume number 0 is reserved for the group file.

NOTE: The most significant bit of the volume group number and logical volume number fields are reserved and must be zero.

The device number format is subject to change.

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