AIXSwapInformation

How to display swap information under AIX

Adding swap (see also AIXAddSwap) under AIX can be a pain in the neck if you don't know where that swap is, and how it can be expanded.

Therefore, here is a small primer on how to do just that:

1. Three magical commands

Here are the three commands you can use:

  1. swap -s: displays summary information on swap.
  2. swap -l: displays longer information on swap.
  3. lspv -p disk: displays swap information on a single disk.

For instance, here is the swap information on an AIX disk:

# lspv -p hdisk0
hdisk0:
PP RANGE  STATE   REGION        LV NAME             TYPE       MOUNT POINT
  1-1     used    outer edge    hd5                 boot       N/A
  2-29    used    outer edge    paging00            paging     N/A
 30-109   used    outer edge    u01                 jfs2       /u01
110-110   used    outer middle  hd6                 paging     N/A
111-126   used    outer middle  lg_dumplv           sysdump    N/A
127-133   used    outer middle  hd6                 paging     N/A
134-137   used    outer middle  hd9var              jfs        /var
138-169   used    outer middle  hd1                 jfs        /home
170-189   used    outer middle  hd3                 jfs        /tmp
190-209   used    outer middle  hd10opt             jfs        /opt
210-217   used    outer middle  hd9var              jfs        /var
218-218   used    center        hd8                 jfslog     N/A
219-219   used    center        hd4                 jfs        /
220-220   used    center        hd2                 jfs        /usr
221-221   used    center        hd9var              jfs        /var
222-222   used    center        hd3                 jfs        /tmp
223-223   used    center        hd1                 jfs        /home
224-224   used    center        hd10opt             jfs        /opt
225-244   used    center        hd2                 jfs        /usr
245-253   used    center        hd4                 jfs        /
254-292   used    center        hd1                 jfs        /home
293-313   used    center        hd2                 jfs        /usr
314-325   used    center        hd9var              jfs        /var
326-337   used    inner middle  hd9var              jfs        /var
338-369   used    inner middle  hd1                 jfs        /home
370-433   used    inner middle  paging00            paging     N/A
434-533   used    inner edge    paging00            paging     N/A
534-534   used    inner edge    loglv05             jfs2log    N/A
535-542   free    inner edge

The paging portions of the disk shown above are, in fact, the current swap of the AIX server.

2. Quick cure for swap problems:

One quick solution for swap-related problems -- which may or may not work on your AIX machine, so please be cautious!! -- is to use the varyonvg command, as follows:

varyonvg rootvg
swapon -a

You can replace, in the example above, rootvg by a VG that contains swap. The command swapon -a activates all the swap partitions on an AIX machine.

See Also: