| United States-English |
|
|
|
![]() |
HP-UX System Administration Tasks: HP 9000 > Chapter 3 Managing Disks Using the Logical Volume Manager
(LVM) Planning for the Use of Logical Volumes |
|
Using logical volumes requires some planning. Some of the issues you should consider for planning purposes are listed below and discussed in the remainder of this section. You should consider these issues before setting up or modifying logical volumes on your system.
File systems reside in a logical volume just as they do within disk sections or non-partitioned disks. You can consider the space required by a file system as having three major components, as depicted in Figure 3-3 “File System Space Components”. To get a rough estimate of how big to make a logical volume which will contain your file system, do the following:
For example, suppose a group of users will require 60MB space for file system data; this estimate allows for expected growth. You then add 6MB for the "minfree" space and arrive at 66MB. Then you add another 3MB for file system overhead and arrive at a grand total estimate of 69MB required by the file system, and by consequence, for the logical volume that contains the file system. If you are creating the logical volume in a volume group that has an extent size of 4MB, 69 gets rounded up to 72 to make it divisible by 4MB. That is, LVM will create your logical volumes in multiples of the logical extent size. Although estimates are not precise, they suffice for planning how big to make a file system. You want your file system to be large enough for some useful time before having to increase its size. On the other hand, a contiguous logical volume such as the root logical volume cannot be readily increased in size. Here, it is especially important to try to choose an estimate that will allow for all subsequent growth to such logical volumes. Suppose as suggested above, your users have outgrown the space originally allocated for the file system. You can increase the size of a file system by first enlarging the logical volume it resides in and then using extendfs(1M). (More information can be found under "Extending the Size of a File System Within a Logical Volume" in Chapter 4.) You cannot decrease the size of a file system once it has been created. However, you can create a new smaller file system to take its place.
Whenever possible, if you plan to have a file system span disks, have the logical volume span identical disk interface types. (See "Using Disk I/O Interfaces" later in this chapter.) Normally, by default, LVM will create logical volumes on available disks, not necessarily with regard for best performance. It is possible to have a file system span two disks with different characteristics, in which case the file system performance could possibly be impaired. As a system administrator, you can exercise control over which physical volumes will contain the physical extents of a logical volume. You can do this by using the following two steps:
For more detailed information on this procedure, see "Extending a Logical Volume to a Specific Disk" later in this chapter. When you enable a swap area within a logical volume, HP-UX determines how large the area is and it will use no more space than that. If your disk has enough remaining contiguous space, you can subsequently increase the size of your primary swap area by using the lvextend command (or SAM) to enlarge the logical volume and then reboot the system. This allows HP-UX to use the extra space that you have provided. If you plan device swap areas in addition to primary swap, you will attain the best performance when the device swap areas are on different physical volumes (disks). This allows for the interleaving of I/O to the physical volumes when swapping occurs. See "Guidelines for Setting Up Device Swap Areas" in Chapter 6 for more information. You set up this swapping configuration by creating multiple logical volumes for swap, each logical volume on a separate disk. You must use HP-UX commands to help you obtain this configuration; SAM does not allow you to create a logical volume on a specific disk. See "Extending a Logical Volume to a Specific Disk" later in this chapter. See Chapter 6, "Managing Swap Space and Dump Areas", for more information on swap. You can optimize raw I/O performance by planning your logical volumes specifically for raw data storage. To create a raw data logical volume (such as for a database), you will need to consider how large to create the logical volume and how such a logical volume is distributed over your disks. Typically, you specify the size of a logical volume in megabytes. However, a logical volume's size must be a multiple of the extent size used in the volume group. By default, the size of each logical extent is 4MB. So, for example, if a database partition requires 33MB and the default logical extent size is 4MB, LVM will create a logical volume that is 36MB (or 9 logical extents). The maximum supported size for a raw data device is 4GB. If you plan to use logical volumes heavily for raw data storage (such as for setting up database partitions), you should consider how the logical volumes are distributed over your disks. By default, LVM will assign disk space for a logical volume from one disk, use up the space on this disk entirely, and then assign space from each successive disk in the same manner. LVM uses the disks in the order in which they were added to the volume group. This means that a logical volume's data may not turn out to be evenly distributed over all the disks within your volume group. As a result, when I/O access to the logical volumes occurs, one or more disks within the volume group may be heavily used, while the others may be lightly used, or not even used at all. This arrangement does not provide optimum I/O performance. As a better alternative, you can set up your logical volume on specific disks in an interleaved manner, thus balancing the I/O access and optimizing performance. (See "Extending a Logical Volume to a Specific Disk" later in the chapter.) Because there are no HP-UX commands that will identify that the contents of a logical volume are being used for raw data, it is a good idea to name the logical volumes you create for raw data with easily recognizable names. In this way, you can recognize the contents of such a logical volume. See "Naming Logical Volumes" later in this chapter for more information. LVM supports disks that use SCSI, HP-FL, and, to a limited extent, HP-IB I/O interface types, as shown in Table 3-1. Table 3-1 Disk Interface Types and LVM Support
Although the table shows that mixed HP-FL and SCSI disks can belong to the same volume group, for best performance, you should keep them in separate groups, each containing identical model disks; that is, each should have the same characteristics such as size and rotational speed. HP-IB disks cannot be mixed with the other types.
If as a result of a defect on the disk, LVM is unable to store data, a mechanism is provided to store it at the end of the disk. If your disk supports automatic bad block relocation (usually known as "hardware sparing"), then LVM's bad block relocation mechanism is unnecessary. Bad block relocation is in effect by default when a logical volume is created. You can use the -r n option of lvcreate(1M) to disable the bad block relocation feature.
Your hardware may provide the capability for dual cabling (dual controllers) to the same physical volume. This will be true if your organization has purchased an HP High Availability Disk Array or the MC/ServiceGuard product. If so, LVM can be configured with multiple paths to the same physical volume. If the primary link fails, an automatic switch to an alternate connection or link will occur. Using alternate links will increase availability. See "Setting Up Alternate Links to a Physical Volume" later in this chapter. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||