0%

CentOS关闭swap

环境
CentOS 8

来源
https://serverfault.com/questions/684771/best-way-to-disable-swap-in-linux

  1. 执行 swapoff -a 关闭分区

  2. 执行 free -h 应该可以看到 swap 行的 total、used、free 均为0

    1
    2
    3
                  total        used        free      shared  buff/cache   available
    Mem: 7.6Gi 6.5Gi 891Mi 8.0Mi 273Mi 938Mi
    Swap: 0B 0B 0B
  3. 编辑 /etc/fstab 将 swap 相关行注释