Adding SWAP space on exiting Debian Server

Follow below steps add SWAP space to an existing Linux Debian server:

  • Create 2GB swap_file in /swap directory:
    dd if=/dev/zero of=/swap/swap_file bs=1M count=2048

  • Setup file permissions:
    chmod 0600 /swap/swap_file

  • Setup Linux swap area:
    mkswap /var/cache/swap/myswap

  • Enable swapping:
    sudo swapon /var/cache/swap/myswap

Comments

Leave a Reply

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

Captcha
captcha
Reload