vladkrasovsky
12/7/2016 - 12:01 PM

Adding swap file on linux os

Adding swap file on linux os

#!/usr/bin/env bash

#swap file
cd /var;
touch swap.img;
chmod 600 swap.img;
dd if=/dev/zero of=/var/swap.img bs=1024k count=2000;
mkswap /var/swap.img;
swapon /var/swap.img;
echo "/var/swap.img    none    swap    sw    0    0" >> /etc/fstab;