Skip to content

Instantly share code, notes, and snippets.

@jagamts1
Last active October 24, 2018 05:39
Show Gist options
  • Save jagamts1/9247ad09270942bc18b39fedd2dce1ac to your computer and use it in GitHub Desktop.
Save jagamts1/9247ad09270942bc18b39fedd2dce1ac to your computer and use it in GitHub Desktop.
TO create swap space
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=2048 # count is swap space in mb 2048 mean 2GB ram
sudo /sbin/mkswap /var/swap.1
sudo chmod 600 /var/swap.1
sudo /sbin/swapon /var/swap.1
To make them as permanent in serer or in system add into the /etc/fstab
/var/swap.1 swap swap defaults 0 0
note:
if ram < 2GB ram:
swap_space = ram*2
elif ram > 2GB ram:
swap_space = ram+2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment