Add Linux swapfile as virtual memory

By technese - Last updated: Friday, November 11, 2011 - Save & Share - Leave a Comment

Add a 1 GByte swapfile:

$ dd if=/dev/zero of=/swapfile bs=1M count=1024
$ mkswap /swapfile
$ swapon /swapfile

to make it available on boot, edit /etc/fstab file and include: /swapfile swap swap defaults 0 0

Posted in Linux • • Top Of Page