给XEN和KVM虚拟的VPS添加swap分区

888u

Last update at :2024-04-17,Edit by888u

I bought a VPS with 512M memory from 2host.com, but the strange thing is that they only provided 10M swap. This is really annoying! Although it is basically impossible for me to use swap, I still looked unhappy and added a swap partition to the VPS. It is very simple to use Baidu: Enter directory cd /var/ Get 256M file blocks dd if=/dev/zero of=swapfile bs=1024 count=262144 Create swap file /sbin/mkswap swapfile Activate swap file /sbin/swapon swapfile Check out swap /sbin/swapon -s Add it to the fstab file to start automatically when the system boots. vi /etc/fstab echo "/var/swapfile swap swap defaults 0 0" >>/etc/fstab

Recommended site searches: registered international domain name server space rental, registered unregistered domain name, registered domain name, ICP fast filing, telecom IP address query, reverse IP check, foreign host purchasing agency, US virtual space, US website space,

p>

给XEN和KVM虚拟的VPS添加swap分区

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码