Raspberry Pi2 B+ - After SD Card Corruption

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
trollmar
Posts: 16
Joined: Friday 24 April 2015 9:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Raspberry Pi2 B+ - After SD Card Corruption

Post by trollmar »

My Domoticz server run 9Month. Im totally amazed with this software!
But this morning my sdcard get corrupted.
After google and reading ..i found out that this sd card corruption in a "normal" behavior for a Raspberry ;-)

Is there a good hardware alternative out there?

- LowPower consumption
- Domoticz only device
- Aeon Z-wave USB Stick compatible for my ZWave Setup-
- NO FileSystem Problems like Raspberry (Sata SSD the solution??)
antwan
Posts: 116
Joined: Saturday 13 July 2013 13:28
Target OS: Linux
Domoticz version: Latest
Location: Hilversum, The Netherlands
Contact:

Re: Raspberry Pi2 B+ - After SD Card Corruption

Post by antwan »

Banana pi/Orange pi plus and cubietruck all have sata connections available to connect an ssd. A bit more expensive, but à lot more save.
Rasp Pi 2B: 3x DS18S20 (1-wire), BME280 (i2c)
Cubietruck 1: Aeotec Z-Wave+, RFXtrx433XL+P1, RFXtrx868, TE923 display, SolarEdge API
Cubietruck 2: Aeotec Z-Wave, Voltcraft CO-20
jannl
Posts: 625
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: Raspberry Pi2 B+ - After SD Card Corruption

Post by jannl »

Sd card corruption is not normal for a pi. Since I fixed the causes and never unplug the pi before a proper shutdown I do not have had a single corruption. Over a year now.

Check for instance the free space. Is this being filled by some logfile(s)?
sylvainsjc
Posts: 8
Joined: Sunday 01 March 2015 10:25
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: France
Contact:

Re: Raspberry Pi2 B+ - After SD Card Corruption

Post by sylvainsjc »

Raspberry + Raspian + Domoticz Beta + Rfxcom433e + heater control with Chacon 54755 + sensors TS34C + OWL160 + Z-Wave Everspring/Fibaro
Complete Backup script using "dd" to remote hard disk
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Raspberry Pi2 B+ - After SD Card Corruption

Post by sincze »

antwan wrote:Banana pi/Orange pi plus and cubietruck all have sata connections available to connect an ssd. A bit more expensive, but à lot more save.
I pretty much tried everything I could find on the web to prevent this on my old Raspberry B 512 MB.
Boot partition on SD (Mounted read-only)
System partition and so Domoticz on the HD works fine

To continue with the experiment I bought a cubietruck and SSD.
Also very nice solution that has been running ever since.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
hansrune
Posts: 49
Joined: Monday 07 October 2013 10:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Raspberry Pi2 B+ - After SD Card Corruption

Post by hansrune »

I have landed on using my Pis with overlayfs (ram file system with sd card bottom layer ) for the writable file systems ( /home /var etc..). Everything else normally read only, then remount root and /boot read/write and back to read only as needed for maintenance. That gives me the ability to maintain the OS and Domoticz by normal means and commands.

I send / email myself Domoticz backups over Internet as a cron job and syncs the overlay file system back to the bottom layer SD card when restarting, but do that as little as possible.

I also tried using pure ram and unionfs filesystem, but maintenance , syncing data, restoring became very "nonstandard".

If you are interested, I can post a howto here or on the wiki ...



Sent from my iPad using Tapatalk
trollmar
Posts: 16
Joined: Friday 24 April 2015 9:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Raspberry Pi2 B+ - After SD Card Corruption

Post by trollmar »

..thx alot for your thougts.
jannl wrote:Sd card corruption is not normal for a pi. Since I fixed the causes and never unplug the pi before a proper shutdown I do not have had a single corruption. Over a year now.

