swapinfo(1M)
NAME
swapinfo − system swap space information
SYNOPSIS
/etc/swapinfo [-mtadfhqw]
DESCRIPTION
swapinfo prints information about device and file system swap space. By default, it prints to standard output a two line header as shown here, followed by one line per swap area:
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
The fields are:
TYPE One of:
dev Swap space residing on a mass storage device, either outside the file system or consuming some or all of a raw device. This swap space is either statically declared in the kernel, or dynamically added using the swapon command (see swapon(1M)), often in /etc/rc during system initialization based on the contents of /etc/checklist.
fs Dynamic swap space available from a file system, as set by swapon, often as listed in /etc/checklist.
hold Swap space on hold. This is space not allocated on any specific device or file system, but nonetheless held by the kernel for future use “on demand” by existing processes that have not yet consumed all the swap space they might need. It cannot be reallocated until those processes terminate.
Kb AVAIL The total available swap space from the device or file system, in blocks of 1024 bytes (rounded to nearest whole block if necessary), including any swap space already in use. For file system swap areas the value is not necessarily constant. It is the current blocks used for swapping, plus the free blocks available to ordinary users minus RESERVE (but never less than zero). AVAIL is never more than LIMIT if LIMIT is non-zero.
Kb USED The current number of 1-Kbyte blocks used for swapping from the device or file system. Device swap areas are consumed in machine-dependent “chunks” larger than one block (based on the configurable kernel value swchunk; the chunk size defaults to 4 Mbytes on Series 700/800 systems and to 2 Mbytes on Series 300/400 systems). If Kb AVAIL is not a multiple of the number of blocks in a chunk, the left over fraction of a chunk is always shown as used, except on unused swap devices (see below).
Kb FREE The difference between Kb AVAIL and Kb USED.
PCT USED The percentage of capacity in use, based on Kb USED divided by Kb AVAIL; 100% if Kb AVAIL is zero.
START/LIMIT
For device swap areas, this value is the block address on the mass storage device of the start of the swap area; except on Series 800 systems, where it is always “—”, because Series 800 only swaps to a complete device or partition. The value is normally 0 for entire swap devices, or the end of the file system for devices containing both a file system and swap space.
For file system swap areas, LIMIT is the maximum number of 1-Kbyte blocks available from the file system, the same as the limit value given to swapon. A file system LIMIT value of none means there is no fixed limit; all space is available except that used for files, less the blocks represented by minfree (see fs(4)) plus RESERVE.
RESERVE For device swap areas, this value is always “—”. For file system swap areas, this value is the number of 1-Kbyte blocks reserved for file system use by ordinary users, the same as the reserve value given to swapon.
PRI The same as the priority value given to swapon. This value indicates the order in which space is taken from the devices and file systems used for swapping. Space is taken from lower priority swap areas first. priority can have a value between 0 and (NSWPRI − 1) (normally 10), and has a default value of 1.
NAME For device swap areas, the block special file name whose major and minor numbers match the swap device’s ID. The swapinfo command searches /dev for device names first, then /dev/dsk, then /dev/rdsk. If no matching block special file is found, swapinfo prints the device ID (major and minor values), for example, 0,0x0e0200.
For file system swap areas, NAME is the name of a directory on the file system, as given to swapon.
Because it needs kernel access, swapinfo normally succeeds only for the super-user. It reports warnings or errors if unable to access kernel resources such as /dev/mem or /dev/kmem.
Options
swapon recognizes the following options:
−m Display the AVAIL, USED, FREE, LIMIT, and RESERVE values in Mbytes instead of Kbytes, rounding off to the nearest whole Mbyte (multiples of 10242, compatible with the units used in /etc/disktab). The output header format changes from Kb to Mb accordingly.
−t Add a totals line with a TYPE of tot. Beware — this line might be misleading if a subset of −dfh is specified.
−a Show all device swap areas, including those configured into the kernel but currently unused. The word unused appears after the NAME, and the Kb AVAIL, Kb USED, and Kb FREE values are 0. The −a option is ignored unless the −d option is present or is true by default.
−d Print information about device swap areas only. This modifies the output header appropriately.
−f Print information about file system swap areas only. This modifies the output header appropriately.
−h Print information about swap space on hold only.
The −d, −f, and −h options can be combined. The default is −dfh.
−q Quiet mode. Print only a total Kb AVAIL value (with the −m option, Mb AVAIL); that is, the total swap space available on the system (device or file system swap space only if only one of −d or −f is specified), for possible use by programs that want a quick total. If −q is specified, the −t and −a options are ignored.
−w Print a warning about each device swap area that contains wasted space; that is, a fraction of a full swap chunk (see discussion of Kb USED above). This option is effective only if −d is also specified.
HP Clustered Environment
Client nodes can swap either locally or to another cluster node that offers the swap service. If swapinfo is invoked on a client node that swaps locally, local swap information is reported. If swapinfo is invoked on a client node that swaps remotely, it prints one line to standard output that names the swap server host. Refer to System Administrator Manuals for more information on swapping in an HP clustered environment.
RETURN VALUE
swapinfo returns 0 if it completes successfully (including if any warnings are issued), or 1 if it reports any errors.
DIAGNOSTICS
swapinfo prints messages to standard error if it has any problems.
EXAMPLES
List all file system swap areas with a totals line:
swapinfo -ft
AUTHOR
swapinfo was developed by HP.
SEE ALSO
swapon(1M), swapon(2), checklist(4), fs(4).
Hewlett-Packard Company — HP-UX Release 9.10: April 1995