Create swap file in linux Posted by Carles Loriente on December 26, 2019 · 1 min read Updated on October 21, 2025 Create a swap file executing the following script. If you want to automount the swap file on boot, add to /etc/fstab /swapfile swap swap defaults 0 0 Tags:#linux#swap Found a snippet that saved your day? Consider dropping a tip! ← Previous Post Next Post → Please enable JavaScript to view the comments powered by Disqus.