How to add swap for VPS (Debian, Centos, Ubuntu)?

Swap for VPS

swapon -s

dd if=/dev/zero of=/swap.file bs=1M count=512

chmod 600 /swap.file

mkswap /swap.file

->/etc/fstab 

/swap.file  swap        swap defaults    0    0

swapon /swap.file

or reboot

Article Details

Article ID:
11
Category:
Date added:
14.01.2020 00:17:23
Views:
527
Rating (Votes):
(2)