How to create a swap file in linux using dd
Swap file creation As root use dd to create a swap file the size of your choosing (M = Megabytes, G = Gigabytes). For example, creating a 512 MB swap file: # dd if=/dev/zero of=/swapfile bs=1M count=512 Set the right permissions # chmod 600 /swapfile After creating the correctly sized file, format it to swap: