swap 大小参考:
Available RAM Swap Space Required
Between 1 GB and 2 GB 1.5 times the size of the RAM
Between 2 GB and 16 GB Equal to the size of the RAM
More than 16 GB 16 GB

#1.新增swap数据块
dd if=/dev/zero of=/opt/swap bs=1M count=16384
#2.格式化成swap分区 mkswap /opt/swap
#3.将权限修改为600
chmod 600 swap
#4.激活swap分区 swapon /opt/swap
#5.在fstab中增加一条记录如下
$ vim /etc/fstab
    /opt/swap       swap    swap       defaults 0 0

4 对 “SWAP分区”的想法;

  1. /dev/sda1 /opt ntfs defaults,user,rw,iocharset=utf8,umask=000,nls=utf8 0 0
    /dev/sda2 /data ntfs defaults,user,rw,iocharset=utf8,umask=000,nls=utf8 0 0
    /dev/sdb1 /win ntfs defaults,user,rw,iocharset=utf8,umask=000,nls=utf8 0 0
    /dev/sdb2 /programe ntfs defaults,user,rw,iocharset=utf8,umask=000,nls=utf8 0 0

  2. # fallocate -l 10G bigfile
    # truncate -s 10G bigfile
    # dd of=bigfile bs=1 seek=10G count=0

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code