Friday, 24 June 2011

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

How to reduce the default paging space (hd6)

1.  Determine how many paging space LVs exist on the system using:

lsps -a

If there is only one this will be known as hd6. However, if there is
more than one in rootvg, note the names.

2. Check the number of free PPs available in rootvg using:

lsvg -p rootvg

3. Create a paging space to be used temporarily during this exercise using:

mkps -s X -a rootvg

(where X is a number between 1 and the number of free PPs shown in part
2 above, e.g. 20)
Check the name of the new, temporary paging space using the 'lsps -a'
command again. It will probably be paging00.

4. Change the characteristics of hd6 so that it will be inactive at the
next reboot:

chps -a n hd6

5. Edit the file /sbin/rc.boot.

Change "swapon /dev/hd6" to "swapon /dev/pagingXX"
where XX is the number of the new paging space created in step 3.

6. Determine which is the boot disk using:

lslv -m hd5

NB: If the system is a /usr client, a diskless client or a dataless
client, do not go beyond this point.


7. Run the bosboot command:

bosboot -a -d /dev/hdisk#

where # represents the number of the disk determined in step 6.

8. Reboot the system to inactivate hd6:

shutdown -Fr

9. hd6 cannot be removed while it is the default dump device. To check the
dump device:

sysdumpdev -l

If hd6 is set as either the primary or secondary dump device, reset the
pointer using:

sysdumpdev -P -p /dev/sysdumpnull (if hd6 is the primary dump device)

sysdumpdev -P -s /dev/sysdumpnull (if hd6 is the secondary dump device)


NB: the -P flag sets the dump device permanently. If this is not used,
it will revert back to the default value of hd6 on reboot.

10. Remove hd6 and create a new, smaller hd6 using:

rmps hd6

mklv -y hd6 -t paging rootvg SIZE

where SIZE is the PS size in LPs.

NB: the new paging space should be created as hd6 due to some scripts
being hard-coded to activate /dev/hd6.

11. Edit /sbin/rc.boot. Change "swapon /dev/pagingXX" to "swapon /dev/hd6"

12. Check that hd6 is marked to be automatically swapped on at boot time
using:

lsps -a

There should be a "y" under the "auto" column. If there is an "n",
run:

chps -a y hd6

13. Run the bosboot command using the disk determined in step 6, as before:

bosboot -a -d /dev/hdisk#

If a temporary paging space was not created, this procedure is now
finished. If you used a temporary paging space, continue to the end of
this document.

14. Change the temporary paging space to be inactive on the next reboot:

chps -a n paging00

15. To inactivate the temporary paging space, the system must be rebooted:

shutdown -Fr

16. Remove the temporary paging space:

rmps paging00

17. If the dump device was changed in step 9, it must be reset to look at
the new, smaller hd6:

sysdumpdev -P -p /dev/hd6

or:

sysdumpdev -P -s /dev/hd6

depending on whether it is the primary or secondary dump devic

No comments:

Post a Comment

Twitter Bird Gadget