Using a swap file instead of a swap partition in Linux

gambit

Member
Messages
460
Using a swap file instead of a swap partition in linux

1. Install Linux without swap partition.
2. Open Terminal and Copy/Paste this one by one.
Code:
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
3. Open Computer > File System.
4. Right Click "etc" folder and Open as Root.
5. Search and open "fstab" file in text editor and Copy/Paste this line at the bottom.
Code:
/swapfile none swap defaults 0 0
6. Done.
 
Last edited:

Top