#! /bin/sh -f
echo " I will add 30GB wirtual memory to my system\n"
cd /tmp
echo "Display the volume of current swap\n"
free -g
dd if =/dev/zero f=/tmp/bigswap bs=4096 count=7864320
mkswap bigswap
swapon bigswap
echo"Display the volume of swap added\n"
free -g
机器reboot后毅然有效需要修改文件
vi /etc/fstab
增加
/tmp/bigswap swap swap defaluts 0 0