免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 610 | 回复: 0
打印 上一主题 下一主题

Linux下增加Swap分区方法 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-03-03 16:41 |只看该作者 |倒序浏览
.查看系统Swap空间使用
[root@jumper usr]# free
             total       used       free     shared    buffers     cached
Mem:        513980     493640      20340          0     143808     271780
-/+ buffers/cache:      78052     435928
Swap:      1052248      21256    1030992
2.在空间合适处创建swap文件
[root@jumper usr]# mkdir swap
[root@jumper usr]# cd swap
[root@jumper swap]# dd if=/dev/zero of=swapfile bs=1024 count=10000
10000+0 records in
10000+0 records out
[root@jumper swap]# ls -al
total 10024
drwxr-xr-x    2 root     root         4096  7月 28 14:58 .
drwxr-xr-x   19 root     root         4096  7月 28 14:57 ..
-rw-r--r--    1 root     root     10240000  7月 28 14:58 swapfile
[root@jumper swap]# mkswap swapfile
Setting up swapspace version 1, size = 9996 KiB
3.激活swap文件
[root@jumper swap]# swapon swapfile
[root@jumper swap]# ls -l
total 10016
-rw-r--r--    1 root     root     10240000  7月 28 14:58 swapfile
[root@jumper swap]# free
             total       used       free     shared    buffers     cached
Mem:        513980     505052       8928          0     143900     282288
-/+ buffers/cache:      78864     435116
Swap:      1062240      21256    1040984
[root@jumper swap]#


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/14077/showart_488591.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP