Debian, create swapfile

From Andreida
Revision as of 11:38, 16 February 2016 by Andreas (talk | contribs) (Created page with " [https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04 source] * create the file and set it read only fallocate -l 4G /swapfile chmod 600 /swapf...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

source

  • create the file and set it read only
fallocate -l 4G /swapfile
chmod 600 /swapfile
  • set as swap and activate
mkswap /swapfile
swapon /swapfile
  • modify /etc/fstab so it will be set after a reboot
/swapfile   none    swap    sw    0   0