how to change swap space on ubuntu
# Disable Swap
sudo swapoff /swapfile
# Edit Swapfile to desired size, 2G, 4G etc
sudo fallocate -l 2G /swapfile
# Enable Swap again
sudo swapon /swapfile
# You can check your new swap with
sudo swapon --show
how to change swap space on ubuntu
# Disable Swap
sudo swapoff /swapfile
# Edit Swapfile to desired size, 2G, 4G etc
sudo fallocate -l 2G /swapfile
# Enable Swap again
sudo swapon /swapfile
# You can check your new swap with
sudo swapon --show
how to create a swap file
# Step1: Create a swap file
# If you want to add more swap,
# replace 1G with the size of the swap space you need
sudo fallocate -l 1G /swapfile
# If fallocate is not installed or you get an error message saying
# fallocate failed: Operation not supported then use the following
# command to create the swap file
sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576 # if line 5 executed then leave it
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo nano /etc/fstab
# Paste this in it
/swapfile swap swap defaults 0 0
sudo swapon --show
# Enjoy!
# Credit Linuxize
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us