7.1.1.3 Limitations of Volume Groups Having Paging Space

7.2 Managing Paging Spaces

The following commands are used to manage paging space:

chps
Changes the attributes of a paging space.
lsps
Displays the characteristics of a paging space.
mkps
Creates an additional paging space.
rmps
Removes an inactive paging space.
swapon
Activates a 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

7.2.1 Displaying Paging Space Characteristics

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%

7.2.2 Adding and Activating a Paging Space

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.

  1. Run the SMIT fast path smitty mkps to obtain a screen as shown in Figure 69.



    Figure 70: smitty mkps Command

    Alternatively, you can go through the SMIT hierarchy by executing the following commands:

    1. Run smitty.

    2. Select System Storage Management (Physical & Logical Storage).

    3. Select Logical Volume Manager.

    4. Select Paging Space.

    5. Select Add Another Paging Space to get to a screen that prompts you to select a volume group from a menu similar to that shown in Figure 66.

  2. Use the Arrow keys to highlight the rootvg volume group name, and then press the Enter key to obtain a screen as shown in Figure 70.

  3. Type 5 for the field SIZE of paging space (in logical partitions), 5 times 4 MB results in a 20 MB paging logical volume.

  4. Use the Tab key to toggle the field Start using this paging space NOW? from no to yes, or use the F4 key to select it.

  5. Use the Tab key to toggle the field Use this paging space each time the system is RESTARTED? from no to yes.



    Figure 71: Adding Paging Space Attributes

  6. Press the Enter key to create the paging logical volume.

  7. SMIT returns the new device name, paging01, with an OK prompt. Press the F10 key to return to the command line.

  8. You can now use the command lsps -a to check that the new device (paging01) is added and active.
    
    # 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:

    1. Run smitty.

    2. Select System Storage Management (Physical and Logical Storage).

    3. Select Logical Volume Manager.

    4. Select Paging Space.

    5. Select List All Paging Spaces.

    6. When SMIT returns the lsps -a output with the SMIT OK prompt, you can press the F10 key to return to the command line.

7.2.3 Changing Attributes of a Paging Space

You can change only the following two attributes for a paging space logical volume.

7.2.3.1 Increasing Paging Spaces

The following example shows how to deactivate a paging logical volume, paging03.

  1. Run the SMIT fast path command, smitty chps, to get to a PAGING SPACE name prompt screen as shown in Figure 68.



    Figure 72: chps Command Output

    Alternatively, you can go through the SMIT hierarchy by executing the following commands:

    1. Run smitty.

    2. Select System Storage Management (Physical & Logical Storage).

    3. Select Logical Volume Manager.

    4. Select Paging Space.

    5. Select Change / Show Characteristics of a Paging Space to get to a screen that prompts you to select a paging logical volume from a menu similar to that shown in Figure 72.

  2. Use the Arrow keys to highlight the paging03 paging space name and then press the Enter key.

  3. Use the Tab key to toggle the field Use this paging space each time the system is RESTARTED? from yes to no as shown in Figure 72.



    Figure 73: Changing Attributes of Paging Space

  4. Press Enter to change the hd6 paging logical volume.

  5. When SMIT returns an OK prompt, you can press the F10 key to return to the command line.

  6. Reboot the system and run the lsps -a command to confirm that status of paging03 has changed to inactive.

7.2.3.2 Activating or Deactivating the Paging Spaces

The following example shows how to increase the size of an already existing paging space, paging03, by 20 MB.

  1. Run the SMIT fast path command smitty chps to get to a PAGING SPACE name prompt screen as shown in Figure 73.



    Figure 74: chps Command Output

Alternatively, you can go through the SMIT hierarchy by executing the following commands:

  1. Run smitty.
    1. Select System Storage Management (Physical & Logical Storage).

    2. Select Logical Volume Manager.

    3. Select Paging Space.

    4. Select Change / Show Characteristics of a Paging Space to get to a screen that prompts you to select a paging logical volume from a menu similar to that shown in Figure 74.

  2. Use the Arrow keys to highlight the paging03 paging space name and then press the Enter key.

  3. Type 5 for the field NUMBER of additional logical partitions, as 5 times 4 MB will result in a 20 MB increase in paging space.

  4. Press the Enter key to change the hd6 paging logical volume.

  5. When SMIT returns an OK prompt, you can press the F10 key to return to the command line.

  6. Reboot the system and run the lsps -a command to confirm that the size of paging03 has increased.

