SD swap space question


The pandora's SD interface maxes out at 12 MB/s writespeed anyway, so I don't think there's much to gain.
 
Last edited by a moderator:
If you're gonna make a real daily use of the swap space (ie. not only 1 hour per month), go for something that maxes out write speeds.
 
Oh, and be sure it's a Linux filesystem compatible SD card if you want a real swap partition, not a swapfile on fat32.
 
Oh, and be sure it's a Linux filesystem compatible SD card if you want a real swap partition, not a swapfile on fat32.

What benefit will you see from using say an Ext2 formatted SD card for swap compared to Fat32?
 
Last edited by a moderator:
Does that mean format it properly?
In all cases yes ^^.


If you look at the SD compatibility link, you'll see that some cards supports only fat32, so your only option here is a swap file.


If you have a fully-compatible card, you can also have a real swap partition. I don't know if it's faster than a swap file, but it's certainly not slower.

What benefit will you see from using say an Ext2 formatted SD card for swap compared to Fat32?
If you put your swap file on a ext2 or a fat32 partition, i'd say i don't know myself about the performance difference. Some says that ext2 can be up to 4X faster, depending on what you do.


Apart this, ext2 is reputed to be more reliable, fragment a lot less, and you can put bigger files on it.
 
Going off that, a 12-15 limit, more than class10 would probly be only a negligible improvement... So, I should drop the $7 for a class10 8GB to dedicate to swap space, then? Or is that gonna be too slow to be worth the money?

You have a $500 handheld computer and you're agonizing over whether to spend an extra $7 to put a twice as large and twice as fast card into it? OK. The answer is yes. Next?


Seriously, though, you'll want to check the list - but keep in mind that the method used to 'test' cards varied greatly among the many people who posted stats to it. There are no guarantees.


If you're truly fretting and loosing sleep over this decision, pick a card or three and post up the brand name, model and place you're thinking of buying it from and ask for opinions on those cards specifically.


There are a -lot- of differences in the 8GB SD cards available on the market. Some can be quite good. Some are so cheaply made that I wouldn't trust them to hold even easily replaceable files.


Your experience may vary.
 
I heard fast cards are rubbish at random access, wouldn't that be a bad thing for swapspace?

Do you have any reliable data for that?


Generally, the access times to solid state media are several factors faster than they are for spinning media. This is such a huge difference that the scale for comparison can get kind of wonky.


If an HDD is 8.4ms and the two SD cards are 0.2ms and 0.4ms - is one truly 'slow' or is it that the test itself becomes flawed or less reliable as you get down into this range?


Generally stating that 'fast cards are rubbish at random access' also implies that all fast cards are the same - which they aren't.


The testing under PanDebian going on in another thread has some interesting results so far - and one of those results is that the testing method is giving some pretty weird results in some cases.


So - can one card be faster than another in this application? Of course. Are any of the modern cards going to be faster at random access than a single spinning disk? I'd be shocked if it were any other way.
 
You have a $500 handheld computer and you're agonizing over whether to spend an extra $7 to put a twice as large and twice as fast card into it? OK. The answer is yes. Next?
Nah, totally bought a 2nd hand 256MB RAM one, so I paid a decent bit less, but it roughly the price difference less effective. But, I regress.


Also, found a 8GB class16 for $9. Same brand they're selling on the iThick site. Probly gonna go with that.
 
Last edited by a moderator:
Good article.


I wish someone would do some solid benchmarks from cards released within the last 12 months though. All of these older class 4 and class 6 cards in 4GB - 16GB capacities - and a lot of them showing just how slow microSD can be.


The internal controllers within SD media have gotten a lot more advanced with the current SDXC batch on the market. It would be interesting to see what they do to these benchmarks, but I'm not going to buy a Raspberry Pi and $1000 worth of cards just to find out.


So, the jury is still a bit out on what constitutes a 'great SD card' from any of the others. The general trend appears to be that newer technology cards are faster, but the variance within is going to be more than the variance between different classifications.


Cool article though.
 
Some idle thoughts


I thought you had to run mkswap on whatever, file or partition


Given that there is some chance (10%,,5%,,1%??) that swap


will kill the flash, from excessive writes,


I think that it should not be in the middle of a card,


where it essentially kills the card if bad


mkswap has a -c parameter, and free will tell you


if you have any reason to worry


I make swap partitions at the end of the card, hoping it is telling the truth


as to what is the end, with priorities working in


That is, I use all the partitions, to p7


FAT32, ext2, 4 swap, all named to avoid confusion


Here is the for construct to append to fstab, with a little editing


for b in 0 1 2 3 4 ;do (for a in 1 2 3 4 ;do `echo LABEL=swap$a$b swap swap pri=$a$b 0 0 >> /tmp/fstab.add`; done);`echo \#Card$b $'\x0a'>> /tmp/fstab.add`; done;cat /tmp/fstab.add ;rm -f /tmp/fstab.add


Each card has a number


But the real problem is slow,(sometimes pathetic) write speeds


and dumb controllers, perhaps a bit mismatched to the nand,


and overly optimised for FAT32


And where to split the partitions????
 
It's hard to define 'middle' of a solid state media device.


There is the front - whatever blob of NAND (or whatever) that the on-card controller has defined as, 'starthere'. The rest though - even if the card works it sequentially - is for lack of better term, 'the rest'.


My theory - if you destroy part of 'the rest' of the card then re-partition and re-format it again, the card should skip over the worn out part as 'bad blocks'. So far, I have -never- worn out any SD memory. Not even the old old old stuff. This is through dozens of cards over a wide variety of devices dating all the way back to a TRG Pro with a CF-SD converter.


So, other than not putting the /swap in the very first partition of the card - because that might actually be special (not sure) - I don't know that it would matter where you put it. The card's own wear leveling should, in theory, make the card last several years anyway.
 
Swap is usually twice the size of the RAM on low-RAM devices.


If you plan to do so, which is perfectly acceptable, so take a small capacity card, and divide it per 2G. It's the max swap size for a partition.


The ugly thing in your setup is that you will drain a bit more current.
 
Back
Top