Adding Swap Space to a Linux box

First make the swapfile (This example adds 256mb):

# dd if=/dev/zero of=/mnt/swapfile1 bs=1024 count=256k
# mkswap -c /mnt/swapfile1

Now attach the file to existing swap space:

# swapon /mnt/swapfile1

Bam! you’re done =)

.: Adam


Leave a Reply