|
| |
|
| NOTE: Version 2.x volume groups do not support swap logical volumes. |
|
| |
|
When you enable
a swap area within a logical volume, HP-UX determines how large the
area is, and it uses no more space than that. If your disk has enough
remaining contiguous space, you can increase the size of your primary
swap area by using the lvextend command (or HP
SMH) to extend the logical volume, then reboot the system. This procedure
allows HP-UX to use the extra space.
If you plan device swap areas in addition to primary
swap, you get the best performance when the device swap areas are
on different physical volumes. This configuration allows for the interleaving
of I/O to the physical volumes when swapping occurs.
To create interleaved swap, create multiple logical
volumes for swap, with each logical volume on a separate disk. You
must use HP-UX commands to help you obtain this configuration. HP
SMH does not allow you to create a logical volume on a specific disk.
See “Extending a Logical Volume to a Specific Disk”.
You can configure your swap space as described
in HP-UX System Administrator's Guide: Overview.
|
| |
|
| NOTE: You must reboot the system for the system to recognize
changes to the swap configuration. |
|
| |
|
Creating a Swap Logical Volume |
|
To create a swap logical volume, use the lvcreate command. You must set a contiguous allocation
policy using the -C y option. For example:
# lvcreate -C y -n swap_lvol /dev/vgnn |
For more information, see lvcreate(1M).
If you create a logical volume to use as primary
swap, use the lvlnboot command with the -s option to update the swap information used by LVM at
boot. For example:
# lvlnboot -s /dev/vgnn/swap_lvol |
Extending a Swap Device |
|
If you are using a logical volume for swap, you
must increase the logical volume size before increasing the swap size. You can extend the logical volume using lvextend or HP SMH.
Swap logical volumes must be contiguous, so extending
the logical volume succeeds only if there are physical extents available
at the end of the existing logical volume. If contiguous disk space
is not available, create a new contiguous logical volume for primary
swap within the root volume group. You do not need to designate a
specific disk. For example:
# lvcreate -C y -L 48 -n pswap /dev/vgroot |
After creating a logical volume to use as primary
swap, use lvlnboot to update the boot information:
# lvlnboot -s /dev/vgroot/pswap |
Reducing the Size of a Swap Device |
|
If you are using a logical volume for swap, you
must reduce the swap size before reducing the size of the logical volume. You can reduce the size
of the logical volume using lvreduce or HP SMH.