swap

To add swap file to linux system, run

dd if=/dev/zero of=/swapfile bs=1M count=1024
mkswap /swapfile
swapon /swapfile

This will create 1 GB swap file, for 2 GB, use

dd if=/dev/zero of=/swapfile bs=1M count=2048

To make it active on boot, edit /etc/fstab, add

vi /etc/fstab

Add

/swapfile swap swap defaults 0 0

Posted in Linux