How to Move Swap To A File On Your Linux Filesystem
- Turn off your current swap partition. ...
- Remove your old swap entry from the /etc/fstab file. ...
- Create a swap file. ...
- Set the swap file permission to 600. ...
- Format the newly created file as swap: ...
- Enable the newly created swap file: