Skip to content

Instantly share code, notes, and snippets.

@gornostal
Created December 28, 2016 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gornostal/d639034c259d337a843eb3e67d345c18 to your computer and use it in GitHub Desktop.
Save gornostal/d639034c259d337a843eb3e67d345c18 to your computer and use it in GitHub Desktop.
Ubuntu/Linux. Create SWAP file
  • sudo -i
  • cd /var
  • dd if=/dev/zero of=swap.file bs=1M count=2048
  • mkswap swap.file
  • chmod 600 swap.file
  • swapon swap.file
  • // copy UUID
  • vi /etc/fstab ==> UUID=f1ed55b6-357b-4427-86c8-d57f034cf29e none swap defaults 0 0
  • mount -a
  • echo $? // should be 0 if everything is OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment