Swap files have had the same performance characteristics as swap partitions for more than 20 years and yet, linux distributions continue to encourage the use of swap partitions during install.
Swap files are easier to use/add/remove/modify/extend after installation. They're better in every way––use swap files!
- Create a swap file.
💡 You can use
ddfor this too but if your filesystem supports it,fallocateis faster.