Check for instance the free space. Is this being filled by some logfile(s)?
The SD Card corruption only happens when there is a problem in the shutdown process. I Know!!
But what should you do when nothings happens ..cut the cable ;-)
hansrune wrote:I have landed on using my Pis with overlayfs (ram file system with sd card bottom layer ) for the writable file systems ( /home /var etc..). Everything else normally read only, then remount root and /boot read/write and back to read only as needed for maintenance. That gives me the ability to maintain the OS and Domoticz by normal means and commands.

I send / email myself Domoticz backups over Internet as a cron job and syncs the overlay file system back to the bottom layer SD card when restarting, but do that as little as possible.

I also tried using pure ram and unionfs filesystem, but maintenance , syncing data, restoring became very "nonstandard".

If you are interested, I can post a howto here or on the wiki ...
I Guess we all interested. Sound interesting.
The best would be posting in the wiki.
Would be great when your share your systems tweaks.
antwan wrote:Banana pi/Orange pi plus and cubietruck all have sata connections available to connect an ssd. A bit more expensive, but à lot more save.
I haven't decide yet what way I go.

1. Buy a Cubietruck (Cubieboard 3)
What SSD should I buy? Is it true that Cubieboard need the MicroSD card to start the system?

2. Buy a ODROID-XU4
There a are preinstalled Ubuntu eMMC out there. I guess no need anymore for a SDCard

3. Stay with Raspberry and try to prevent writings to SDCard with RAM Disk USB Thumb drive etc.

When a buy a new Hardware ..which way would you go?
Cubietruck or Odroid-Xu4?

Greetings
Trollmar
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Raspberry Pi2 B+ - After SD Card Corruption

Post by sincze »

hansrune wrote:I have landed on using my Pis with overlayfs (ram file system with sd card bottom layer ) for the writable file systems ( /home /var etc..). Everything else normally read only, then remount root and /boot read/write and back to read only as needed for maintenance. That gives me the ability to maintain the OS and Domoticz by normal means and commands.

I send / email myself Domoticz backups over Internet as a cron job and syncs the overlay file system back to the bottom layer SD card when restarting, but do that as little as possible.

I also tried using pure ram and unionfs filesystem, but maintenance , syncing data, restoring became very "nonstandard".

If you are interested, I can post a howto here or on the wiki ...



Sent from my iPad using Tapatalk
Never to old to learn new tricks please do :D
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
User avatar
sincze
Posts: 1299
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Raspberry Pi2 B+ - After SD Card Corruption

Post by sincze »

trollmar wrote:
1. Buy a Cubietruck (Cubieboard 3)
What SSD should I buy? Is it true that Cubieboard need the MicroSD card to start the system?
Trollmar
I just had a 60gb SSD spare around attatched to my Cubie 3.
It does the job. Pick one not to big not to expensive. (Samsung always fine)

In essential you are correct MicroSD is necessary to 'start' the system and say hey boot from SSD! :D

It is also possible to modify the Cubie and boot without SD from the internal memory.

http://www.armbian.com/cubietruck/
https://www.youtube.com/watch?v=Kt9h6v8Si5g
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
antwan
Posts: 116
Joined: Saturday 13 July 2013 13:28
Target OS: Linux
Domoticz version: Latest
Location: Hilversum, The Netherlands
Contact:

Re: Raspberry Pi2 B+ - After SD Card Corruption

Post by antwan »

1) I'm happy with the CT.
It had an lion accu support om the mb. Use à know make ssd (i use Samsung).

The CT does not need à sd card to boot, just to settup.
Rasp Pi 2B: 3x DS18S20 (1-wire), BME280 (i2c)
Cubietruck 1: Aeotec Z-Wave+, RFXtrx433XL+P1, RFXtrx868, TE923 display, SolarEdge API
Cubietruck 2: Aeotec Z-Wave, Voltcraft CO-20
hansrune
Posts: 49
Joined: Monday 07 October 2013 10:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Raspberry Pi2 B+ - After SD Card Corruption

