Page 1 of 1
Raspberry Pi2 B+ - After SD Card Corruption
Posted: Sunday 08 November 2015 1:19
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??)
Re: Raspberry Pi2 B+ - After SD Card Corruption
Posted: Sunday 08 November 2015 6:31
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.
Re: Raspberry Pi2 B+ - After SD Card Corruption
Posted: Sunday 08 November 2015 9:20
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)?
Re: Raspberry Pi2 B+ - After SD Card Corruption
Posted: Sunday 08 November 2015 9:57
by sylvainsjc
Re: Raspberry Pi2 B+ - After SD Card Corruption
Posted: Sunday 08 November 2015 10:24
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.
Re: Raspberry Pi2 B+ - After SD Card Corruption
Posted: Sunday 08 November 2015 11:37
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
Re: Raspberry Pi2 B+ - After SD Card Corruption
Posted: Sunday 08 November 2015 12:01
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
Re: Raspberry Pi2 B+ - After SD Card Corruption
Posted: Sunday 08 November 2015 12:06
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

Re: Raspberry Pi2 B+ - After SD Card Corruption
Posted: Sunday 08 November 2015 12:14
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!
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
Re: Raspberry Pi2 B+ - After SD Card Corruption
Posted: Sunday 08 November 2015 12:17
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.
Raspberry Pi2 B+ - After SD Card Corruption
Posted: Monday 09 November 2015 19:21
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
Re: Raspberry Pi2 B+ - After SD Card Corruption
Posted: Sunday 17 April 2016 12:20
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
Re: Raspberry Pi2 B+ - After SD Card Corruption
Posted: Sunday 17 April 2016 23:11
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
Re: Raspberry Pi2 B+ - After SD Card Corruption
Posted: Wednesday 01 June 2016 11:22
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 !
Re: Raspberry Pi2 B+ - After SD Card Corruption
Posted: Friday 03 June 2016 8:48
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
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
Re: Raspberry Pi2 B+ - After SD Card Corruption
Posted: Friday 03 June 2016 13:39
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

Raspberry Pi2 B+ - After SD Card Corruption
Posted: Saturday 04 June 2016 14:26
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>
Re: Raspberry Pi2 B+ - After SD Card Corruption
Posted: Wednesday 15 June 2016 13:57
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 !