How to Create a Swap File on Linux
Swap Files vs. Swap Partitions
There are several scenarios where you might want to increase existing or add new swap space to your Linux computer.
- Perhaps your swap space is frequently running at maximum or close to maximum.
- It’s easy to click the wrong option during the installation process and to decline adding swap to your system inadvertently.
- Maybe you previously decided that you had so much random access memory (RAM) you didn’t need any swap, and you’ve changed your mind.
- Sometimes you inherit the administration of a system that has no swap, for reasons you’ll never be able to discover.

