HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

How to enable a SWAP file on Linux

17,291 views November 1, 2017 5:20

Watch on YouTube
ChannelAverage Linux User

Description from the creator

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/

About this tutorial

Average Linux User published this 5:20 video tutorial on November 1, 2017. It has been watched 17,291 times on YouTube.

Category
Education
Duration
5:20
Published
November 1, 2017
Views
17,291
Likes
388

Tags

Share

This tutorial in other languages