You'll have this problem with any board that is running off sdcards or flash if you are writing to it when you kill the power. So selling the pi and buying the Beaglebone Blacks isn't probably going to change anything.KeithSloan wrote:Yet another power cut today ARRRGH!!!!!
Two Pi SD-card trashed.
Giving up on Raspberry Pi's cannot be bothered with the hassle of re imaging everything when we get a power cut.
Will sleep on it but probably a couple of 2B's headed the way of ebay.
The problem generally happens when the system is writing to the sdcard. So if you have, say, a swap partition and you are using it, there will be writes to it regularly, perhaps often enough that most any power loss messes up the card. Wear levelling is likely at the whole physical disk level so writing to any partition might destroy data all over the card. Ideas include:jahboater wrote:We get about one every two years, but I have a remote controlled power strip and my cat trod on it during the night - powering off all three Pi's.
No SD card problems with any of the Pi's!!
Have two 2B's both run Einstein@home. One reads pressure and puts the data to a ram filing system it also is a webserver with very low trafic. The other acts as a print server but I was not printing when the power cutDougieLawson wrote:I've pulled power on many occasions and haven't corrupted an SDCard since the firmware was fixed a couple of years ago. If you're running 4.1.19 with matching firmware things should be stable.
What are your RPis doing? How much data do you collect, how often? Have you thought about writing data to a USB device (so the SDCard becomes read-only)? My "mission critical" system runs with /boot on an 8GB SDCard and the rootfs on a 160GB hard drive in a USB carrier.
I had this happen once as well and used a similar technique to fix it. Strangely enough it's never happened again even though there have been other power losses and I'm still using the same sdcard.KeithSloan wrote:Okay at the Winchester Pi meeting Dougie managed to fixed the corrupted superblock on the SD card. Any chance he could documented the process as I know he tried various approaches before being successful.
Okay first part was to insert the external SD card reader and run dmesg to find out which device it was i.e. /dev/sd(x)
unmount with command ?
run fsck with command ?
List backup superblocks with command ?
A number of other commands to fix things up.
Adafruit make a very dinky load-sharing battery charger, ideally suited to make an inexpensive UPS for a Pi. There's even a low battery signal, perfect for triggering your Pi to shut-down nicely if the power outage lasts too long.KeithSloan wrote:Yet another power cut today ARRRGH!!!!!
Two Pi SD-card trashed.
Lots of people recommend this. So why is the default Raspbian image not setup in this manner.Heater wrote: Either way, if I want a reliable system I would arrange for the root fs to be read only.
Because the Pi is a tiny PC. Because Raspbian is Debian. Because Debian has been running on our PC's for decades. Because we like to read and write files on our systems and update/upgrade them. You know, like the Windows guys do.Lots of people recommend this. So why is the default Raspbian image not setup in this manner.
If you'd like to experience this on the pi, you can run the tiny core version of their distribution, called picore. The system just boots to memory so you can actually remove the sdcard. If you know power is going to be there, you could one one sdcard and then pi! Of course when you try to make changes, you'll do it normally and they are lost at the reboot. So you'll learn to do the special updating you do when shutting down if you want things saved, but then that might not work right for some reason. Once things are on the sdcard, that should be fine and once you have some way to make sure you've really updated things, fine too. But it is different to just opening a file in vi and :wq it when you are done changing it.KeithSloan wrote:Lots of people recommend this. So why is the default Raspbian image not setup in this manner.Heater wrote: Either way, if I want a reliable system I would arrange for the root fs to be read only.
Definitely keep people informed about your experiences with this for that use.MarkDH102 wrote:On Amazon Prime day last week I pulled the trigger on a RavPower 16750mAh power pack for £14.99.
At last - what seems to be a useable UPS type solution.
For those cases you might want to check out my Nard SDK. It's designed precisely for such scenarios.Heater wrote:if you want to build something else, like an embedded system that has to run unattended for years in a remote location, then you need to think about things.