Raspberry PI killing memory cards
-
Hi,
Yesterday my controller (HA) went down, after some debugging it seems that there is a problem with the memory card. Then I remembered a colleague which had similar issues but with Domoticz. My Raspberry worked for about 1 year without issues. Do you guys have the same problem? I am thinking to switch to a device (for HA) that supports different types of memory (like this or this).
Cheers!
-
@iancu yes it is a common problem.
https://forum.mysensors.org/topic/3817/raspberry-pi-sd-card-wear-out/1
https://forum.mysensors.org/topic/3579/raspberry-pi-is-frustrating-and-i-wanted-to-vent/
https://forum.mysensors.org/topic/7431/i-have-great-problem-with-raspberry-and-domoticz-and-mysensors-gateway/
-
I have no experience with it myself, but apparently, you can boot your RaspberryPi from an SSD if you want to. Considering how cheep they got recently, you might want to give this approach a try. You'll also need a SATA-to-USB3 adapter in this case.
-
@iancu A solution I'm using is log2ram https://github.com/azlux/log2ram
It writes logfiles to ram instead of SD and only flushes the logfiles to SD e.g. once every day.
Works like a charm!
-
HA should be blind to the storage source your Pi uses, the normal micro-SD is simply a write/write device, though many recommend the industrial versions as more resilient.
MicroSD failures can be due to write fails or power cuts.
After multiple fails here due to power cuts I found a method where the microSD is used as RO boot which then switches all read/write to a slim laptop external drive. The drive eventually corrupted after multiple power cuts, and a UPS finally solved that bizarre problem permanently. The beauty of that method is you can revert to a full blown micro-SD OS should you require it.
As @BearWithBeard commented SSD can be used at considerably faster speed/lower energy load, and are very much cheaper nowadays. Read a review recently where a new Pi4 was fitted with a fast SSD giving blistering benchmarks.
The technique of using the RO boot micro-SD makes it a reversible process.
-
@Yveaux for how long do you use it?
-
@iancu I started with an alternative implementation called ramlog, but overall I have an rpi running for nearly 5 years now using this solution on a single SD card.
-
@iancu I had problems and went down the SSD route. Once the pi was set up I copied all to the ssd and enabled ssd boot - it's been working like a charm since then.
With SSD's at less than £20 now and £5 or less for a usb adaptor cable it is not that expensive. One other thing though is power supply, I cannot emphasise enough how important a quality power supply is to the pi. You could start there first.
-
@skywatch i have the original charger. Does it matter if the SSD is external type?
-
@iancu - had the same issue, went with an old desktop and Proxmox VM instead. Might be more expensive unless you have spare parts.
-
@iancu SSD will be external anyway as the pi lacks any connectors for internal drives. An external ssd is just an internal ssd with the usb converter in the case rather than in the cable. A bonus is that you can throw away the SD card too (probably a fake one anyway)....
As for the power supply, it took me many painful years to get to the point I am at now with a lot of quality supplies sourced from reliable UK companies. The old cheaper supplies are still in use, but for other things now that are less sensitive to defieiencies in the power.
-
@skywatch Agreed entirely on the supply quality for the Pi, but disagree with the "bonus" of throwing away the SD. Murphy's Law applies, a RO card allows you to revert to a spare OS card if the drive ever fails...
The Pi3 has 4xUSB2, the Pi4 uprated to 2xUSB2 + 2xUSB3, the data transfer limits of the Pi3 are lower, but still plenty fast.
PS - I recall some USB adapters for SSD could cause issues for the Pi, fairly sure it was on a video by the "Swiss guy"...
-
@zboblamont said in Raspberry PI killing memory cards:
@skywatch Agreed entirely on the supply quality for the Pi, but disagree with the "bonus" of throwing away the SD. Murphy's Law applies, a RO card allows you to revert to a spare OS card if the drive ever fails...
No problem with your view on this, it gives the OP different ideas and approaches to the original issue. All my pi back themselves up to the SSD or server on a weekly or daily schedule. So I don't worry about reverting the system. I use kingston 20Gb SSD's with usb adaptor cables and all running smoothly.....just wait for something to happen now I have said that!
The Pi3 has 4xUSB2, the Pi4 uprated to 2xUSB2 + 2xUSB3, the data transfer limits of the Pi3 are lower, but still plenty fast.
I just oreder my first pi4 (4Gb) - if it is as good as it seems then a few pi3's will be made into cameras and replaced by pi 4's during the rest of the year. I just wish they put a MCLK out on the pi 4 for pro audio use......ah well......
PS - I recall some USB adapters for SSD could cause issues for the Pi, fairly sure it was on a video by the "Swiss guy"...
Compatability is always going to be an issue is seems. ;(
-
@skywatch
To be clear it's not system data integrity or recovery I was driving at rather than the OS if switched to an SSD or HDD only system.There is a minor delay in booting the micro-SD and switching over to the HDD, but it is a further escape route from Murphy's Law....Plenty of advice to the OP anyway, which is the beauty of the forum.
-
@zboblamont No problem with your thoughts on that
@iancu Hope the answers here have helped a little for you (or maybe confused the issue even more!).... Let us know what tou decied and how it works for you
-
my Domoticz its running on a PNY SD card for more than 2 years and didn't die yet. But i almost don't have power cuts . Any case i have another sandisk ultra sd with an clone from the running SD ready to replace this in case of fail.
You can buy and replace an raspberry by an fast and more expensive device...but this sd cards cost 3.75€ !!! power consumption of 1.5w- 1.9w in idle... what else can i want from my domotic system!edit: i have 4 or 5 sensors transmitting and writing every 15min, so sd write, it's not too heavy,standart usage.
-
I have domoticz and on a rpi with 3 serial gateways. It used to destroy SD cards pretty regularly.
I went with this power supply from Adafruit (It is actually 5.25V) and a UPS.
https://www.adafruit.com/product/1994Also, I use log2ram.
That has finally made my rpi domoticz setup reliable. I have been running about a year without problems. I still back up often. : )
-
Thank you all for the advice! I will try first with log2ram, but for long term I want to install an SSD.
A nice week to all!
Suggested Topics
-
Update RF24 library to latest version
Bug Reports • 23 Mar 2014, 23:37 • andriej 24 Mar 2014, 22:52 -
Old hardware migration
General Discussion • 29 Feb 2024, 03:43 • dbemowsk 1 Mar 2024, 23:03 -
What's a good power bank for use with IoT?
General Discussion • 14 Dec 2021, 17:28 • NeverDie 17 May 2024, 15:03 -
Running out of nodeId's
General Discussion • 3 Sept 2024, 07:33 • NielBierman 12 Oct 2024, 19:11 -
How to great variables
General Discussion • 16 May 2024, 14:43 • wint0178 22 Jul 2024, 06:11 -
GatawayESP8266 - Compile error
General Discussion • 18 May 2021, 11:50 • skom 5 Jun 2024, 15:55