|HP-UX System Administrator's Guide: Logical Volume Management: HP-UX 11i Version 3 > Chapter 1 Introduction
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 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 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.
Table 1-2 Physical Volume Naming Conventions
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.
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).
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.
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:
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 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.
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.
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.
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
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.
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
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.