Huu Phan | Blog Linux operating system | Linux operating system -Blog Huu Phan | www.huuphan.com

This Blog is protected by DMCA.com

huuphan.com. Powered by Blogger.

How to enable swap-drive on linux

enable swap-drive on linux


in my post, How to enable swap-drive on linux. The solve problem "Swap Not working" on linux such as centos, Fedora 25. 
The open terminal, to check status of swap space ( as run root account) .
swapon -s
lsblk
As the content below
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sr0     11:0    1  1024M  0 rom
sda      8:0    0 465.8G  0 disk
├─sda4   8:4    0 202.1G  0 part
├─sda2   8:2    0 105.9G  0 part /
├─sda5   8:5    0  12.9G  0 part [SWAP]├─sda3   8:3    0     1K  0 part
├─sda1   8:1    0   487M  0 part
└─sda6   8:6    0 144.4G  0 part /media/installed
To turn on swap-drive /dev/sda5
swapon /dev/sda5
To make this permanent start-up on the system
vim /etc/fstab 
As the content below
/dev/sda5 swap swap defaults 0 0
To check, if swap drive that work!
free -h
As the content below
              total        used        free      shared  buff/cache   available
Mem:           3.6G        2.2G        123M        321M        1.3G        809M
Swap:           12G        160K         12G
Thanks your reading. I hope this useful.

post new :

Huu Phan | Blog Linux operating system | Huu Phan ~ Zimbra Mail Server,linux,bash script,centos,linux command | www.huuphan.com