% su Password: root-password
dd if=/dev/zero of=/dir/myswapfile bs=1024 count=number_blocks_needed
where dir is a directory in which you have permission to add swap space. The myswapfile is the name of the swap file you are creating. The number_blocks_needed is an amount of 1024-byte blocks you want to create. See the dd(1) man page for more information.
ls -l /dir/myswapfile
The new file appears in the directory.
See the mkswap(8) man page for more detailed information.
swapon -a /dir/myswapfile
The output shows the allocated swap space.