Posts Tagged ‘mkswp’

Make Swap File

Friday, July 10th, 2009

So you kinda screwed up when you did your partitions and now need more swap. Here's a quick and easy way to use a swap file, which should perform almost as well as a swap partition.

1. Make a big ol' 2G file

dd if=/dev/zero of=/myswapfile bs=2097152 count=1000

2. Tell that file it's a swapfile

mkswp /myswapfile

3. Activate it

swapon /myswapfile

4. Check your work

swapon -s

You should see your myswapfile in there. Want it to be a permanent solution instead of a quick fix? Add this to /etc/fstab

/myswapfile swap swap defaults 0 0