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.