|SWAP(8)||Maintenance Commands and Procedures||SWAP(8)|
/usr/sbin/swap -a swapname [swaplow] [swaplen]
/usr/sbin/swap -d swapname [swaplow]
/usr/sbin/swap -l [-h | -k]
/usr/sbin/swap -s [-h]
-a swapname [swaplow] [swaplen]
swaplow is the offset in 512-byte blocks into the file where the swap area should begin. swaplen is the desired length of the swap area in 512-byte blocks. The value of swaplen can not be less than 16. For example, if n blocks are specified, then (n-1) blocks would be the actual swap length. swaplen must be at least one page in length. The size of a page of memory can be determined by using the pagesize command. See pagesize(1). Since the first page of a swap file is automatically skipped, and a swap file needs to be at least one page in length, the minimum size should be a multiple of 2 pagesize bytes. The size of a page of memory is machine-dependent.
swaplow + swaplen must be less than or equal to the size of the swap file. If swaplen is not specified, an area will be added starting at swaplow and extending to the end of the designated file. If neither swaplow nor swaplen are specified, the whole file will be used except for the first page. Swap areas are normally added automatically during system startup by the /sbin/swapadd script. This script adds all swap areas which have been specified in the /etc/vfstab file; for the syntax of these specifications, see vfstab(5).
To use an NFS or local file system swapname, you should first create a file using mkfile(8). A local file system swap file can now be added to the running system by just running the swap -a command. For NFS mounted swap files, the server needs to export the file. Do this by performing the following steps:
share -F nfs -o \ rw=clientname,root=clientname path-to-swap-file
server:path-to-swap-file - local-path-to-swap-file nfs \ --- local-path-to-swap-file -- swap ---
# mount local-path-to-swap-file
# swap -a local-path-to-swap-file
The list does not include swap space in the form of physical memory because this space is not associated with a particular swap area.
If swap -l is run while swapname is in the process of being deleted (by swap -d), the string INDEL will appear in a sixth column of the swap stats.
These numbers include swap space from all configured swap areas as listed by the -l option, as well as swap space in the form of physical memory.
|June 13, 2021||OmniOS|