Very simple and useful tutorial how to increase swap space.


  1. creat .img file

    sudo dd if=/dev/zero of=/swap.img bs=1M count=1000

note!: bs=1M count=1000 ==> 1GB

(bs * count = size in megabytes )

other example :

sudo dd if=/dev/zero of=/swap.img bs=10M count=100

  1. format .img file

    sudo mkswap /swap.img

  2. enable swap file

    sudo swapon /swap.img

  3. add swap file to fstab

add this line to your fstab (/etc/fstab)

/swap.img   none            swap    sw              0       0
How to increase swap space

Leave a Reply

Your email address will not be published. Required fields are marked *