首页 > 其他网络资源 > 如何创建SWAP交换分区

如何创建SWAP交换分区

三月 2nd, 2015 关键字:

1、创建1GB的swap


# dd if=/dev/zero of=/swapfile bs=1k count=1024k
# dd if=/dev/zero of=/swapfile bs=1k count=2048k
# mkswap /swapfile
# swapon /swapfile
# echo "/swapfile	swap	swap	auto	0	0" | sudo tee -a /etc/fstab
# sudo sysctl -w vm.swappiness=10
# echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf


2、创建2GB的swap


# dd if=/dev/zero of=/swapfile bs=1k count=2048k
# mkswap /swapfile
# swapon /swapfile
# echo "/swapfile	swap	swap	auto	0	0" | sudo tee -a /etc/fstab
# sudo sysctl -w vm.swappiness=10
# echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf

Godaddy优惠
固定链接: http://www.cnyinxingshu.com/208.html Godaddy优惠码
Comments are closed.