Auto generate
Run the following commands
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo chmod 600 /var/swap.1
sudo /sbin/swapon /var/swap.1
And then add the line in your /etc/fstab
/var/swap.1 swap swap defaults 0 0
and that’s all folks, now you should run free -m and see the results.