clear-linux-documentation icon indicating copy to clipboard operation
clear-linux-documentation copied to clipboard

Disabling swap in kubernetes tutorial

Open krisiasty opened this issue 5 years ago • 1 comments

Describe the error/improvement to an existing document or image One of the prerequisites described in the kubernetes tutorial page is disabling swap.

Unfortunately, the proposed way to do that does not properly mask systemd service var-swapfile.swap, which is responsible for mounting default swap file (/var/swapfile).

The swapoff -a command disables swap temporarily, but after system is rebooted the unmasked /var/swapfile is again mounted.

The simplest solution would be to add another command to explicitly mask var-swapfile.swap unit:

sudo systemctl mask $(sed -n -e 's#^/dev/\([0-9a-z]*\).*#dev-\1.swap#p' /proc/swaps) 2>/dev/null
sudo systemctl mask var-swapfile.swap 2>/dev/null
sudo swapoff -a

Screenshots If applicable, add screenshots to help explain the error or unexpected behavior.

Environment (please complete the following):

  • Clear Linux OS version: 3372

Additional context

krisiasty avatar Sep 21 '20 20:09 krisiasty

Welcome to Clear Linux* OS Docs. Thanks for submitting your first issue.

github-actions[bot] avatar Sep 21 '20 20:09 github-actions[bot]