D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] swap on a separate device.

 

On 23/08/16 19:27, Gordon Henderson wrote:
On Tue, 23 Aug 2016, Tom wrote:

I've been playing with the RaspberryPi for a while and its a fun thing. It can now boot from a 'mass storage' device and I've wondered about using the original SD (or replacement) as a swap device.

Lots of noise about not using ssd for swap - anyone know of a reliable way of doing this?

You can put swap anywhere you can put a file these days. (No need for a swap partition anymore - you can swap to a file via NFS) The question really might be: Does it make sense?

The Pi, by todays standards has relatively slow IO for things like "disk" operations, so having any swap anywhere is not going to be a terribly good thing - if you are running something on a Pi that needs swap, then really, the Pi might not be the best thing to run it on. It's going to run really really slowly.

If you want to boot off a USB drive and have swap on the internal SD card, to just do it - mount the SD card somewhere, dd /dev/zero into a file 1 or 2 GB big, mkswap it, then swapon it. When/If your Pi starts swapping, the life of the SD card will be the last thing on your mind.

(If you're going to boot off USB and have swap on SD, then personally, I'd boot off SD and mount root on the USB - as has been done for years now)

Gordon
https://www.facebook.com/

There are a couple of things that use a bit more memory that the pi offers but they're not interactive so I'd be happy to leave it to it*. I'd quite like it for hibernate too!

*I've built things that needed 64Meg of ram on a 16mhz 386 with 4M of ram before!

Tom te tom te tom


--
The Mailing List for the Devon & Cornwall LUG
https://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq