If somehow you need to add SWAP space in your Linux Box without having to reboot your Box, you could follow these steps. Basically create an Image in your HDD, format it to swap file system, and add it to your swap space, optionally you could add it to your fstab, so it still there during a reboot.
Build the Image
Build the image using dd command, give the size according to your needs. This example shows a 512MB image file.
dd if=/dev/zero of=/path/to/directory/swap.image oflag=direct bs=1M count=512
Format the Image
Format the image to SWAP file type.
mkswap /direktori/swap.image
Activate Your Newly Created SWAP Image
mkswap /path/to/directory/swap.image
Configure fstab
If you want the SWAP survive reboot.
vi /etc/fstab ### add the line similar to /path/to/directory/swap.image swap swap defaults 0 0

One Comment
Wogh… vewwy helpfull, bos.