sasha2002 Blog's

Just another blog from admin's

Add swap on Debian 7 —

VPS:/# cd /var
VPS:/var# touch swap.img
VPS:/var# chmod 600 swap.img
VPS:/var# dd if=/dev/zero of=/var/swap.img bs=1024k count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 4.0868896 s, 253 MB/s
VPS:/var# mkswap /var/swap.img
Setting up swapspace version 1, size = 1020 GiB
no label, UUID=72761533-8xbe-436l-b07e-c0sabe9cedf3
VPS:/var# swapon /var/swap.img
VPS:/var# echo "/var/swap.img none swap sw 0 0" >> /etc/fstab
VPS:/var# sysctl -w vm.swappiness=30


Categorised as: Linux



Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.