How to enable a SWAP file on Linux @AverageLinuxUser
How to enable a SWAP file on Linux  @AverageLinuxUser
Uploaded June 2017 | Updated September 2026, 2 weeks ago
From this video you will learn how to create and enable a swap file on your Linux system.

Swap partition was a necessity of any linux installation in the past. Nowadays with increased amount of RAM, swap partition is not used at all by some systems. There is no need of large swap. So, you can create small swap file and if it happened that you need more swap you can easily change the size of your swap file. It is especially useful for small size SSD.

This video is primarily designed to show how to enable a swap file in Arch Linux youtu.be/GKdPSGb9f5s

Create a swap file:

sudo fallocate -l 1Gb /swapfile
for F2FS or XFS: sudo dd if=/dev/zero of=/swapfile bs=1M count=512

sudo chmod 600 /swapfile

sudo mkswap /swapfile

sudo swapon /swapfile

add to /etc/fstab the line /swapfile none swap defaults 0 0

sudo nano /etc/fstab


Remove swap file.

swapoff -a
rm -f /swapfile
If you want to remove a swap file completely, remove the relevant entry from /etc/fstab.


Wallpaper can be found in my Google+ Wallpaper collection plus.google.com/collection/YlkQNE


################################################

Support on Patreon: patreon.com/averagelinuxuser

Donate through PayPal: paypal.me/Kryvokhyzha

################################################

More cool Linux stuff at other social media:

Google+ - Best Linux Stuff: plus.google.com/+AverageLinuxUser
Facebook - Top Linux Tips: facebook.com/AverageLinuxUser
Twitter - Daily Linux News: twitter.com/AVGLinuxUser

Website: averagelinuxuser.com
How to enable a SWAP file on LinuxPlasma 5 on Arch Linux  – install & configureHow to set an account image in XFCE.13. Echo command syntaxLinux advantages03. Get FILE INFORMATION from the Linux Command Line10 Essential Things to Do After Installing Ubuntu 23.04 Lunar Lobster10 essential Things to do After Installing Garuda LinuxConfiguring Dolphin file manager09. Alias: Create your own terminal commands (Productivity!)Request Your Linux Video | 10 000 subscribers special 🍾🎉👏🤗SUDO: another fun program? 🤔
Average Linux User |

How to enable a SWAP file on Linux

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER