Disable Swap

swapoff -a
grep '#UUID.*swap' /etc/fstab >/dev/null || sed -i '/UUID.*swap/s/^UUID/#UUID/' /etc/fstab
grep '#/swapfile.*swap' /etc/fstab >/dev/null || sed -i '/\/swapfile.*swap/s/^\/swapfile/#\/swapfile/' /etc/fstab

Last updated