7.1.1.3 Limitations of
Volume Groups Having Paging Space
The following commands are used to manage paging space:
The swapon command is used during early system initialization (/sbin/rc.boot) to activate the initial paging-space device. During a later phase of initialization, when other devices become available, the swapon command is used to activate additional paging spaces so that paging activity occurs across several devices.
Active paging spaces cannot be removed. To remove an active paging space, it must first be made inactive. To accomplish this, use the chps command so the paging space is not used on the next system restart. Then, after restarting the system, the paging space is inactive and can be removed using the rmps command.
| Note |
|---|
|
Paging space cannot be deactivated dynamically. It requires a system reboot. So, any maintenance task that requires removal of paging space will have to be scheduled at an appropriate time to minimize user disruption. |
The paging-space devices that are activated by the swapon -a command are listed in the /etc/swapspaces file as shown in the following example. A paging space is added to this file when it is created by the mkps -a command, removed from the file when it is deleted by the rmps command, and added or removed by the chps -a command.
# pg /etc/swapspaces
* /etc/swapspaces
*
* This file lists all the paging spaces that are automatically put into
* service on each system restart (the 'swapon -a' command executed from
* /etc/rc swaps on every device listed here).
*
* WARNING: Only paging space devices should be listed here.
*
* This file is modified by the chps, mkps and rmps commands and referenced
* by the lsps and swapon commands.
hd6:
dev = /dev/hd6
paging00:
dev = /dev/paging00
paging01:
dev = /dev/paging01
The lsps command displays the characteristics of paging spaces, such as the paging space name, physical volume name, volume group name, size, percentage of the paging space used, whether the space is active or inactive, and whether the paging space is set to automatic. The paging space parameter specifies the paging space whose characteristics are to be shown.
The following examples show the use of lsps command with various flags to obtain the paging space information. The -c flag will display the information in colon format and paging space size in physical partitions.
# lsps -a -c
#Psname:Pvname:Vgname:Size:Used:Active:Auto:Type
paging00:hdisk1:rootvg:20:1:y:y:lv
hd6:hdisk1:rootvg:64:1:y:y:lv
# lsps -a
Page Space Physical Volume Volume Group Size %Used Active Auto Type
paging00 hdisk1 rootvg 80MB 1 yes yes lv
hd6 hdisk1 rootvg 256MB 1 yes yes lv
# lsps -s
Total Paging Space Percent Used
336MB 1%
To make a paging space available to the operating system, you must add the paging space and then make it available. The total space available to the system for paging is the sum of the sizes of all active paging-space logical volumes.
| Note |
|---|
|
You should not add paging space to volume groups on portable disks because removing a disk with an active paging space will cause the system to crash. |
The following example shows the steps to create a new paging space logical volume of size 20 MB in size.
Alternatively, you can go through the SMIT hierarchy by executing the following commands:
# lsps -a Page Space Physical Volume Volume Group Size %Used Active Auto Type paging01 hdisk1 rootvg 20MB 1 yes yes lv paging00 hdisk1 rootvg 80MB 1 yes yes lv hd6 hdisk1 rootvg 256MB 1 yes yes lv
Alternatively, you can also use the SMIT hierarchy by executing the following commands:
You can change only the following two attributes for a paging space logical volume.
The following example shows how to deactivate a paging logical volume, paging03.
Alternatively, you can go through the SMIT hierarchy by executing the following commands:
The following example shows how to increase the size of an already existing paging space, paging03, by 20 MB.
Alternatively, you can go through the SMIT hierarchy by executing the following commands:
The following example shows the steps involved in removing an existing paging space, paging00.
| Note |
|---|
|
Removing default paging spaces incorrectly can prevent the system from restarting. This procedure should only be attempted by experienced system administrators. You must deactivate the paging space (this requires a reboot) before you can remove it. In order to remove a paging space, you must deactivate it first. Paging space cannot be deactivated dynamically. It requires a system reboot. So any maintenance task that requires removal of paging space will have to be scheduled at an appropriate time to minimize user disruption. Check the primary dump device you are using by executing the command sysdumpdev -l. You cannot remove the primary default dump device. You must change the default dump device to another paging space or logical volume before removing the paging space. To change the default dump device, use the following command: sysdumpdev -P -p /dev/new_dump_device |
rmlv:Logical volume paging00 is removed
The following error message is shown when you try to remove an active paging space, paging01.
# lsps -a Page Space Physical Volume Volume Group Size %Used Active Auto Type paging03 hdisk1 rootvg 4MB 0 no no lv paging01 hdisk1 rootvg 20MB 1 yes yes lv paging00 hdisk1 rootvg 80MB 1 yes yes lv hd6 hdisk1 rootvg 256MB 1 yes yes lv # rmps paging01 0517-062 rmps: Paging space paging01 is active. 0517-061 rmps: Cannot remove paging space paging01.
The default installation creates a paging logical volume (hd6) on drive hdisk0, which contains part or all of the busy / (root) and /usr file systems. System administrators may want to reduce the default paging space or move it to a less busy hard disk in order to:
A special procedure is required to remove the default paging space (hd6). These paging spaces are activated during boot time by shell scripts that configure the system. To remove one of the default paging spaces, these scripts must be altered, and a new boot image must be created.
The following example shows the command to check your logical volume and file system distribution across a physical volume, hdisk1.
# lspv -l hdisk1 hdisk1: LV NAME LPs PPs DISTRIBUTION MOUNT POINT hd5 2 2 02..00..00..00..00 N/A hd6 64 64 00..64..00..00..00 N/A paging01 5 5 00..05..00..00..00 N/A hd8 1 1 00..00..01..00..00 N/A hd4 1 1 00..00..01..00..00 / hd2 73 73 00..00..73..00..00 /usr hd9var 1 1 00..00..01..00..00 /var hd3 4 4 00..00..04..00..00 /tmp hd1 1 1 00..00..01..00..00 /home paging00 20 20 00..00..20..00..00 N/A paging03 1 1 00..00..01..00..00 N/A
The following example shows the steps involved in reducing the size of paging space hd6 from 160 MB to 120 MB. The steps in the following procedures are all necessary even those not directly related to hd6. The additional steps are needed because a paging space cannot be deactivated while the system is running.
| Note |
|---|
|
mkps -a -n -s 30 rootvg hdisk0
This command outputs the name of the paging space (paging00 if no others exist).
chps -a n hd6
swapon /dev/hd6
to
swapon /dev/paging00.
# sysdumpdev -l primary /dev/hd6 secondary /dev/sysdumpnull copy directory /var/adm/ras forced copy flag TRUE always allow dump FALSE
# sysdumpdev -P -p /dev/paging00 primary /dev/paging00 secondary /dev/sysdumpnull copy directory /var/adm/ras forced copy flag TRUE always allow dump FALSE
bosboot -d /dev/hdisk0 -a
shutdown -r
rmps hd6
mklv -t paging -y hd6 rootvg 30
sysdumpdev -P -p /dev/hd6
swapon /dev/paging00
to
swapon /dev/hd6.
bosboot -d /dev/hdisk0 -a
chps -a y hd6
chps -a n paging00
shutdown -r
rmps paging00
Moving a paging space with the name hd6 from rootvg to another volume group is not recommended because the name is hard-coded in several places.
Only the paging spaces in rootvg will be active during the second phase of the boot process, and having no paging space in rootvg could severely affect system boot performance. If you want the majority of paging space on other volume groups, it is better to make hd6 as small as possible (the same size as physical memory) and then create larger paging spaces on other volume groups.
Moving the default paging space from hdisk0 to a different disk within the same volume group does not require system reboot.
The following example shows the command to move the default (hd6) paging space from hdisk0 to hdisk1.
migratepv -l hd6 hdisk0 hdisk1
This may take few minutes depending upon the size of paging space.