Post by hansrune »

Setting up overlayfs is now described on http://www.domoticz.com/wiki/Setting_up ... spberry_Pi
Sorry for the delay ... had to retest on a new Domoticz SD card image, just to be safe
mjm987
Posts: 1
Joined: Sunday 17 April 2016 12:05
Target OS: Linux
Domoticz version:
Contact:

Re: Raspberry Pi2 B+ - After SD Card Corruption

Post by mjm987 »

Hi hansrune
unfortunately your server http://hansrune.net is inaccessible.
Could you please copy&paste the 'saveoverlays' script to the wiki page (https://www.domoticz.com/wiki/Setting_u ... spberry_Pi) as you did for the mount_overlay script?

Many thx
hansrune
Posts: 49
Joined: Monday 07 October 2013 10:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Raspberry Pi2 B+ - After SD Card Corruption

Post by hansrune »

The server has been replaced, but my virtual web server was not maintained

The links are now updated. If you still have problems, please PM me
RLezer
Posts: 7
Joined: Wednesday 01 June 2016 11:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Raspberry Pi2 B+ - After SD Card Corruption

Post by RLezer »

Unfortunately , with the new Domoticz raspberry pi image.
based on Jessie.

sudo update-rc.d saveoverlays start 10 S . stop 05 0 6 .

update-rc.d is no longer supported.

i found this article :
https://wiki.debian.org/LSBInitScripts/ ... yBasedBoot

but have not been able to succesfully implement it.

could someone please be so kind to update the wiki ? would be great not to lose any more SD cards on this. :) thanks !
hansrune
Posts: 49
Joined: Monday 07 October 2013 10:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Raspberry Pi2 B+ - After SD Card Corruption

Post by hansrune »

I have updated the wiki page and saveoverlays init script. If you download the saveoverlays script or change it per the below, you should be able to do

Code: Select all

sudo insserv saveoverlays
I just did a one-off test on a new Domoticz SD card image, and that worked for me

Changes in saveoverlays:

Code: Select all

### BEGIN INIT INFO
# Provides:          saveoverlays
# Required-Start:    $local_fs $time
# Required-Stop:     $local_fs $syslog $time
# Default-Start:     S
# Default-Stop:      0 6
# Short-Description: Save logs and files from overlay mounts
# Description:       Save logs and files from overlay mounts
### END INIT INFO
After insserv, things should look similar to this:

Code: Select all

$ find /etc/init* /etc/rc* | grep saveover
/etc/init.d/saveoverlays
/etc/rc0.d/K02saveoverlays
/etc/rc6.d/K02saveoverlays
/etc/rcS.d/S10saveoverlays
RLezer
Posts: 7
Joined: Wednesday 01 June 2016 11:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Raspberry Pi2 B+ - After SD Card Corruption

Post by RLezer »

great !

i'll give it a try this weekend ( i hope )

can you also explain in a simple way what i need to do to make other folder locations use the overlays ?

i'm thinking about combining the domoticz with some other functions , but they do r/w on the card.
and that's something to be verry carefull with i know allready :P
hansrune
Posts: 49
Joined: Monday 07 October 2013 10:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Raspberry Pi2 B+ - After SD Card Corruption

Post by hansrune »

For other overlays (not system related), repeat the steps for /home

Also, instead of using insserv directly, it is likely better to do

<code>sudo systemctl enable saveoverlays.service</code>
RLezer
Posts: 7
Joined: Wednesday 01 June 2016 11:19
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Raspberry Pi2 B+ - After SD Card Corruption

Post by RLezer »

works like a charm !

only the maintenance scipt gets me in a Chroot mode ?
from where i can't run : sudo apt-get upgrade

also is there a way where i can edit a config file and sync it to the SD card manually ?
or put a file somewhere in a folder, and reboot the pi so its synced to the SD card , and used after reboot ?

thanks for all the effort so far !
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest