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 2 Configuring LVM

Setting Up Different Types of Logical Volumes

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

This section contains information on setting up special logical volumes.

Setting Up Logical Volumes for Raw Data Storage

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), consider how large the logical volume must be 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 must be a multiple of the extent size used in the volume group. For example, if a database partition requires 2002 MB and the logical extent size is 4 MB, LVM creates a logical volume that is 2004 MB (or 501 logical extents).

If you plan to use logical volumes heavily for raw data storage (such as for setting up database partitions), consider how the logical volumes are distributed over your disks.

By default, LVM assigns disk space for a logical volume from one physical volume, uses the space on this physical volume entirely, then assigns space from each successive physical volume in the same manner. LVM uses the physical volumes in the order in which they appear in /etc/lvmtab and /etc/lvmtab_p, which means that data of a logical volume might not be evenly distributed over all the physical volumes within your volume group.

As a result, when I/O access to the logical volumes occurs, one or more disks within the volume group might be heavily used, while the others might be lightly used, or not 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”).

Because there are no HP-UX commands that identify that the contents of a logical volume are being used for raw data, create recognizable names for he logical volumes you create for raw data. In this way, you can recognize the contents of such a logical volume.

Setting Up Logical Volumes for File Systems

File systems reside in a logical volume just as they do within disk partitions or nonpartitioned disks. Two types of file systems can be used in a logical volume: Hierarchical File Systems (HFS) and Journaled File Systems (JFS) (VxFS).

Choosing the Initial Size of File System Logical Volumes

When determining the required space for a file system, consider the three major components shown in Figure 2-1.

Figure 2-1 File System Space Components

File System
Space Components

To estimate how big to make a logical volume that will contain your file system, follow these steps:

  1. Estimate how much disk space users will need for their data in the future. Allow for any anticipated changes, which usually include additional growth. (Use the du command to see how much disk space is currently used.)

  2. Add 10% to the above amount for a “minfree” area; this area is reserved to maintain performance.

  3. Add another 5% for file system overhead; this includes all data structures required to maintain the file system.

  4. Round up to the next integer multiple of the logical extent size used in this logical volume to find the size in logical extents. (This step is performed automatically when you create a logical volume.)

For example, if a group of users will require 60 MB space for file system data, the following estimate allows for expected growth. Add 6 MB for the minfree space. Then add 3 MB for file system overhead for a total estimate of 69 MB required by the file system, and 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 4 MB, round 69 to 72 to make it divisible by 4 MB.

Although these estimates are not precise, they suffice for planning a file system size. Create your file system large enough to be useful for some time before increasing its size.

TIP: Because increasing the size of a file system is usually easier than reducing its size, be conservative in estimating how large to create a file system.

An exception is the root file system. As a contiguous logical volume, the root file system is difficult to extend.

Resizing File System Logical Volumes

If your users have outgrown the space originally allocated for the file system, you can increase its size by first enlarging the logical volume it resides in using the lvextend command, then using the extendfs command to enlarge the file system contained in the logical volume.

Decreasing the size of a file system can be difficult. Based on the type of file system, you might not be able to decrease its size. However, you can create a new smaller file system to take its place.

For more information on resizing file system logical volumes, see “Administering File System Logical Volumes”.

File System Logical Volume Guidelines

Use the following guidelines when configuring file system logical volumes:

  • If you create a file system that spans LVM disks, be sure that the logical volume in which the file system resides spans identical disk types for best system performance.

  • By default, LVM creates logical volumes on available disks, not necessarily with regard for best performance. A file system can span two disks with different characteristics, in which case the file system performance can possibly be impaired.

    You can control which physical volumes contain the physical extents of a logical volume by following these steps:

    1. Create a logical volume without specifying a size using the lvcreate command or HP SMH. When you do not specify a size, by default, no physical extents are allocated for the logical volume.

    2. Extend the logical volume (that is, allocate space) to the specific physical volumes you want to contain the file system using the lvextend command.

  • The root or boot logical volume is limited to either 2 GB or 4 GB, depending on your processor.

Setting Up Logical Volumes for Swap

NOTE: Version 2.x volume groups do not support swap logical volumes.

This section explains what to consider when using logical volumes as swap devices. For information on managing your system swap space, including determining how much and what type of swap space the system needs, see HP-UX System Administrator's Guide: Configuration Management.

When configured as swap, logical volumes are treated as device swap space. Device swap space occupies a logical volume or partition, which is typically reserved expressly for swapping purposes. This space can also be configured as a dump area (See “Dump Logical Volume Guidelines”).

Swap Logical Volume Guidelines

Use the following guidelines when configuring swap logical volumes:

  • Interleave device swap areas for better performance.

    Two swap areas on different disks perform better than one swap area with the equivalent amount of space. This configuration allows interleaved swapping, which means the swap areas are written to concurrently, thus enhancing performance.

    When using LVM, set up secondary swap areas within logical volumes that are on different disks using lvextend.

    If you have only one disk and must increase swap space, try to move the primary swap area to a larger region.

  • Similar-sized device swap areas work best.

    Device swap areas must have similar sizes for best performance. Otherwise, when all space in the smaller device swap area is used, only the larger swap area is available, making interleaving impossible.

  • By default, primary swap is located on the same disk as the root file system. By default, the /stand/system system kernel configuration file contains the configuration information for primary swap.

  • If you are using logical volumes as secondary swap, allocate the secondary swap to reside on a disk other than the root disk for better performance.

Setting Up Logical Volumes for Dump

NOTE: Version 2.x volume groups do not support dump logical volumes.

This section explains what to consider when using logical volumes as dump devices. A dump area is disk space used to write an image of the core memory after a system crash. The analysis of a core dump can be useful in troubleshooting and restoring the system to working order.

By default, the primary swap device also serves as a dump area when no dump area is specifically designated. Although you are not required to retain primary swap as your dump area, doing so conserves disk space. You can configure a different or multiple dump devices on your system. To do this, create a logical volume as a dump device. This device can also be used for swap.

For information on adding, removing, or modifying dump devices, and configuring the dump algorithms, see the HP-UX System Administrator's Guide: Configuration Management.

Dump Logical Volume Guidelines

Use the following guidelines when configuring dump logical volumes:

  • HP recommends using logical volumes for dump area rather than disk partitions.

  • A dump logical volume can exist only within the root volume group; that is, the volume group that contains the root logical volume.

  • You can use any secondary swap logical volume as a dump area too, provided the swap area is in the root volume group.

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