United States-English |
|
|
HP-UX System Administrator's Guide: Logical Volume Management: HP-UX 11i Version 3 > Chapter 1 IntroductionLVM Device File Usage |
|
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. 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.
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 NamesPhysical volumes are identified by their device file names, as follows: Table 1-2 Physical Volume Naming Conventions
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:
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 NamesEach 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 NamesLogical 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:
If you create a logical volume to contain a sales database, you can name it explicitly as follows:
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 NamesPhysical 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. The following is a sample listing:
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. 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.
|
Printable version | ||
|