代碼: 選擇全部
dd if=/dev/zero of=/swapfile bs=1M count=512
mkswap /swapfile
swapon /swapfile
free -m should now show the 512MB swap
add this to /etc/fstab to enable swap at boot time /swapfile swap swap defaults 0 0 If you don't then you need to run "swapon /swapfile" after every reboot
ref: https://www.virtualmin.com/node/33699