Category: ASP

How to increase SWAP on Linux

* __Add a new swap partition__

  • show swap usage
swapon -s
  • turn off swap
swapoff -a
  • create a new swap partition
mkswap /dev/sda1
  • turn swap on
swapon -a

* __Add extra swap using files__

  • create a file (2gb in this case)
dd if=/dev/zero of=/swap_file3 bs=1048576 count=2048
  • make swap
mkswap /swap_file3
  • add to swap
swapon /swap_file3
  • edit fstab if swap file needs to be used after restart
 /swap_file3       none            swap    sw              0       0

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.