Difference between revisions of "Swap"
From Wasya Wiki
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | swapon --show | |
− | + | swapoff /swapfile | |
− | + | sudo fallocate -l 4G /swapfile | |
− | + | sudo fallocate -l 8G /swapfile | |
− | + | sudo dd if=/dev/zero of=/swapfile bs=1024 count=4194304 | |
+ | sudo chmod 600 /swapfile | ||
+ | sudo mkswap /swapfile | ||
+ | sudo swapon /swapfile | ||
− | + | # /etc/fstab | |
− | + | /swapfile swap swap defaults 0 0 | |
− | + | sudo swapon --show | |
− | + | sudo free -h | |
− | + | cat /proc/sys/vm/swappiness | |
− | + | sudo sysctl vm.swappiness=10 | |
− | + | sudo swapoff -v /swapfile | |
− | + | # and remove the entry from /etc/fstab | |
− | + | sudo rm /swapfile |
Latest revision as of 05:13, 1 February 2024
swapon --show swapoff /swapfile sudo fallocate -l 4G /swapfile sudo fallocate -l 8G /swapfile sudo dd if=/dev/zero of=/swapfile bs=1024 count=4194304 sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile
# /etc/fstab /swapfile swap swap defaults 0 0
sudo swapon --show sudo free -h
cat /proc/sys/vm/swappiness sudo sysctl vm.swappiness=10
sudo swapoff -v /swapfile # and remove the entry from /etc/fstab sudo rm /swapfile