LVM Version 2.
Abstract ..............................................................................................................................................3 Audience ............................................................................................................................................3 Introduction .........................................................................................................................................3 What is a 2.x Volume Group? ............................
Abstract This whitepaper is an introduction to the LVM volume groups versions 2.0 and 2.1. The 2.0 volume groups became available with the March 2008 release of HP-UX 11i v3 (11.31) and the 2.1 volume groups with the 11i v3 2008 September release. Prior to the March 2008 release, only version 1.0 volume groups were available. In this document, 2.x denotes both 2.0 and 2.1 volume groups.
New Limits The limits remain the same for 1.0 volume groups. The following table illustrates the new upper limits with 2.x volume groups. VG size LV size PV size Number of volume groups Number of logical volumes per VG Number of physical volumes per vg Number of mirrors copies Number of extents per volume group Extent size Stripe width Max Supported 1.0 volume groups limits 510 TB Max Supported 2.0 volume groups limits Max Supported 2.
LVM Changes in the March 2008 Release of HP-UX 11i v3 Creation of a volume group Automatic creation of the volume group directory and group file is available starting with the March 2008 release of HP-UX 11i. It is available for 1.0 and 2.x volume groups. The following examples show volume group creation using the legacy method (mkdir and mknod) and examples of automatic creation. Creating a 1.0 volume group To avoid manually creating the volume group directory and the group file, use vgcreate.
–l max_lv and –p max_pv are not needed for 2.x volume groups because any 2.x volume group is provisioned to handle the maximum supported number of logical volumes and physical volumes. –f is not needed for 2.x volume groups because bad block handling is handled by all currently supported physical disk drives. Example To create a 2.0 volume group using 32 MB extents and a maximum size is 1 PB, enter: # vgcreate -V 2.0 -s 32 -S 1p /dev/vg01 /dev/disk/disk50 Example To create a 2.
Display of LVM Information With the introduction of the new volume group version, the display commands display additional information. In addition, because 2.x volume groups support increased sizes, some of the display information can contain larger numbers than previous versions. This section illustrates the difference for each display operation.
pvdisplay In the March 2008 release of HP-UX 11iV3, the pvdisplay command displays one more line than pvdisplay from the HP-UX 11i v3 initial release. When the –d option is used with pvdisplay, the new line appears for both 1.0 and 2.x volume groups. The new line is “Data End”. “Data Start” and “Data End” are block numbers from the start of the disk. In this display, a block is always1024 bytes (no matter what the disk sector size is).
lvdisplay For 1.0 volume groups, the output of lvdisplay is the same as the HP-UX 11i v3 initial release. For 2.x volume groups, lvdisplay output changes if the number of mirrors is greater than 2. In that case, when lvdisplay –v is used, it displays extent mapping data for the additional mirrors on additional lines. This is illustrated in the following example.
There is another difference in lvdisplay(1M). For 1.0 volume groups, the order in which the physical extents are displayed by lvdisplay –v can change across activation cycles. This is because when a 1.0 volume group is activated, LVM arranges the physical extents of a logical extent (LE) in order of increasing physical volume number.
1.0 Minor Number Encoding: brw-r----- 1 root sys Volume group number 18 (picked by customer) 64 0x120001 Jun 23 1 root sys Logical volume number 01 (managed by LVM) Reserved Bits 11 & 23 Reserved. If non zero then no assumptions can be made about logical volume or volume group number 2.
The lvmadm command displays the supported limits for 1.0, 2.0, and 2.1 volume groups. It is not possible to create a volume group that goes beyond these limits. Example # lvmadm -t --- LVM Limits --VG Version Max VG Size (Tbytes) Max LV Size (Tbytes) Max PV Size (Tbytes) Max VGs Max LVs Max PVs Max Mirrors Max Stripes Max Stripe Size (Kbytes) Max LXs per LV Max PXs per PV Max Extent Size (Mbytes) 1.
“Optional” means that the option is not necessary to create or use the volume group. “Invalid” means that the LVM command fails. “Ignored” means that the LVM command ignores the option, but does not automatically fail. “Obsolete” means that the LVM command ignores the option and displays a warning message, but does not automatically fail. “New option” means that the option was first delivered in the March 2008 release of HP-UX 11i v3 (11.31).
• You cannot add bootable disks to a 2.x volume group. vgcfgrestore (1M) • The –F option is obsolete on a 2.x volume group. If used on a 2.x volume group, vgcfgrestore displays a warning. vgimport (1M) • Automatically creates the volume group directory (under /dev) and the group file if they do not already exist. This applies to 1.0 and 2.x volume groups. vgremove (1M) • For both 1.0 and 2.x, by default vgremove does not delete the volume group directory and group file.
• Change in the display if using more than two mirrors. See “Summary List of New or Obsolete Commands Options”. Other Differences Between Volume Group Versions 1.0 and 2.x Sparing not supported on 2.x volume groups The sparing function available on 1.0 volume groups is not available on 2.x volume groups. Boot, dump and primary swap not supported on 2.x A 2.x volume group cannot be the root volume group nor can it contain a boot disk. As a consequence, Ignite/UX does not allow the creation of a 2.
Simplified Provisioning With 1.0 version volume groups, you provision the volume group with three parameters: max PVs, max extents, and max LVs. Furthermore, 1.0 volume groups keep their disk metadata within one physical extent. Both of these factors make it challenging to configure 1.0 volume groups can easily grow over time. With 2.x version volume groups, you provide only one maximum when provisioning. This is the maximum size of the volume group (new –S option).
However, system memory is different. When this volume group is created or activated, the memory allocated is based on the extents allocated to logical volumes and not on the maximum size of the volume group. This is different from 1.0 version volume groups, in that LVM also allocates memory to match the provisioning on disk. In other words, the system memory used by a 2.x volume group depends on how much of the volume group is used.
2.x can leave as much space for user data on disk as 1.0 For an equivalent provisioning (same extent size and same maximum volume group size), the size of the metadata on disk is larger for 2.x compared to 1.0. That is because the metadata is provisioned for more logical volumes, physical volumes, more extents per logical volume (or physical volume), and contains additional information such as the volume names. However, because of the different structures of the 2.x metadata, 2.
VG Name PV Status Allocatable VGDA Cur LV PE Size (Mbytes) Total PE /dev/vgtestl2 available yes 2 0 64 2050 Impact of over provisioning Extent Size Max VG Size “provisioned” Actual VG size in allocated extents Num PV’s used System Memory consumption 1 Space reserved on each disk 2.x 1.0 2.x 1.
The extent size affects the following: • The maximum volume group size you can select when creating a volume group. • The amount of disk space reserved for the metadata. • The memory footprint used by the activated volume group. • The I/O performance (for the case where the logical volume is not striped). • The resynchronization time of the mirrors in some particular cases. • The minimum size of a logical volume.
The last factor is related to resynchronization time. Small extent size can accelerate the resynchronization of a logical volume in the case where an application issues sparse I/Os on the logical volume at the time a physical volume is down. In this case, the amount of data to resynchronize is smaller. As a result, the resynchronization is faster. Note that if a resynchronization of a complete mirror of a logical volume is needed, the size of the extent has no affect on the resynchronization time.
The memory footprint of a 2.x volume group provisioned for a given extent size and maximum volume group size is somewhere between the minimum and the maximum memory footprint as illustrated in Figures 3 and 4. The minimum and maximum memory footprints are shown in the “Minimum Memory Footprint” and “Maximum Memory ” sections, respectively. The 2.
approximately 5 MB while the minimal memory footprint of a 1.0 volume group with the same extent size provisioned for only 256 TB (8 times smaller) is 17 MB. The minimum footprint of a 2.x volume group regardless of its provisioned size never exceeds 5 MB. Maximum Memory Footprint Figure 4 shows the memory footprint of 1.0 and 2.0 volume groups activated, fully populated, and with the worst case volume group configuration. To get the 2.1 footprint in the same conditions, add 30 MB to the 2.0 footprint.
Maximal memory footprint, all extents allocated, max number of LVs and PVs (2.0 solid lines, 1.0 dotted lines) 1000 1 mb extent 1.0 10 Memory footprint (mb) 1 mb extent 2.0 100 2 mb extent 1.0 2 mb extent 2.0 4 mb extent 1.0 4 mb extent 2.0 8 mb extent 1.0 8 mb extent 2.0 16 mb extent 1.0 16 mb extent 2.0 32 mb extent 1.0 32 mb extent 2.0 64 mb extent 1.0 64 mb extent 2.0 128 mb extent 1.0 128 mb extent 2.0 256 mb extent 1.0 256 mb extent 2.
Figure 5 25
Figure 6 How to Configure the New Limits Number of logical volumes or physical volumes in a volume group There is nothing to do to on a 2.x volume group (at creation time or later) to reach the new limits for the number of physical volumes or logical volumes (511 for 2.0 and 2047 for 2.1). As indicated previously, version 2.x volume groups are provisioned in a way that LVM can always add physical volumes or logical volumes until the maximum capacity of the volume group is reached.
Size of logical volume or number of mirrors To reach the new limits, increase the values passed in to lvcreate, lvextend, or FSWEB. Migration Between1.0, 2.0, and 2.1 Why would a user migrate? You might want to migrate from 1.0 to 2.1 because your1.0 volume group is too small. You can use vgmodify to extend the limits of a 1.0 volume group, but that might not work or might not be enough. HP does not recommend migration from 1.0 to 2.0, instead migrate to 2.1. Migrating to a lower volume group version (2.
Cab inet Num ber Ca bine t Nu mber HKP H KP 48V hp Integrity Superdome GSP 4 8V hp Integrity Superdome G SP Remote Remo te At tention Attent o i n Figure 7 The advantage of having three mirrors at one site is when a backup strategy is deployed where a mirror logical volume is split off (lvsplit) to perform backups. In this example, either site can employ a backup strategy that does not jeopardize data availability during a site outage.
Cab inet Nu mb er Cabine t Numb er HKP GSP Cabine t Numb er HKP 4 8V hp Integrity Superdome HKP 48 V hp Integrity Superdome 48 V hp Integrity Superdome GSP GSP Rem ote R emote R emote Atten tio n A ttention A ttention Figure 8 29
Glossary DSF Device Special File. A file associated with an I/O device. DSFs are read and written the same as ordinary files, but requests to read or write are sent to the associated device. LUN A SCSI logical unit. This refers to an end storage device such as a disk, tape, floppy, or CD. This is the logical unit itself and does not represent the path to the logical unit. Metadata The on-disk structures that LVM uses to manage a volume group. This space is not available for application data.
For More Information To learn more about some of the LVM features, see the following document on HP documentation website: http://docs.hp.com (Use search with the given name of the whitepaper) http://www.docs.hp.