Flash memory generally doesn't have great lifespan for repeated writes; using it as a root device is going to kill it pretty quickly. I had a similar problem once running a NAS off a USB stick; within a year of so the stick would no longer accept new data and I swapped it out for an SSD instead.
I suspect most of the "corruption" RPi users experience is likely bad power (shitty undersized USB power bricks) glitching the CPU and causing the filesystem to corrupt. The SD card is likely doing exactly as it's being told by the host system - write (invalid) data to blocks, which it does.
It's actually weird that Raspberry Pis seem so bad at using SD cards.
I've just scrapped a large PBX which had a whopping 8MB SD card in it. Its 486 processor booted Linux off the SD card, it wrote CDRs to the SD card, it served said CDRs up over a web interface off it, it saved its logs to the card, and all the other day-to-day chatter of a running system.
It was installed pretty much 20 years ago. The date sticker on the SD card shows that it was replaced 18 years ago, presumably as part of an upgrade.
I'm going to guess that it was not a normal COTS SD card, and instead designed for continuous writes.
The factors for SD card failures in raspberry pi seem to be mostly SD cards not meant for the purpose and having things like swap, atime or disk logs enabled which leads to unnecessary writes.
We “lost” a signage device in a facility we were doing an IoT refresh on.
It was an old wyse terminal, and at some point a CF adapter with an SD card was added, and a construction project buried it inside of a block wall. lol. It’s still there.
I’ve had the same issues in the Pi1-3 era, can’t say for sure if it was the Pi, the SD card, or the software running on top (HA was a big culprit). The last issues were probably before 2018-2018. Since then I don’t remember having any failure and I have a bunch of Pi3s and 4s running with flawlessly for about that long, including HA.
Since then I’ve been careful to buy high quality cards, oversized them a bit, optimize the OS and apps with regards to writes (like no unnecessary logging), and paid attention to airflow. The software probably also evolved to fix the issues.
I found GoPros to cook SD cards from time to time. It makes me wonder if normal sized SD are still manufactured and are they more resistant. For years in stores I only saw miro SD with adapter to full size.
"Raspberry Pis are notorious for SD card corruption with unknown causes."
This is not specific to RPis. When an SD card is subjected to "unpredictable" writes it creates potential risk of corruption. The writes are triggered by software, not the RPi hardware
There is no rule that says the RPi user must mount the root filesystem r/w on the card. It can be mounted r/w on mfs or tmpfs, for example, and the card can be removed after boot. Been doing this since 2012
Zero writes to the card, no corruption
It's true these corruption issues are "notorious" but that's due to RPi owner behaviour, not the RPI hardware
And when you say "due to RPi owner behaviour" what you're saying is "due to the default setup". It's a Raspberry Pi problem. The devices are notorious for this issue for good reason.
To use your Raspberry Pi, you must first install (flash) an operating system (OS) onto your storage device, making it a boot device. By default, Raspberry Pi devices check for an OS on any SD card inserted into the SD card slot. Some Raspberry Pi models allow you to boot an OS from other storage devices, such as USB drives, storage connected through a HAT, and network storage. The following instructions assume that you're using a microSD card.
We recommend installing an OS to your storage device using Raspberry Pi Imager on another computer. For instructions, see ~Install using Imager. If you don't have access to another computer for writing an OS image to the storage device, you might be able to install an operating system directly on your Raspberry Pi from the internet. For instructions, see ~Install over the network."
By "RPI owner behaviour" I mean the decision made by the RPi owner in choosing what operating system software to run and how to configure it
When I bought RPi Model B the hardware did not come with an OS pre-installed
It booted only from SD card
It was up to me to choose which OS to run. I did not choose any of the "recommended" operating systems. I was already booting other "diskless" computers using USB sticks with root mounted on tmpfs so I wanted to use that same OS for the RPi
I never experienced SD card corruption with RPi hardware
However I have experienced SD card corruption with other SBCs that had an OS pre-installed, an OS not chosen by me
By choosing to run a "recommended" OS on the RPi perhaps I would experience SD card corruption
But if that happened I would not attriubute it to the RPi. I would blame myself. And I would make different choices going forward
The reason for this comment is that the parent cites "Raspberry Pis" instead of "the software and configuration recommended by the Raspberry Pi vendor"
The recommended software, derived from Debian,^1 and the default configuration of that software is what causes the SD card corruption, not the RPi development board
1. If I am not mistaken the OS recommendations have changed since the RPi was released, e.g., the company was originally recommending RISC OS. Challenge me on this and I'll find the reference
I have a rasperry pi 2 and 4 that have been running on the same size uSD (reputable brand) for 5 years and haven’t had any issues. I have swap turned off. You just have to be aware of the i/o and not do anything stupid. Clearly for heavy i/o with multitasking they are not ideal.
You can buy cards that support SMART if you want to track wear, but they are expensive.
My 3 Pis have destroyed 6 SD cards. One of them also somehow drew too much power when trying to boot and got so hot it burnt me and melted itself but that could have been the power supply. I know the 4s and 5s can blow SD cards if you run them without heatsinks.
What I'm saying is, your anecdotal evidence of two pis doesn't justify saying we did something wrong with the configuration. In my experience raspberry pis still behave like "throwaway devices" but their price tags do not justify it anymore.
Yup and I read TFA and it's not clear: "The death and rebirth of my home server" and, somehow, his Raspberry Pi is his server!? Running RAID, I'm Mich (immich), Jellyfin, etc. all from a Pi is amazing.
Don't get me wrong: I've got like seven Pis, 4 NUCs (but only one "recent" N100 one) and even though two of the Pis are up 24/7 (one runs the unbound DNS and the other, well, serves as a router/firewall to isolate my main PC from the rest of the machines) my server, as in the machine that has disks in RAID (ZFS), runs VMs, containers (including Immich and Jellyfin), etc. is a Xeon with ECC RAM.
I had no idea a Pi 4 was that beefy.
Now of course booting off a microSD card: yuk (I know, I know, there are read-only trickeries that can be achieved).
> The important stuff mostly lived in external HDDs and the configuration lived almost entirely in my NixOS configuration.
Yeah NixOS or what-have-you: if you have server, I'd recommend you have a plan B for when it fails. My little infra at home is mostly automated: it's all scripts provisioning the VMs, setting up cloudinit for the first boot, etc.
As long as I've got backups of my config/scripts and of my data, setting up a new server really doesn't take long (heck I did it not long ago, mostly to be sure the "death and rebirth" procedure of my own server was sound).
I personally prefer my 10+ years old Xeon with ECC as a server than my N100 NUC but then the Xeon consumes more energy... YMMV.
> Raspberry Pis are notorious for SD card corruption
True SD cards are less than ideal.
But also I suspect half the problem specifically with Pi and SD cards is that people use cheap-ass SD cards and maybe ones they found in the bottom of a drawer that may or may not have previously been used in another device (e.g. camera).
I suspect if people bought industrial SD cards instead of consumer-grade junk they might get a better lifespan out of them.
I used to get Sandisk cards but recently I stopped using SD cards altogether. When it came time to update from Debian 12 to 13 for my Pi4 I migrated to an NVME USB enclosure for my boot drive. Just yesterday I set up another Pi4 for a project with an M.2 SATA enclosure and in both cases they work just fine.
Alternatively cheapest fix is an m10 optane and nvme enclosure. You maybe need to enable usb quirks in the kernel depending on on enclosure. Costs about 20 bucks all in
That’ll keep the rasp online for essentially forever cause optane isn’t going to wear out
I discovered that barely-used enterprise Intel SSDs (DC S3610, S3700, S3710) were cheap on ebay a year or so ago and I may have bought a few dozen. These things have remaining endurance measured in petabytes. Sure, it’s overkill to have a 200GB enterprise SATA disk as the boot volume for a Raspberry Pi, but this is exactly my kind of overkill.
You can flash them to boot on an USB drive so any ssd, I have a RPI4 that had the sdcard slot ripped, flashed an sd card to instruct it to boot on usb, held it against the pins and now it boots without any sdcard.
Though I'd agree that if you got none the NUC is the better solution as if you add an ssd and power supply to the PI it becomes as if not more expensive for less power
Could be some other hardware issue for you, yeah. I recall there are some problems that can happen if the usb power supply is too weak. But this fixed it for me.
Yeah that's more or less my goal for the setup in the post... I didn't have much time to investigate what else I could move off of the SD card but I suspect there's a few other things I could do. NixOS makes it super easy too.
Can confirm, I've got a pi 5 here that's been running 24/7 for over a year (possibly two)... it boots fine, but anything else makes it run so slowly because the sdcard is trashed.
The current setup writes to the systemd journal at least twice every minute... It's next iteration is getting a proper nvme.
Ho-ho my friend! You want to buy storage for your computer before 2030? I'm so sorry, but you now pay big time, now you sell your car for one nvme drive.
There is no need to bring this up on every mention of buying a computer part. And this is also very wrong. TLC nvme drives go below $40, and the smallest ones have more than enough storage for a pi.
So when I say "every mention" I'm not talking about how many times you in particular did so, it's about it being brought up a lot and this being a completely unrelated post that really doesn't need the complaint.
I didn't notice it being brought up a lot, but also, it wasn't a complaint. It's a joke. Most specifically, taking what is supposed to be cheap compute, and adding something made super expensive is just funny.
Really would just prefer a working, non-buggy, Pi2 maybe without all the crazy extra power + compute + RAM. Or at least have the option, because $20 is more my style for a lot of these tasks, not $150CDN.
I dug up my Pi2 for a project the other day. The plan was for it to be a USB serial to network bridge for up to six devices and to use ZMQ pub/sub for passing commands and telemetry. Most telemetry strings were only 500B but I sometimes see two sequential 32KB mega strings for dumping data. The Pi was choking on the mega strings and they were getting cut off early. I spent forever trying to debug this and eventually figured out it was a hardware issue when the code ran fine on a modern PC. I tried a few tricks to get the Pi to cache more USB data before giving up.
I bought an old Lenovo M92 on eBay, threw in an old 500GB HDD, and it worked perfectly for the job. I had thought about just buying a newer Pi but the 14 year old Lenovo offered better specs at only $38. I promptly bought another more modern version for $100 for my desktop.
Based on benchmarks for an identically specced machine [1], a new Pi 5 edges out on single core performance and TDP but gets beat badly on multi-core and price (4-5x, even on eBay!). There also would have been the extra cost of buying a case for the Pi. I could have spent even more money on a newer mini PC that blows the Pi 5 away entirely. Obviously a Pi (even a Pi 2) is plenty capable of many tasks, I have a Pi 3 running my home assistant but it's hard to justify the extra cost over surplus thin clients that can be purchased for much less. The Pi does have its GPIO bank that's just not offered on any mini PC but I can barely remember how many times I've needed both GPIO and a whole PC-like stack to run code, an ESP8266/32 have worked fine. An external PCIe bus is cool but again, unless you're doing some really unique edge computing, not really much of a selling point.
Power consumption is a concern but they are both so low that unless you're operating off a battery, power consumption is negligible relative to everything else in your house. It would take 2 years to make up the difference in price running at full TDP (38 vs 12W). 38W is low enough that fan noise is barely a concern as well.
Size is also a concern but the difference in size is negligible unless you're trying to cram as much compute power as possible into a mini rack. A mini PC is probably the same size as your home router so just put it there.
I just really can't see the need for running the full size Pis anymore. An old mini PC does a better job for cheaper for server tasks. A Pi Zero 2 or even a Pico are much more inline with the classic Raspberry Pi ideology.
Yeah. I agree. The older Pis did have their limitations, to be sure. But you're hit the nail on the head, a modern but still cheap Pi is very doable. Fixed design flaws, lower RAM still, lower power too!, and just.. cheap compute.
But other avenues exist now, including just old hardware.