A simple way to add extra memory to your machine .
Create an exchange file:
dd if=/dev/zero of=/swapfile bs=1M count=1024
The above will create 1GB file (1M * 1024)
Improving access rights:
chmod 600 /swapfile
Initialize it as a swap
/swapfile swap space immediately:
Make sure that it works:
/swapfile after Linux system reboot, add entry to
Add permanently to
sh -c 'echo "/swapfile swap swap defaults 0 0" >> /etc/fstab'
Yes, just that’s it. From this moment we do not have to combine it with separate partitions, we can at any time enlarge/reduce the created exchange space (dd command).