Advertisement
Tritonio

How to set up swap space? raspberry

Mar 15th, 2021
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1.  
  2.  
  3. Raspbian uses dphys-swapfile, which is a swap-file based solution instead of the "standard" swap-partition based solution. It is much easier to change the size of the swap.
  4.  
  5. The configuration file is:
  6.  
  7. /etc/dphys-swapfile
  8.  
  9. The content is very simple. By default my Raspbian has 100MB of swap:
  10.  
  11. CONF_SWAPSIZE=100
  12.  
  13. If you want to change the size, you need to modify the number and restart dphys-swapfile:
  14.  
  15. /etc/init.d/dphys-swapfile stop
  16. /etc/init.d/dphys-swapfile start
  17.  
  18. Edit: On Raspbian the default location is /var/swap, which is (of course) located on the SD card. I think it is a bad idea, so I would like to point out, that the /etc/dphys-swapfile can have the following option too: CONF_SWAPFILE=/media/btsync/swapfile
  19.  
  20. I only problem with it, the usb storage is automounted, so a potential race here (automount vs. swapon)
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement