[Tutorial] How to increase SWAP space on Raspberry Pi

in #technology7 years ago

If you own a Raspberry Pi you know that the RAM is limited. This should be no problem, because the SWAP is easy to enlarge with Raspbian. Simply put, the SWAP is a cache which is handled similar to the RAM but it is located on a permanent storage device (SD-card). An advantage is that the size is easy to enlarge but it is not as quick-response as the RAM. In this tutorial I will show you how to enlarge the SWAP with Raspbian.

Step 1:

First you have to generate a SWAP-file. A rule of thumb is RAM x 2 = SWAP.
In this example i generate a SWAP-file with 1024 MB with following commands:

sudo su -c 'echo "CONF_SWAPSIZE=1024" > /etc/dphys-swapfile'
sudo dphys-swapfile setup

Step 2:

After generating SWAP-file you ned to activate it one time only:

sudo dphys-swapfile swapon

Finish!

You now have enough SWAP so that it should be no problem if one day the RAM may be overloaded.

Stay tuned and follow me for more articles, DIY guides, tutorials and interesting projects about the Raspberry Pi.

Sort:  

Congratulations @berryt! You have received a personal award!

1 Year on Steemit
Click on the badge to view your Board of Honor.

Do not miss the last post from @steemitboard:

SteemitBoard - Witness Update

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @berryt! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!