The swapinfo command shows statistics about device swap as well as file system swap. A typical output of the command follows .
# swapinfo Kb Kb Kb PCT START/ Kb TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME dev 1048576 0 1048576 0% 0 - 1 /dev/vg03/lvol2 dev 8888320 0 8888320 0% 0 - 1 /dev/vg03/lvol8 dev 8888320 0 8888320 0% 0 - 1 /dev/vg03/lvol9 reserve - 317916 -317916 memory 12204752 972444 11232308 8% #
This listing shows that the system has three device swap areas located on lvol2 , lvol8 , and lvol9 in volume group vg03 . The kb AVAIL column shows total swap space on each of these areas; kb USED and kb FREE show the amount of swap space used and the amount of swap space free, respectively. The PCT USED shows the percentage of used swap space. The START/LIMIT column is usually zero except for the file system swap, where it shows the limit imposed on the swap space. The kb PRESERVE column is used for the file system swap area, where it shows the amount of space reserved for ordinary files on the file system. The PRI column shows the swap area priority. The NAME column shows the block device name for the device swap area and the mount point for the file system swap area.
You can use options with the swapinfo command as shown in Table 22-1.
Option | Description |
---|---|
-d | Show device swap areas only |
-f | Show file system swap areas only |
-m | Display sizes in megabytes instead of kilobytes |
-t | Add a total line at the end of the output, which shows the total amount of physical memory and swap area |
Top |