Skip to content

Instantly share code, notes, and snippets.

@sdtaylor
Created December 29, 2016 15:25
Show Gist options
  • Save sdtaylor/8205de113f7bdb488daead18801a6e01 to your computer and use it in GitHub Desktop.
Save sdtaylor/8205de113f7bdb488daead18801a6e01 to your computer and use it in GitHub Desktop.
Linux swap file stuff
#Create a new file
sudo fallocate -l 4G /swapfile
#RW for root only
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
#check swap
sudo swapon -s
#Initiate on boot
sudo echo "/swapfile none swap sw 0 0" >> /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment