I am not really a fan of "embedded" devices that have to be shut down properly. You can never assume that you won't lose power, and I think there are a lot of flaky/bricked rPis as a result of SD not handing power loss well. But it's cheap, and you just reimage the thing and go when your SD card gets corrupted.
When I last worked on embedded Linux, our OS image was read-only and the writable storage was literally initialized at boot with "mount /dev/mmc1 /storage || mkfs.ext4 /dev/mmc1". That is how you get a consistent state after power loss. But throwing everything away at boot doesn't fit the Raspberry Pi model of being half-embedded half-workstation. The result is flakiness.
Is it that SD cards themselves don't "handle power loss well", or is it bad assumptions made by the filesystems chosen to be used on them? Could a filesystem with a specific design avoid SD card corruption?
Spinning drives can also have misdirected writes, but enterprise drives have for decades now (older than SATA) supported commands for flushing their caches, so proper barriers can be maintained.
It seems like a bad model if you ask me, but performance is what reviewers publish, not reliability under failing power, so this is what we get. It is obviously possible to fully journal these internal operations and recover them when power is next available (resulting in FS-level errors, instead of internal errors). But the cards do not do this.
With eMMC, you just have the raw flash cells available directly, so you can write this code. With SD, you don't have enough control to write correct code, so you are stuck with what the vendor gives you.
I'm not sure if that's enough by itself.
A lot of what proper SSDs is to do the right wear leveling to make sure that damaged flash blocks don't cause corruption. eMMC is a pretty broad term that can cover something that's just a soldered SD card to something with a full-blown wear leveling controller.
That's why you still see a lot of eMMC failures in embedded systems when someone forgets to not log to the persistent storage or similar wear heavy operations.
the problem is the Pi is not an embedded device, per se.
It's running a desktop operating system that has to be shut down properly. This is the main reason SD cards get corrupted - there is an unchecked flow of writes to the SD card. This increases the chance of outstanding unsynchronized writes and SD card burnout.
I've said many times that raspi-config should allow an option for mounting the filesystems read-only, with an overlay ram based filesystem.
You can run openwrt on the pi, and the filesystem is set up this way. I run a pi like this and have never seen a corruption problem.
I've had success with this:
http://wiki.psuter.ch/doku.php?id=solve_raspbian_sd_card_cor...
0: USB is supposed to draw < 0.5A @ 5VDC, a resistance of >10Ω. 1F*1Ω=1s, so at 10Ω, each 100uF gets you one millisecond. You do need to worry about voltage dropping off over time though.
The standard for consumer-grade SSDs is retention of at least a year after the drive is worn out. When the drive has been used only lightly (which is likely to be the case for a backup drive), retention will generally be several times longer. Flash memory is still not a good choice as an archival medium, but it's not like your bits are going to fade away as quickly as a rechargeable battery.
That is airgapped, but really expensive.
Swap the drive.
https://www.os3.nl/_media/2015-2016/courses/ccf/ccf_tom_fran...
Is it just the limited amount of flash available for remapping? If so, can one use the same trick as with regular SSDs and simply avoid partitioning some space to improve reliability?
There’s another shadow factor. Probably that they are perceived as the only available thing?
Probably also it is stupid easy for a hardware designer / implementer to tack on an SD card interface.
I have several multigb PostgreSQL databases (with checksumming enabled) running from uSD cards for years, scraping data from the web hourly.
I find uSD cards quite reliable, actually (for rootfs use), in contrast to what's being said online all the time.
I also like that it's removable. If it breaks you just pop in another $4 32GB card, restore, and continue where you left off. Compared to soldered on eMMC, that's much more user friendly.
It’s heartening to hear that they’re really, actually workable.
The RPi 4 has a boot process with a programmable boot ROM that should allow for a more "real" bootloader like uboot in the long term, but currently PXE isn't supported.