Using a swap file instead of a swap partition in Linux

  • Thread starter Thread starter gambit
  • Start date Start date
  • Replies Replies 0
  • Views Views 986
Messages
443
Location
NA
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