Posts List

如何创建swap分区

在安装运行某些软件的时候,有时会碰到一些内存不足的情况,这个时候一个办法就是使用swap分区来虚拟出额外的内存空间。 我们主要使用了swapon这个命令: root@iZ23om0selfZ:~# swapon -h Usage: swapon \[options] \[<spec>] Options: -a, --all enable all swaps from /etc/fstab -d, --discard discard freed pages before they are reused -e, --ifexists silently skip devices that do not exis -f, --fixpgsz reinitialize the swap space if necessary -h, --help display help and exit -p, --priority <prio> specify the priority of the swap device. -s, --summary display summary about used swap devices and exit -v, --verbose verbose mode -V, --version display version and exit The <spec> parameter: -L <label> LABEL of device to be used -U <uuid> UUID of device to be used LABEL=<label> LABEL of device to be used UUID=<uuid> UUID of device to be used <device> name of device to be used <file> name of file to be used 具体方法如下: 1.