sh [linux:mkswap]在linux上创建交换内存。 #linux

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh [linux:mkswap]在linux上创建交换内存。 #linux相关的知识,希望对你有一定的参考价值。

# Check swapfile and memory status.
$ free
$ cat /proc/swaps

# Verify available storage size.
$ df

# Create 2GB swap.
$ dd if=/dev/zero of=/swapfile bs=1M count=2048
$ mkswap /swapfile
$ swapon /swapfile

# Mount setting on after reboot.
$ vim /etc/fstab
> /swapfile swap swap defaults 0 0

# Unmount swapfile.
$ swapoff /swapfile

# Memory clear and re-mount.
$ swapoff -a && swapon -a

以上是关于sh [linux:mkswap]在linux上创建交换内存。 #linux的主要内容,如果未能解决你的问题,请参考以下文章