Making a swapfile

  1. Multiply the Mb of swap that you want by 1024. For example, a 256 MB swap file would give 262144.
  2. As root or prefacing the commands with sudo, type the following commands where <size> is the number you got from Step 1:
      dd if=/dev/zero of=/swapfile bs=1024 count=<size>
      mkswap /swapfile
      swapon /swapfile
      /swapfile               swap                    swap    defaults        0 0