标签:
生成一个1Gb(bs*count)的文件
[root@localhost ~]# dd if=/dev/zero of=/home/swap bs=1024 count=1024000
强制执行
mkswap -f /home/swap
swapon /home/swap
[root@localhost ~]# dd if=/dev/zero of=/home/swap bs=1024 count=1024000
1024000+0 records in
1024000+0 records out
1048576000 bytes (1.0 GB) copied, 4.21348 s, 249 MB/s
[root@localhost ~]# mkswap /home/swap
mkswap: /home/swap: warning: don't erase bootbits sectors
on whole disk. Use -f to force.
Setting up swapspace version 1, size = 1023996 KiB
no label, UUID=25e27794-76f4-4a0f-9a6a-9f90692396cf
[root@localhost ~]# mkswap -f /home/swap
Setting up swapspace version 1, size = 1023996 KiB
no label, UUID=9eb85935-9021-4f51-bec2-38928d426aaa
[root@localhost ~]# swapon /home/swap
[root@localhost ~]# 标签:
原文地址:http://blog.csdn.net/xiaobin_hlj80/article/details/44994053