Setup your swap partition a flash card in Debian linuxJul 20th, 2012 | By admin | Category: Linux / Freebsd
*A WORD TO THE WISE – DO NOT ATTEMPT THIS*
Flash cards are not designed to handle heavy loads of tiny read/writes all the time and will fail sooner rather than later.. I just had my system go into the shitty with a syslog filled with 1000’s of messages like this: [59443.104957] Write-error on swap-device (8:16:512616) because of having my flash on a flash card. Obviously if you really want to try this then go ahead but you’ve been warned, it’s a bad idea
Sooo, I’ve heard some performance gains about this although overall I would say they are probably in all likelyhood negligible. That and apparently after a year of heavy read/writting your flash card is going to be toast so keep that in mind before you run off to do this. However if you are like me and you just have this god damn itch in you to be different in every way possible then you probably want to setup your flash card here as a swap drive. I know I do!
When do you actually want to do this?
Well the main time you are going to see a performance boost from this is when your hard drive is just read/writing like a motherfucker. This is probably only going to occur at a level where having a flash card swap drive would be a big bonus on production web servers where we are seeing 10’s of thousands of hits per hour with everythign being logged, caches being served, etc etc. For home use, probably not going to make a difference. The other time would be if you have zero disk space left, although in all honesty I would keep the flash card as an ntfs for moving files around easily and do the swap on the hard drive but the more and more I talk about this the less and less I want to do it so here’s how you can go about doing it.
[59443.104957] Write-error on swap-device (8:16:512616)