备忘-快速开启swap

fallocate -l 4G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

使用swapon -s 查看是否生效

swapon -s

Filename Type Size Used Priority
/swapfile file 4194300 0 -1