Here’s how I setup a swap space on my linux box:
mkdir -p /var/swap dd if=/dev/zero of=/var/swap/swapfile bs=1M count=4096 mkswap /var/swap/swapfile swapon /var/swap/swapfile # - Check settings after setup is complete swapon -s free
Then modify the fstab configuration after setting the swap space
vi /etc/fstab
Append the following line to the fstab file
/var/swap/swapfile swap swap defaults 0 0
The 0’s at the end indicate that the health check of swap is not required during bootup
Advertisements