Swap file

From MEPIS Documentation Wiki

Jump to: navigation, search

In case you don't want to repartition your drive you can still use swap by creating a swap file following these steps:

  1. Find a nice, out of the way place to create this (/var/run/ might be a good choice), cd to that directory and become root
  2. Create 1GB swap file (you can use other size, 512MB for example, the maximum size is 2GB):
dd if=/dev/zero of=swapfile bs=1024 count=1000000
mkswap swapfile
swapon swapfile
  • You need to add this line at the beginning of /etc/fstab file in order to have the swap activated automatically after each reboot:
/var/run/swapfile swap swap rw 0 0

A swap file has lower performance than a swap partition, but it is easier to create and change its size according to your needs.

Personal tools
In other languages