Linux添加Swap

cd /

dd if=/dev/zero of=swapfile count=4096 bs=1MiB

chmod 600 swapfile

mkswap swapfile

swapon swapfile

swapon -s

free -m

vim /etc/fstab

/swapfile   swap    swap    sw  0   0