Skip to content

Instantly share code, notes, and snippets.

@placek
Created July 13, 2022 09:10
Show Gist options
  • Save placek/a60eb4c8fecfef4461e87712026b3761 to your computer and use it in GitHub Desktop.
Save placek/a60eb4c8fecfef4461e87712026b3761 to your computer and use it in GitHub Desktop.
Add swap file
dd if=/dev/zero of=/swap_file bs=1G count=16 # create a zero-filled 16GB swap file
fallocate -l 16G /swap_file # alternative, faster way
chmod 600 /swap_file # chmod
mkswap /swap_file # make swap partition on file
swapon /swap_file # apply swap file as a swap partition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment