Skip to content

Instantly share code, notes, and snippets.

@kapil1024
Created December 17, 2021 17:35
Show Gist options
  • Save kapil1024/06b387aad37fc64c80f4ef2365db6855 to your computer and use it in GitHub Desktop.
Save kapil1024/06b387aad37fc64c80f4ef2365db6855 to your computer and use it in GitHub Desktop.
Enable swap space to virtually expand the RAM
  1. Check current state of swap swapon -s

  2. Turn off the swap swapoff -a

  3. Formate a file or block device as swap mkswap /dev/sdX

  4. Update fstab to mount this swap devie/file on every boot echo "/dev/sdX swap swap default 0 0" >> /etc/fstab

  5. Enable swap for current boot swapon /dev/sdX or swapon -a

  6. Verify current state of swap swapon -s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment