Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I am far less concerned about read/write speeds than I am about write endurance and overall reliability/lifespan of microSD cards in raspberry pi 3/4.

Would be interesting to see a write torture test until failure comparing the samsung "PRO ENDURANCE" microsd cards to regular u1/u3 class cards.



This is a good point, but there is a larger problem anytime you are relying on SD cards for a R/W root partition. Especially when making a product out of one of these boards. It's so easy to follow a tutorial and start an idea from a Bone or Pi or whatever and have some cool functionality and think it's ready to sell. Unfortunately, many of these boards don't have on board flash and by default are booting from SD card with a Linux distribution. It will fail a lot more than a real hard drive does. A cheap SD card is not the same as an SSD when you get down to it, no way around it. Absolutely use the SD card to log data, but don't make booting dependent on cheap removable flash media. Choose an SBC that has high quality flash with good EEC. Source: Experience datalogging with SBCs for 3 companies for 10 years of my career.


I'm curious about the quality of the uSD card holders on all of these units. Do they all use quality non-corrosive fingers with enough force on the contacts?

I once had an intern that told me all about his RPi project to do model rocket telemetry, then after some interrogation sheepishly admitted that the project never quite worked because the g forces and vibration at launch were enough to make the card holder lose contact and the kernel panicked. Bummer.


I think a simpler and easier solution when you have plenty of memory is to use an initramfs [0] as your root, which avoids having to read from disk after boot. Considering the Pi 4 can be had with up to eight gigs of memory now, this is a pretty good solution. Additionally, Buildroot [1] can build a kernel with a compressed initramfs image quickly and easily, for a number of popular single board computers, including the entire Pi family. This allows more than enough functionality for simple and reliable data logging.

EDIT: You couldn't be sure when the disk was ready for writes, so you'd have to log to memory, and have a task that attempts to mount the data partition and flush the buffered data to disk atomically before clearing the buffer.

[0] https://www.kernel.org/doc/Documentation/filesystems/ramfs-r...

[1] https://buildroot.org/


I've got a rocket flight computer I develop d during covid and one of the top things people say about designing these is to add a flash chip to it. The ad card is great to store data and transfer it to a computer but during flight? No way can you rely on the contacts. So during flight, you save all the data to flash, then once landed, dump it to the SD card. SD card got loose? Beep in a special pattern and keep trying to connect to it, I come along , hear the pattern and hold the SD card in until it stops beeping and emits a "happy" sound letting me know it all transferred.

Here's the computer for reference:

https://github.com/AdamMarciniak/CygnusX1


Rockets are difficult environments for connectors, the spring loaded compliant mechanism of an sd card holder just isn’t appropriate for that application. You could get it to work but it would involve a lot of vibration analysis and design to be gentle enough to the connector and you would have to keep track of every time a card was connected and removed.


I bet you could achieve the same results in a lot less time with a lot of glue.


That's very true, but then you have a hard time removing it to get the data from it, or to put new code onto it :)


Newer PIs can boot from the network, in case you need to put new code on because the current code doesn't boot... and you could use the network to fetch data as well. Maybe not as convenient, maybe more convenient, depending.


I wonder if you could fix this with some extra casing around the card slot to make it friction fit. Or an even filthier hack - hot glue/solder it in place, and use a wifi enabled micro sd so you can still access it when the rocket comes back down (and reuse your stuck together sd card monstrosity on multiple launches) .


what exactly goes wrong when these SD cards die in SBCs? does anyone have some idea? they are solid state gadgets after all, using low voltage.


I wrote some notes on this in a sibling comment:

https://news.ycombinator.com/item?id=30761695


Hi! I'm the guy that tested these and I hear you, as I mentioned at the bottom of the post, I'm currently working on stress testing some of the cards through a series of sequential read/write and random IO tests and as soon as I have enough data to justify the post, I shall be putting it up. I don't have a Samsung endurance card, though I'm testing a SanDisk MAX ENDURANCE card in this round.


I've been running the cheaper SanDisk High Endurance in my car dashcam, here in hot Australia for the last two years and it's still going perfect.


I am very interested in this as well. Could even help us with endurance info for other sized cards (like regular SD, etc) if they are using the same chip manufacturer inside!


I'm very interested in seeing how that SanDisk fares. Been thinking about getting it.


Which Samsung cards do you want?


