Centos 7 中关闭 swap
- 删除 swap 区所有内容
swapoff -a
- 删除 swap 挂载,这样系统下次启动不会再挂载 swap
# 注释 swap 行 vim /etc/fstab
- 重启系统,测试
swap 一行应该全部是 0reboot free -h
total used free shared buff/cache available Mem: 3.7G 203M 3.1G 8.5M 384M 3.3G Swap: 0B 0B 0B
Centos 7 中关闭 swap
swapoff -a
# 注释 swap 行
vim /etc/fstab
reboot
free -h
swap 一行应该全部是 0
total used free shared buff/cache available
Mem: 3.7G 203M 3.1G 8.5M 384M 3.3G
Swap: 0B 0B 0B