Before we start , Please use the command to check your Ubuntu Systematic SWAP partition
sudo swapon --show
establish swap File for ( distribution 1G Of swap Partition size )
sudo fallocate -l 1G /swapfile
be careful : This may be displayed
fallocate: fallocate failed: Text file busy
Execute at this time
swapoff -a
Reexecution
sudo fallocate -l 1G /swapfile
Execute the following command for swapfile File set the correct permissions :
sudo chmod 600 /swapfile
use mkswap Utility set on file Linux SWAP region :
sudo mkswap /swapfile
Use the following command to activate swap file :
sudo swapon /swapfile
To create a good swap Partition permanent , You can swapfile Path content written to /etc/fstab In the document :
sudo cp /etc/fstab /etc/fstab.bak echo '/swapfile none swap sw 0 0' | sudo tee
-a /etc/fstab
Technology