如何手动增加swap的空间

本篇内容主要讲解“如何手动增加swap的空间”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“如何手动增加swap的空间”吧!

1.use dd to create a new file for swap

dd if=/dev/zero of=/home/swapfile bs=1M count=1024

2.create the file system which is swap

mkswap /home/swapfile

3.make the new swap file work

swapon /home/swapfile

4.check

swapon -s

5.add the fallowing line into the /etc/fstab for next reboot the system use the new swap file as default;

vi /etc/fstab  -----open

/home/swapfile swap swap defaults 0 0

到此,相信大家对“如何手动增加swap的空间”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!