Openhabian and MicroSD Cards, every 2 month a new one cause they break! I don't know what to do here

Hey guys,

since about two years I’m using Openhab with the actual version of Openhabian 2.3.0.

We have a lot of bindings with 186 Things and about 1.000 Items. Bindings like MySensors, Innogy, Xiaomi,… where we get a lot of status updates from sensors incl. Power measurements, Movement sensors, Temp sensors,…

Unfortunately every 1-2 Month I have do make a copy from the MicroSD Card.

I think the problem is Openhab is writing to much and the MicroSD Cards get broken.

I tried cheap and expensive MicroSD Cards.

The cheap ones are broken about after 1,5 months, the expensive ones may be after 3 months.

I tried:
SanDisk Ultra, SanDisk Extreme, Netac, SDHC, ant many more cards, usually in 32 GB.

I’m using RRD4j (when a MicroSD card gets broken OpenHab is importing the wrong item states and then it opens our Garages and so on) and now I added also InfluxDB.

A example from the log how many changes we have minimum per minute:


2018-10-05 12:14:45.161 [vent.ItemStateChangedEvent] - HomBot_Erstes_CPU changed from 13.31 to 16.26

2018-10-05 12:14:45.353 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.

2018-10-05 12:14:46.900 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.

2018-10-05 12:14:51.289 [vent.ItemStateChangedEvent] - Stromzaeler_W changed from 214 to 181

2018-10-05 12:14:51.299 [vent.ItemStateChangedEvent] - Stromzaeler_counts changed from 1872632 to 1872633

2018-10-05 12:14:51.310 [vent.ItemStateChangedEvent] - Stromzaeler_K changed from 1248.4214 to 1248.4220

2018-10-05 12:14:53.962 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.

2018-10-05 12:15:01.299 [vent.ItemStateChangedEvent] - Stromzaeler_W changed from 181 to 185

2018-10-05 12:15:01.313 [vent.ItemStateChangedEvent] - Stromzaeler_counts changed from 1872633 to 1872635

2018-10-05 12:15:01.324 [vent.ItemStateChangedEvent] - Stromzaeler_K changed from 1248.4220 to 1248.4233

2018-10-05 12:15:02.826 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.

2018-10-05 12:15:05.865 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.

2018-10-05 12:15:09.714 [hingStatusInfoChangedEvent] - 'hue:0200:0017881726c7:1' changed from OFFLINE: Die Hue Bridge meldet, dass die Lampe nicht erreichbar ist. to ONLINE

2018-10-05 12:15:10.740 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.

2018-10-05 12:15:11.307 [vent.ItemStateChangedEvent] - Stromzaeler_W changed from 185 to 211

2018-10-05 12:15:11.422 [vent.ItemStateChangedEvent] - Stromzaeler_counts changed from 1872635 to 1872636

2018-10-05 12:15:11.432 [vent.ItemStateChangedEvent] - Stromzaeler_K changed from 1248.4233 to 1248.4240

2018-10-05 12:15:21.302 [vent.ItemStateChangedEvent] - Stromzaeler_W changed from 211 to 214

2018-10-05 12:15:21.314 [vent.ItemStateChangedEvent] - Stromzaeler_counts changed from 1872636 to 1872638

2018-10-05 12:15:21.327 [vent.ItemStateChangedEvent] - Stromzaeler_K changed from 1248.4240 to 1248.4253

2018-10-05 12:15:30.360 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.

2018-10-05 12:15:31.322 [vent.ItemStateChangedEvent] - Stromzaeler_W changed from 214 to 209

2018-10-05 12:15:31.353 [vent.ItemStateChangedEvent] - Stromzaeler_counts changed from 1872638 to 1872640

2018-10-05 12:15:31.386 [vent.ItemStateChangedEvent] - Stromzaeler_K changed from 1248.4253 to 1248.4266

2018-10-05 12:15:31.906 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.

2018-10-05 12:15:36.562 [vent.ItemStateChangedEvent] - Bewegungsmelder_Wohnzimmer_Decke_Illumination changed from 265 to 261

2018-10-05 12:15:38.976 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.

2018-10-05 12:15:38.992 [vent.ItemStateChangedEvent] - Garage_Temp changed from 16.1 to 16.0

2018-10-05 12:15:39.007 [vent.ItemStateChangedEvent] - Garage_Hum changed from 56.6 to 56.5

2018-10-05 12:15:41.313 [vent.ItemStateChangedEvent] - Stromzaeler_W changed from 209 to 185

2018-10-05 12:15:41.331 [vent.ItemStateChangedEvent] - Stromzaeler_counts changed from 1872640 to 1872641

2018-10-05 12:15:41.346 [vent.ItemStateChangedEvent] - Stromzaeler_K changed from 1248.4266 to 1248.4274

2018-10-05 12:15:44.043 [vent.ItemStateChangedEvent] - Bewegungsmelder_Flur_Illumination changed from 97 to 105

2018-10-05 12:15:44.050 [vent.ItemStateChangedEvent] - Bewegungsmelder_Flur_Motion changed from OFF to ON

==> /var/log/openhab2/openhab.log <==

2018-10-05 12:15:44.081 [INFO ] [clipse.smarthome.model.script.Tablet] - RULE Motion Küche | Flur, on!

