Which SD Card To Use In A Pi?

There is surprising variation in the performance of SD cards. They are not all created equal and the differences can impact the running of your Raspberry Pi, no matter which model. [Jeff Geerling] wondered exactly how different cards would affect system performance. He ran a number of tests on cards ranging from cheap no-names to well-known brand names. The no-name cards fared pretty badly but even among the brand names there is considerable variation.

microsd-cards-all-tested-raspberry-pi

[Matt] over at Raspberry Pi Spy also tested SD cards and found similar differences. Both tested microSD cards. [Jeff’s] tests were solely on the Pi while [Matt’s] were on Windows 7, Ubuntu, and a Pi.

The discussions in the blog about what to measure were as interesting as the actual results. That lead to determining which software tools to use for the measurement. For example, a system doing a lot of small database reads and writes might work better with one SD card while a system storing and then streaming videos might work better with another card. Another interesting result is that the Pi’s data bus greatly limits the access speeds. [Jeff] measured much higher speeds running the same tests using a Mac with a USB dongle. The cards are capable of much more than the Pi can deliver.

[Matt] also checked the capacity of the SD cards. There are a lot of fakes floating around marked with higher capacities than they actually support. Even getting a brand name card may not help since some are counterfeit. So beware: if the price it too good to be true, it very well may be.

