ubuntu increase swap size
# Create an empty file:
dd if=/dev/zero of=/media/fasthdd/swapfile.img bs=1024 count=4M
# Bake the swap file:
mkswap /media/fasthdd/swapfile.img
# Bring up on boot:
# Add this line to /etc/fstab
/media/fasthdd/swapfile.img swap swap sw 0 0
# Activate:
swapon /media/fasthdd/swapfile.img
# or restart computer
# Check effect:
cat /proc/swaps
grep 'Swap' /proc/meminfo