==> /var/log/openhab2/events.log <==

2018-10-05 12:15:44.096 [vent.ItemStateChangedEvent] - Tablet_1_Display changed from OFF to ON

2018-10-05 12:15:44.967 [vent.ItemStateChangedEvent] - Bewegungsmelder_Kueche_Motion changed from OFF to ON

2018-10-05 12:15:47.746 [vent.ItemStateChangedEvent] - Bewegungsmelder_Kueche2_Illumination changed from 761 to 763

2018-10-05 12:15:47.780 [vent.ItemStateChangedEvent] - Bewegungsmelder_Kueche2_Motion changed from OFF to ON

2018-10-05 12:15:47.836 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.

2018-10-05 12:15:50.870 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.

2018-10-05 12:15:51.379 [vent.ItemStateChangedEvent] - Stromzaeler_K changed from 1248.4274 to 1248.4287

2018-10-05 12:15:55.746 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.

2018-10-05 12:16:01.325 [vent.ItemStateChangedEvent] - Stromzaeler_W changed from 185 to 189

2018-10-05 12:16:01.342 [vent.ItemStateChangedEvent] - Stromzaeler_counts changed from 1872641 to 1872645

2018-10-05 12:16:01.355 [vent.ItemStateChangedEvent] - Stromzaeler_K changed from 1248.4287 to 1248.4301

2018-10-05 12:16:07.406 [vent.ItemStateChangedEvent] - Garage_Hum changed from 56.5 to 56.4

2018-10-05 12:16:11.330 [vent.ItemStateChangedEvent] - Stromzaeler_W changed from 189 to 213

2018-10-05 12:16:11.396 [vent.ItemStateChangedEvent] - Stromzaeler_counts changed from 1872645 to 1872646

2018-10-05 12:16:11.413 [vent.ItemStateChangedEvent] - Stromzaeler_K changed from 1248.4301 to 1248.4307

2018-10-05 12:16:15.373 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.

2018-10-05 12:16:16.915 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.

2018-10-05 12:16:21.331 [vent.ItemStateChangedEvent] - Stromzaeler_W changed from 213 to 202

2018-10-05 12:16:21.346 [vent.ItemStateChangedEvent] - Stromzaeler_counts changed from 1872646 to 1872648

2018-10-05 12:16:21.356 [vent.ItemStateChangedEvent] - Stromzaeler_K changed from 1248.4307 to 1248.4320

2018-10-05 12:16:24.011 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.

2018-10-05 12:16:31.331 [vent.ItemStateChangedEvent] - Stromzaeler_W changed from 202 to 215

2018-10-05 12:16:31.346 [vent.ItemStateChangedEvent] - Stromzaeler_counts changed from 1872648 to 1872650

2018-10-05 12:16:31.369 [vent.ItemStateChangedEvent] - Stromzaeler_K changed from 1248.4320 to 1248.4333

2018-10-05 12:16:32.839 [me.event.ThingUpdatedEvent] - Thing 'milight:bridgeV6:MiLight' has been updated.```

Has anybody the same issues? 

Do anybody has a idea how I can solve this Problem? 

My Idea is may be use a HDD, save the logs on our Hetzner Webserver,... or deactivate something that we don't write so much on the MicroSD,..... but I don't know what's here the best solution. 

Thanks a lot

Jan

Hi

If it helps…

There are topics on here about people running their systems from external hard drives.

Would running your database on an external drive take the work load off of the SD card/s ?

Alternatively, I have only ever selected SBCs with eMMC memory, rather than SD cards.

I’m currently testing an ODroid C2 4 core 64 bit board, as an alternative to the ODroid XU4 32 bit 8 core (which only has 4 big cores, which I lock OpenHab2 to)

1 Like

See this.

1 Like

One thing you may want to check is your power supply. Maybe just try a new one and see if the sad card last longer.

Also check into external HDd as sited above.

1 Like

Yes, with the HDD I also thought about this, this will be the really last case,… cause then I also can add OpenHab on one of my IntelNuc’s.

The AC Adapter I changed already, now I took a very good one but still the same problem,… and I also changed the Raspberry.

I think I will try to check the post from @mstormi and may be will add the Logs and all other files with a lot of writing tasks to an external WebServer or like that.

Thanks

Jan

1 Like

Raspberry pi 3 can boot directly from a USB device.
Have you considered an SSD?

It’s the solution I use, no issues myself tho my system is smaller then yours.
The Intel nuc’s are nice units, I’m looking at moving over to that kind of thing myself as I have 3 idle (and fancy a play with high availability virtualization/clustering).

As others have said, the solution is to get an SSD and boot/run from that. Works like a charm.

Attention here.
It is NOT a reliable and comprehensive solution to go SSD or HDD.
(apart from the fact that a Linux newbie shouldn’t try).
Read my thread I linked to, please.

In order of priority, you should :

  1. Backup
  2. UPS
  3. apply write optimizations
  4. move to some other medium such as SSD or HDD

The UPS advice may apply more to some people (people to build a house or with frequent power outages) than to others, but you MUST take care of backup first !
There’s many situations where you will require this (such as if you accidentially delete things).
Check out the Amanda README linked to in there to also get a number of generic advices on resilience in general.

And once you have implemented 1-3, you usually don’t need 4 any more.