1.查看系统Swap空间使用

[root@~ 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@~ usr]# mkdir swap
[root@~ usr]# cd swap
[root@~ swap]# dd if=/dev/zero of=swapfile bs=1024 count=10000
10000+0 records in
10000+0 records out
[root@~ 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@~ swap]# mkswap swapfile
Setting up swapspace version 1, size = 9996 KiB

本日志由 flyinweb 于 2011-06-29 16:49:45 发表到 Linux 中,目前已经被浏览 1596 次,评论 0 次;

作者添加了以下标签: swapmkswapswapon

首页只显示了部分日志内容,要查看日志的全部内容请阅读全文