SWAP分区

  sre

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 thoughts on - SWAP分区

LEAVE A COMMENT

Captcha Code