Increase swap file on Raspberry Pi

Changing swap size on your rPi is pretty straight forward. Raspbian uses a swap file solution dphys-swapfile, and is much easier to change the size of the swap than with standard partition based options.

Edit configuration file /etc/dphys-swapfile, default value on Raspbian is 100 MB of swap:

CONF_SWAPSIZE=100

Simply change the number to desired size in MB and restart dphys-swapfile:

/etc/init.d/dphys-swapfile stop
/etc/init.d/dphys-swapfile start

Of course, don’t forget swap file is physically located on your SD card (usually /var/swap) so it also takes the space there.

That’s it, enjoy your increased size of your swap!

Leave a Reply

Your email address will not be published. Required fields are marked *