I'm not sure if you're offering to purchase some to have their results added? You really don't have to, but I've created a list to help me keep track of which cards I don't have and wouldn't mind testing at https://www.amazon.se/hz/wishlist/ls/7JG01YVBN93M - I'll add other brands later but this is a good way to keep track of things and monitor prices anyway!


Let me know how testing goes, I always buy Sandisk but Samsung sometimes tugs at my hand before I buy their competitor.


If it was you that purchased the 3 then thank you so much! I should be able to get those and the others I had arrive in the last week added over the weekend. I'll post an update here (if I don't get banned for it? :D) as this will be another 500+ benchmark runs over another 10 cards.

I'll call it a day on performance testing at that point and put a group of them to the test endurance wise then!


Swissbit industrial cards might be interesting to check out to confirm they live up to their claims, but they're pricy.


If you have any suggestions for tests, I have a very large fleet of Raspberry Pi 3/4 with varying SD cards.

We have only had to replace <5 from failed SDs, we have had more stolen than fail.


I've seen failure rates of >5% / year on 24/7 read-only Pi deployments across a variety of name brand consumer microSD cards. Are you getting better reliability than that? What cards have you deployed the most of?


We have a lot (upper hundreds) of the Canvas Go! Plus cards from Kingston. I'll see if I can get some more details. Basically any UHS 3 or better card our supplier can provide. A little over 300 of the Samsung EVO Plus cards.


Would love to hear more details if you can share them!


Did those have log2rak installed with a sensible size ram drive /var/log?


Logs were written to a ram fs. We experimented with occasionally flushing logs to disk, but ended up disabling this and leaving the microSD card filesystem read-only 100% of the time.


Save yourself the headache and switch to USB booting to a proper SSD. Don't try to get maximum lifetime or endurance from dirt cheap micro SD cards.


Two easy ways to mitigate this:

* run alpine in diskless mode, this way all writes are very deliberate and you never have something like a journal eat though your entire card

* use the SD card to boot EDK2 UEFI firmware, and enjoy booting generic ARM images from USB


The main problem with running a Pi on a microSD card isn't write endurance, it's low quality controller and firmware implementations on the cards.

Contributing factors include:

- Even when used read-only, the flash memory occasionally needs to be refreshed, which means the controller needs to shuffle data.

- Controllers have to map drive addresses to flash, and they store their tables on the flash. Firmware bugs, power interruptions, or problems with the flash can render the tables unreadable and lose all data.

- Some controllers even store their firmware on the same flash that is used for user data. So problems there can brick the card.


I don't know if its true or not... but I feel like I lose data when I leave my phone in the car.

Temperature-changes almost certainly changes the physics of the microsd cards. I feel like what's reliable at room-temperature (70F) may not be reliable at 32F or 140F.

Then again, Rasp. Pi setups probably don't care about temperature. But I can imagine cameras, phones, etc. etc. that are left in a car in a wide variety of temperatures who may care.


if you are using raspberry pi you only have 2 options:

- use sd card in read only mode

- use a real drive, no sd card

anything else will result in high likelihood of data loss


How high?


with my own devices, every one. longest run i had was ~1 year. most were much shorter like 2-3mos


That's pretty bad. I've had 3-5+ years (still running) on most of the sdcards in my 5 Pis. There was one exception with a Sony card that only lasted 1+ years, but the other cards have been fine. I periodically take backups for restoratio/creating clones.


We use a Supercapacitor UPS hat to supply enough power for a controlled shutdown due to concerns over SD card corruption (you get around 1 minute). It's been reliable on systems that regularly lose power over a period of around 5 years. The hat we use (Juice4Halt) is more expensive than the SBC though, so that is probably a non-starter for a lot of people.


yes, there was only 1 samsung card tested - they should test more. Basically ALL my SD cards are different flavors of samsung.


> they should test more. Basically ALL my SD cards are different flavors of samsung

I'm looking forward to your blog post with similarly detailed results for your collection of Samsung cards.

(Or your offer of decent contracting rates so "they" can do that for you.)


As the other guy pointed out, I'm doing this in my spare time with hardware I had or was able to procure quickly/at a decent price (this isn't sponsored, sadly!) I don't have many Samsung cards at this time but I'm looking into my options. I already have 4 cards that I'm almost finished with speed testing (SanDisk MAX ENDURANCE, Integra Ultima PRO, Patriot EP and a Kodak model) and will source more as and when I'm able to :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: