You might want to change the amount of swap space on your system because of performance considerations or hardware changes. For example, you might decide to distribute swap space across multiple disks, or increase the amount of swap space because additional RAM was added to your system.
To add swap space on an already installed system:
dd if=/dev/null of=file oseek=num bs=blocksizewhere file is the full pathname of the new file, blocksize is the block size of the root file system, and num is chosen so that num multiplied by the blocksize equals the number of MBs of swap space desired. The file must be in the root filesystem (``/'').
This example creates a 200MB file on the default vxfs root filesystem:
dd if=/dev/null of=/outputfile oseek=200 bs=1024k
The device_name is the name of the file you created using the dd command, the start_offset is ``0'', and the minus sign indicates that the entire file is to be used as the size of the new swap space.
For example, the following sequence of commands configures 32MB of swap space:
dd if=/dev/null of=swapfile oseek=32 bs=1024k0=0 records in 0=0 records out #
ls -l swapfile-rw-r---r-- 1 root sys 33554432 Jul 18 11:58 swapfile #
swap -a swapfile#
swap -lpath dev swaplo blocks free /dev/swap 38,2 0 819312 819312 swapfile 38,513 0 65536 65536
See swaptab(4) for more information about the /etc/swaptab file and dd(1M) for information about the data dump command.
To reduce swap space on an already installed system:
where vtoc-file is any unique filename you choose.
The swap slice is usually defined on slice 2, and the current size (in sectors) of swap space is listed under the column labeled SIZE.
In effect, you have divided one slice into two slices. Refer to prtvtoc(1M) and edvtoc(1M) for more information on those commands.