Leif160519's blog Leif160519's blog

——————

目录
centos关闭swap
/    

centos关闭swap

使用命令

swapoff -a

重新开启的话使用命令

swapon -a

查看内存和swap分区使用情况

[root@192 ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           3771         253        3178           9         339        3226
Swap:          3967

想永久生效把 vim /etc/fstab 注释 swap那一行

#
# /etc/fstab
# Created by anaconda on Sun Apr 28 16:03:29 2019
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/centos-root /                       xfs     defaults        0 0
UUID=2b6533dc-046d-49c4-8acf-d56ada2dfdad /boot                   xfs     defaults        0 0
/dev/mapper/centos-swap swap                    swap    defaults        0 0

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题centos关闭swap
作  者Leif160519
出  处https://github.icu/articles/2019/08/28/1566981284605.html
关于博主:坐标南京,运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!