Tuesday, May 29, 2007
How to add swap space to a running Linux kernel
First of all, you need to be root user for a brief time.
cd /var/tmp <- Go to the area where the temporary swap space will be located.
dd if=/dev/zero of=myswap1 bs=1024 count=1048576 <- Create a '0'-filled archive.
mkswap -c -v1 /var/tmp/myswap1 <- Actually make the swap space.
swapon /var/tmp/myswap1 <- Activate the swap space and add it to the kernel memory mapping facility.
You can make as many swap files as you need. I don't know if their size has a limit.