7.2.4 Removing a Paging Space (Except hd6)

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

  1. Refer 6.3.3, "Changing Attributes of a Paging Space" on page 203 to change the attributes of paging space, paging00, so that it will not be active after a reboot.

  2. Reboot the system by executing the shutdown -Fr command.

  3. When the system is up, login in as root and run the fast path smitty rmps to get to the menu with the title Remove a Paging Space. Alternatively, you can go through the SMIT hierarchy by executing the following commands:
    1. Run smitty.

    2. Select System Storage Management (Physical & Logical Storage).

    3. Select Logical Volume Manager.

    4. Select Paging Space.

    5. Select Remove a Paging Space to get to the same menu.

  4. Press the F4 key to generate a list of paging logical volumes.

  5. Use the Arrow keys to highlight the paging00 logical volume name, and then press the Enter key three times (once to enter the name in the field, once to get the warning, and the third time to run the command).

  6. When SMIT returns an OK prompt with the following message, you can press the F10 key to return to the command line.
    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.

7.2.5 Managing Default Paging Space (hd6)

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

7.2.5.1 Reducing the Size of hd6 Paging Space

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
  • AIX Version 4.2.1, and later, does not support reducing the size of hd6 below 32 MB, or the system will not boot.

  • If you decide to reduce hd6, you must leave enough space for the software in rootvg. A rule of thumb for reducing hd6 paging space is to leave enough space to match physical memory. To find out the amount of physical memory, use the following command:

    lsattr -E -l sys0 -a realmem

  1. Create a temporary paging space on rootvg by executing the following command:
    mkps -a -n -s 30 rootvg hdisk0
    

    This command outputs the name of the paging space (paging00 if no others exist).

  2. Use the following command to deactivate the hd6 paging spaces in preparation for the reboot later in the procedure.
    chps -a n hd6
    

  3. Change the paging space entry in the /sbin/rc.boot file from:
    swapon /dev/hd6
    

    to

    swapon /dev/paging00.
    

  4. Run the following command to check the primary dump device designation.
    # sysdumpdev -l
    primary              /dev/hd6
    secondary            /dev/sysdumpnull
    copy directory       /var/adm/ras
    forced copy flag     TRUE
    always allow dump    FALSE
    

  5. If the primary dump device is hd6, change it to some other paging space. The following command shows how to change the primary dump device to paging00.
    # sysdumpdev -P -p /dev/paging00
    primary              /dev/paging00
    secondary            /dev/sysdumpnull
    copy directory       /var/adm/ras
    forced copy flag     TRUE
    always allow dump    FALSE
    

  6. Create a bootable image with the bosboot command for a hard disk image.
    bosboot -d /dev/hdisk0 -a
    

  7. Put the system key (if present) in the normal position and use the following command, which will both shutdown the operating system and reboot it.
    shutdown -r
    

  8. After the system reboots, remove the hd6 paging space.
    rmps hd6
    

  9. Create a new paging space logical volume of the size 120 MB for the hd6 paging space.
    mklv -t paging -y hd6 rootvg 30
    

  10. Change the primary dump device designation back to be the paging space hd6.
    sysdumpdev -P -p /dev/hd6
    

  11. Change the paging space entry in the /sbin/rc.boot file from:
    swapon /dev/paging00
    

    to

    swapon /dev/hd6.
    

  12. Create a bootable image with the bosboot command for a hard disk image.
    bosboot -d /dev/hdisk0 -a
    

  13. Run the following command to make the new hd6 paging space automatically activate when the system reboots.
    chps -a y hd6
    

  14. Run the following command to change the attribute of temporary paging space, paging00, so that it does not automatically activate after the next reboot.
    chps -a n paging00
    

  15. Put the system key (if present) in the normal position and use the following command to shutdown and reboot the system:
    shutdown -r
    

  16. After the system reboots, remove the temporary paging space.
    rmps paging00
    

  17. Use the lsps -a command to verify the reduced size of the default paging space (hd6).

7.2.5.2 Moving the hd6 Paging Space to Another Volume Group

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.

7.2.5.3 Moving the hd6 Paging Space within the Same VG

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.

7.3 Quiz