1、先用命令查看自己的swap多大:
[root@host /]# free -m
2、增加交换分区文件及大小,如果要增加2G大小的交换分区,则命令写法如下,其中的 count 等于想要的块大小:
[root@host /]# dd if=/dev/zero of=/home/swap bs=1024 count=2048000
3、设置交换文件:
[root@host /]# mkswap /home/swap
4、立即启用交换分区文件
[root@host /]# swapon /home/swap
5、再次查看分区,成功扩展2G
[root@host /]# free -m
最后修改于 2020-03-23 12:06:50
如果觉得我的文章对你有用,请随意赞赏
扫一扫支付