51 thoughts on “Which SD Card To Use In A Pi?

    1. Yep, I have been with Sandisk Ultra Class 10 UHC 1 30+ MB/s SDHC cards for a while now.
      The other day I bought a Sandisk USB 3.0 64GB datastick that is supposed to be about 100MB/s but I haven’t tested it yet.

      I shifted to SD cards a long time ago. I got sick of the ratings on usb flash being over 10 times what you get – and most weren’t rated at all. USB was just lucky dip – without the luck. At least SD cards had some kind of rating.

      I see USB flash is moving more towards specifying a speed.

      1. You should buy brand name original USB drives. I tested my Sandisk 64GB Extreme USB 3.0 stick, it has about 200MB/s reading and 175MB/s writing speed. But it costs $35, you get what you pay for.

        1. BTW the Extreme USB3 is designed along completely different lines than most USB sticks – it uses a USB3->SATA bridge and a low-end SSD (Sandisk pSSD) controller. So random write performance for instance is *much* better than pretty much anything else, and it even supports SMART.

        2. Like I said – it was a long time ago that I shifted away from USB flash to SD. Perhaps things are better in the Flash side now but …

          I just tested a SanDisk Ultra SDHC Class 10 UHC 1 card that I bought online and it claimed 20 MB/s and I get 20MB/s read and 12MB/s write (sequential).

          I also tested a USB 3.0 Sandisk Ultra USB Flash that I bought only days ago from a reputable dealer and it claimed 100MB/s and I get 34MB/s read and 32MB/s write (sequential).

          So it looks like nothing much has changed. USB Flash speed claims are still BS.

          The flash was 64GB and I paid $40 for it from Office Works.

          1. It’s still pretty crap in the USB storage world, you need to buy quality name brand devices to get what the package claims, I have the same experience as Buffalo, I also have a 64GB SanDisk Extreme USB3 drive and get 200MB/s read and 170+MB/s write, they are an impressive drive but have a price to match. I have a ton of USB2 and 3 drives and most are garbage with some interesting exceptions, read speeds are good on almost all of my USB3 drives, but write speeds usually let the cheap ones down, most of the really cheap ones are no faster than a USB2 drive.

            My next big USB drive will be a USB mSATA enclosure with a either a Samsung or Sandisk mSata disk, I’m sick of buying drives that you have no idea how they’ll perform till you open the package and test it yourself.

          2. Hi Martin, you have more or less confirmed what I was saying. If you buy a reasonable brand of SD card then you get the quoted speed. If you buy the same brand USB Flash then your mileage will vary.

            When I was in store – right beside the SD cards I was looking at were some *mobile* SD cards, quite simply they were *slower* cards selling at a *higher* price and being marketed as *mobile* phone cards.

    2. Yup, The Asian country I live in is Flooded with Fake memory cards. SanDisk cards are pretty reliable here, more so than most. The trick to not getting ripped-off are: Don’t buy the top-tier cards, the high price attracts the people who make fakes. Don’t buy what looks like low price cards, it’s almost guaranteed they’re fake and/or bad quality. Pay what the cards are worth and always buy from a trusted seller that does volume sales in memory. Repeat business motivates the seller to take care of you. Do Not Buy Online!

      1. That is a very interesting perspective. We in the states worry about counterfeit electronics quite a bit. But living in the heart of where pretty much all of it is made, you are likely absolutely bombarded with tons of cheaply made stuff masquerading as high end parts. It doesn’t terribly matter with some stuff, but if I had to buy something like an SSD or flash drive, I’d probably end up in the fetal position under my bed, crying myself to sleep when faced with the proposition. And it’s bad enough here!

        1. From what I have read at least in China reputation is a big deal (well I read this in the context of manufacturing / supply chain stuff but I would assume it carries over) – if someone sells you a bad sdcard you’re not going to recommend that seller to a friend. (and the person who recommended that seller to you is now no longer trustworthy) It’s a big chain of trust.

  1. Hey, that’s me! I’ve been a lurker on this site for at least two or three years, and I think this is my first comment here, but thanks for posting this here—a lot of my project ideas are inspired by or derive from things I’ve found on this site.

    And concerning the cards—know that when you test microSD cards in the Pi’s built-in reader, you’ll get different results (slightly, at least) than testing in a USB adapter in the Pi’s USB slots, and _radically_ different than if you test with a good USB 3.0 reader on your full-fledged laptop or desktop! Process is important when doing these kinds of measurements, and I used the exact same Pi, flashed each card with Raspbian Jessie Lite, and ran the tests on the Pis themselves.

  2. I am highly surprised that he got such poor performance from the Samsung EVO, because -at least in my tablet- I get smoking hot performance out of them. That only applies to the “genuine” Samsung, however. There are A LOT of fakes out there, even from reputable dealers. I even got some fake Samsung chips from an Amazon source (which Amazon didn’t hesitate to supply a full refund for.) I resolved the issue by buying directly from Samsung.

    I flat refuse to buy ANY flash directly from a China supplier. I tried it three times from three different suppliers and got fakes all three times. (I did get my money back for all three, but I figure why waste my time?)

    If you buy any flash, download some checker software.

  3. How much confidence can you have that the “BrandX ProductY” card that you buy today has the same internal characteristics of the card of the same name that was benchmarked a couple of months ago?

  4. If the serial number begins with “O”, and it says “Made in Taiwan”, it’s certainly good.
    (Full disclosure: I work for a company in Kaohsiung that is manufacturing genuine microSD cards for several major clients).

    In other news, cheap second-hand 128MB microSD cards can now be bought for $0.45 USD (15 NTD) each on Ruten (Taiwan’s eBay). They’re the perfect size for a mixtape or photo album, if you ever want to give someone a physical copy of music/photos/etc with a postcard or a Christmas card, for example. I want to persuade stationery stores here to stock blank cards with a 128MB microSD for $3 USD (100 NTD). But my visa won’t allow me to have 2 sources of income, so I can’t start that business. Please think about this idea in your area though; I’m sure there’s a healthy profit to be made if the cards actually sell well. And that could revive the romantic mixtape culture that I miss – a YouTube playlist just doesn’t cut it.

    1. “They’re the perfect size for a mixtape or photo album”

      This made me lol for reasons I’m not sure I can explain. I know exactly what you mean–and it was a perfectly reasonable choice of words–but it gives me the mental image of a newly-arrived time traveler getting excited when his new future-friend offers him a mix tape, then when future-friend pulls out an SD card and the traveler a Walkman they both look at eachother like “…the fuck??”

  5. I use those little ARM boards quite a bit, and found that the service life of Sandisk Ultras is quite good.
    Notably, the Sandisk Extreme include wear levelling (should last longer), but we have yet to see the prices adjust to sane levels.

    However, I learned that even the identical model are different after cloning the disk images onto several dozen cards.
    Even off-the-self from a few local retailers, you will get slightly different write speeds and capacities from the same source.
    Excluding the host system workload: sometimes you’ll get average card writes at 8MB/s, and other times it’ll climb to around 16MB/s. The clones out of china are easy to spot given they are usually re-branded older model cards that usually max out at 4MB/s.

    In conclusion, when testing these cards keep in mind some models have over 8MB+ of RAM caching with low-level compression and sector sparing. Thus, one needs to sustain a random byte stream for several seconds to get a correct notion of the performance profile.

    For testing disk capacity, I found F3 by Michel Machado also does performance profiles while checking the disk capacity:
    http://oss.digirati.com.br/f3/index-v4.html

    As log as your adapter can sustain the maximum i/o speeds the will detect most problem cards.

  6. That’s a bit odd result for Sandisk, I have 32GB Ultra microSD, looks like one on the test, half grey-half red. Results I get with Crystal Disk Mark, tested on USB 3.0 port with Kinston USB 3.0 reader/writer are 85MB/s for read and 60MB/s for write. I have two of them, both show same results. I thought that was RPi limit, but some cards perform at 34/34MB/s, so that could be a fake Sandisk card.

  7. Some of those cheap digital camcorders have a variable framerate, depending on how fast the card can accept writes. One I still have kicking around somewhere is rated at 15 FPS at 640×480, but when I inserted a higher speed rated card it was able to record over 20 FPS. Would be interesting to try a class 10 in it. It could do 30 FPS at 320×240. Might be enough speed in it to do that at 640×480 if the card is fast enough.

    Is there any way to discover the real capacity of a fake card then permanently set it to that capacity, so when it’s erased or reformatted it doesn’t get set back to the fake capacity?

      1. When I was new at my job I accidentally deleted all our app’s data. The big boss was mad, but my direct manager said “What’s the problem? *opens empty directory* Do YOU see any incorrect data?”

        I took the lesson to heart and solve all my problems by annihilating the source. :D

        1. lol. well ultimately your direct boss is responsible for the backup procedure.

          I had one job site that was tape backup. I did 4 backups and hid one on top of a ethernet rack. I still got the occasional call when there was a faulty tape drive and some @#^* tech would use all three tapes that they could find before realising that the tape drive was wrecking the tapes.

          It was an international airport and downtime costed about $8000 per minute and the bosses would hang over your shoulder like fire breathing dragons.

      2. Ultimately that solves nothing. The vendor still has all your money and since it’s smashed there is no way to return it. When you get a fake SD card you should do everything in your power to get your money back, so the vendor does not make money. That way the vendor is incentivize to buy genuine merchandise, and not rip people off.

        1. I agree, with the exception that I NEVER return fake flash to a dealer. If they would sell it to you they probably wouldn’t hessitate to turn around and resell it to someone else.
          If they insist on return of product for “disposal” I offer video of me pouring gasoline on them and burning them to a block of carbon. So far nobody has taken me up on it.
          I don’t in fact destroy them. I reformat them to actual size, relabel them and give them away. No worries if I never get them back. They aren’t on the market or further capable of damaging data by writing to non-existant locations. Just slow low capacity memory.

        2. While I agree that I am not assisting collective psychology by using a hammer, I am able to self justify my selfish means to self satisfaction when I see the SD all broken up in liddle iddy bits.

        3. You could always return the pieces. Since of course they wouldn’t want to re-sell it anyway.

          That said, Ebay dealers are so desperately paranoid about feedback ratings, you probably don’t need to. Since Ebay started charging differently for vendors based on feedback, the system’s become ridiculous. 5 / 5 shouldn’t mean “adequate”, it should involve going the extra mile. It’s no longer a simple customer recommendation system.

  8. For my pi I was interested in lifetime very much more than in speed (after my first card died). Looking around I found a bit of beginnings in research (e.g. this Dutch one: https://gathering.tweakers.net/forum/list_messages/1544892). An over-sized card would be a good idea because of wear leveling.
    After deciding that SLC was way too expensive for my purpose, I picked SanDisk’s ‘High Endurance’ card (for dash cam use). Claims are good, but I have no idea what truth is behind it…
    Added to that, I mounted /tmp and /var/log/ with tmpfs, and all other file systems with noatime.
    ([OT] @Peter Burkimsher: nice seeing you around here :))
    Anyone here having ideas about getting the most out of SD life time on a pi?

  9. I have some high speed high capacity SD card (a sandisk ultra 128gb micro sdxc) and its honestly kinda meh, the speeds are pretty crappy (allthough that could related too the tablet i use it in i guess) but whats weirder is that its actually only about 105gb, so yea, theres your proof, even sandisk lies about capacity.

    1. That’s just “hard-drive GB”. For reasons which I am convinced are to do with misleading the customer, despite what anyone says, hard drives use 1,000,000 bytes as 1MB, rather than 2^20. So your card is, presumably, 128,000,000,000 bytes.

      I dunno WHY, since memory chips are all made to binary-power sizes, since they’re addressed in binary. Perhaps the missing 23GB is partly for system use, partly backup sectors, partly bad sectors that failed testing.

      Bit of maths tells me it’s only around 9GB that should be missing from a 128GB card due to decimal sizing. The rest, I dunno.

  10. Had a lot and lots of problems with kingston sd cards, bad sectors, corrupted files in embedded products i use, they were originals and genuines ones.

    Switched to Sandisk class, problems gone.

  11. one thing not discussed is the operation temperature of the card…for anyone interested in operating the Pi outside.

    some years ago i tried to make a mini audio player for some display box that operated outside. All the cards tested failed some degrees below freezing.

      1. SD cards described here are consumer grade, normally specified to operate over 0C. Depending on the application, it might self heat enough to keep it well and cozy.
        In my application, the device will stay in sleep mode until something happened to wake up the system and play a tune. I cannot tell at which temperature the card failed, but i can tell you it did not work in my freezer at about -18C. After some readouts, it started to get corrupted. I switched to industrial flash memory and did not have the problem after that.

  12. I wish they just shipped 1-8gb (whatever is cheapest) MMC onboard. The whole SD card thing is just a total mess.

    It’s kinda bizarre how the main source of problems with the PI are crappy USB powersupplies and bad sdcards.

  13. Seeing these posts… what might be really useful, is a portable SD card tester. With an option for USB memory sticks too. Perhaps with a Pi Zero as the core. A little box that you plug your storage into, and it runs the standard I/O speed tests, as briefly as possible. Put the results on an LCD, including actual size. You could take it with you if you’re buying from dodgy markets or retailers you don’t trust.

    1. A Raspberry Pi doesn’t have sufficient IO capabilities to push high end USB and SD cards to their limits, especially not USB3, I have a USB3 Sandisk Extreme 64GB drive that can read at 200MB/s and read at 170+MB/s, without USB3 a Pi is useless at this task and even still I’m not convinced it would be able to read and write fast enough to saturate high end drives.

  14. Given the variance and flakiness of SD cards, including the risk of card corruption, I would expect more people to recommend read-only OSs for Raspberry PIs. I’ve done the conversion from Raspi, but it’s complex (eg: https://hallard.me/raspberry-pi-read-only/ ). What I haven’t found yet is a distribution or package that does the set up for you. Can anyone recommend a read-only OS distribution? The features I would look for are: 1) uses apt-get or other package manager (I’ve seen some that are really stripped down, making installation of new packages complex), 2) provides an easy way to switch back and forth between writable and read-only such as the shell aliases in the link above.

  15. I personally tend to run Pis as NFS root, and boot them from tiny cards 64mb-256mb for /boot. Doesn’t impact performance much (may be better?) and is much more reliable. No more card corruption or stuck waiting for fs check.

Leave a Reply to GreenaumCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.