All notes
Swap

Quick start

Add additional swap

digitalOcean: add swap on ubuntu provides the suggestion on the fast "fallocate" way. suseGeek.com.


# -t, --total. Display a line showing the column totals.
# o, --old. Display the output in old format, the only difference being this option will disable the display of the "buffer adjusted" line.
free -toh

# -s, --summary
swapon -s

# Create a 4 Gigabyte file
sudo fallocate -l 4G /swapfile

sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

btrfs for swap

NOTE: Btrfs does not yet support swap files. If you encounter "swapon failed: Invalid argument", it is probably because the swapfile you just created is using btrfs.