Creating Linux Swap Space For Extra Memory

Sometimes we might need to have the extra memory for certain tasks and this is just a rough guide to increase swap space to get more memory especially if we have SSD storage which has faster io

  1. dd if=/dev/zero of=/extraswap1 bs=1M count=16384
  2. mkswap /extraswap1
  3. vi /etc/fstab
  4. Add the following
    /extraswap1 none swap sw 0 0
    (note : 16384 is 16GB where 16x1024)

We can keep on adding swap files and delete it when we don’t need it.

More details from

1 Like