The main idea here is to gain more swap space so you can run more applications, but to do so without re-partitioning or messing with the partitions at all.
Since Linux is a unix, and unix uses files for everything, there theory here is that we will make a file (instead of a partition) be used for swap.
This solution has been tested and works under linux kernel versions 1.1, 1.2, 1.3, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5 and 2.6.
Here I make the 256MB file: dd count=256 bs=1048576 < /dev/zero > /dev/swap0Notice that I called the output file /dev/swap0. Keep in mind that it is only a file and not a device or special file in any way.
chmod 000 /dev/swap0Root (the kernel) can read this no matter what anyway but this will keep users out of your virtual memory.
mkswap /dev/swap0
swapon /dev/swap0
/dev/swap0 swap swap defaults 0 0
That's it. I hope you've enjoyed this installment of how to rape linux, see you next time.
2001/06/05 - First writing.
2004/01/15 - Update: It's still pertinent. Updated kernel list.