环境
CentOS 8
来源
https://serverfault.com/questions/684771/best-way-to-disable-swap-in-linux
执行
swapoff -a关闭分区执行
free -h应该可以看到 swap 行的 total、used、free 均为01
2
3total used free shared buff/cache available
Mem: 7.6Gi 6.5Gi 891Mi 8.0Mi 273Mi 938Mi
Swap: 0B 0B 0B编辑
/etc/fstab将 swap 相关行注释