ubuntu empty swap 1

ubuntu empty swap

sudo swapoff -a && sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab

Here is what the above code is Doing:
1. We’re disabling swap by running swapoff -a.
2. We’re commenting out the swap line in /etc/fstab.
3. We’re adding a new line to /etc/fstab to mount the new swap file.
4. We’re creating the new swap file.
5. We’re setting the correct permissions on the new swap file.
6. We’re enabling the new swap file.
7. We’re verifying that the new swap file is enabled.

Similar Posts