Page 1 of 1
Disk I/O errors in log - failing SD card on Pi?
Posted: Saturday 08 November 2014 11:41
by Tom
After running for a few days on my Pi I start getting Disk I/O errors in my Log file and my domoticz web interface starts playing up.
If I restart it via the console and force an fsck it comes back up.
Is this just a sign of a failing SD card or something else?
Re: Disk I/O errors in log - failing SD card on Pi?
Posted: Saturday 08 November 2014 16:15
by gizmocuz
What log is showing this ?
Got another sd card that you can try ? Did you expand the file system ? Are you using the sd-card image of domoticz ? ...
Re: Disk I/O errors in log - failing SD card on Pi?
Posted: Sunday 05 April 2015 19:22
by Tom
I completely forgot I posted this question
Since November I am now on the 6th SD card in my Pi. I've tried different makes, classes and sizes and a different Pi, and have expanded and non-expanded file systems. I have been using the SD card version of Domoticz.
Disk errors eventually show up in the syslog and sometimes in the domoticz log (I dont always notice it before my domoticz dies). Sometimes my domoticz will stay up (but with only live data as it cannot write anything), but as soon as I try and make any changes to the settings it will usually crash. It takes anywhere between 2 days and 6 weeks for it to happen.
Sometimes I can wipe the SD cards and re write an image onto them. Sometimes I cannot and they appear to be broken forever.
This seems to be a fairly common issue with the Pi - but I am surprised that nobody else using domoticz seems to notice it!. I am wondering if I should try and run my Pi using a SSD instead (which I gather I can do using a USB-Sata converter).
Does anybody have any other ideas?
Re: Disk I/O errors in log - failing SD card on Pi?
Posted: Sunday 05 April 2015 19:38
by pepijn
I experienced the same issues in my Pi and replaced it with a Banana Pi thats able to run from SATA HDD or SSD
Re: Disk I/O errors in log - failing SD card on Pi?
Posted: Sunday 05 April 2015 20:30
by Peter112
I had a unstable Power adaptor after 1,5 years of use. The 5 Volt was fluctuating with the load on the Pi. Cheap chine shit.
Now i have a Siemens Logo 5 Volt 5 Amp power supply.
From the Chinese the capacitors in the switching part 2 pieses 4,7uF /400 Volt only having 1,2 uF, and smelling burned.
Re: Disk I/O errors in log - failing SD card on Pi?
Posted: Monday 06 April 2015 10:36
by Tom
pepijn wrote:I experienced the same issues in my Pi and replaced it with a Banana Pi thats able to run from SATA HDD or SSD
Can I use the Domoticz SD image on a Banana Pi? (obviously after duplicating it onto a HDD and changing the config files to relocate the root partition)
Re: Disk I/O errors in log - failing SD card on Pi?
Posted: Monday 06 April 2015 10:43
by pepijn
I didn't try this. Just installed the Banana Pi Raspbian image and Cubieboard Domoticz binaries. But this at that time, the RPI2 (ARM7) was not available
Re: Disk I/O errors in log - failing SD card on Pi?
Posted: Monday 06 April 2015 11:13
by Tom
pepijn wrote:I didn't try this. Just installed the Banana Pi Raspbian image and Cubieboard Domoticz binaries. But this at that time, the RPI2 (ARM7) was not available
Cheers. I have found some other forum topics about it that make it sounds pretty easy! I will probably buy myself a banana Pi.
http://www.domoticz.com/forum/viewtopic ... ana#p34974
If I re-use my existing raspberry as a slave domoticz I assume that I can leave it with a RO SD card so it might last a bit longer
Re: Disk I/O errors in log - failing SD card on Pi?
Posted: Monday 06 April 2015 18:54
by joshmosh
Hi,
perhaps you can save some money. I am running my three Raspis now for a tad over two years, 24hrs/day, 365d/yr. Only one failure of SD card so far.
How can you achieve that ? Reduce write cycles on your SD card. All unix variants are notorious for their logging. You can minimise thatby using a ramlog (google for it). Having installed ramlog, all logging goes to RAM and is only written to SD when you reboot. In addition you can reduce the amont of write access by domoticz (domoticz reads srnsors every 30 and writes the readings to a sqlite database) if you create soft links for domoticz.db, domotcz.db-shm and domotucz.db-wal to an USB-stick mounted on your Raspi. USB sticks are much less vulnerable from write access.
Roughly every week or so I make a backup of the SD cards and switch them (I have two for each Raspi). No problems with corrupted SD cards so far ...
Josh
Re: Disk I/O errors in log - failing SD card on Pi?
Posted: Friday 06 May 2016 9:10
by epierre
reviving this post, this could be added to the domoticz image I think :
A simple solution is to use Ramlog which creates a temporary disk in memory where the logfiles are stored and updated. At boot the log files are loaded in memory. At shutdown they are saved to SD Card. During runtime writes are done in memory and not to disk!
How to install:
sudo apt-get install rsync
sudo apt-get install lsof
wget
http://www.tremende.com/ramlog/download ... .0_all.deb
sudo dpkg -i ramlog_2.0.0_all.deb
Now you need to modify some config files:
sudo nano /etc/init.d/ramlog
Add the next two lines in the init part of the config (the part that starts with: #BEGIN INIT INFO). Include the # character!!
# X-Start-Before: rsyslog
# X-Stop-After: rsyslog
Now edit /etc/init.d/rsyslog
sudo nano /etc/init.d/rsyslog
add ‘ramlog’ to the following two existing lines
# Required-Start: $remote_fs $time ramlog
# Required-Stop: umountnfs $time ramlog
sudo insserv
sudo reboot
Reboot twice!!
After the second reboot check the ramlog log file for errors:
sudo cat /var/log/ramlog
You’ll probably see messages saying that you need to stop other daemons before being able to load/start ramlog. For example Samba or Cups. In that case find the appropriate file in /etc/init.d
For example Samba:
sudo nano /etc/init.d/samba
Add ‘ramlog’ to the following two existing lines
# Required-Start: $network $local_fs $remote_fs ramlog
# Required-Stop: $network $local_fs $remote_fs ramlog
For Cups:
sudo nano /etc/init.d/cups
add ‘ramlog’ to the following two existing lines:
# Required-Start: $syslog $remote_fs ramlog
# Required-Stop: $syslog $remote_fs ramlog
Those lines makes sure ramlog is started before the other daemon (like cups or samba) is started.
After changing those config files, do a sudo insserv again and reboot.
Re: Disk I/O errors in log - failing SD card on Pi?
Posted: Friday 06 May 2016 12:57
by hansrune
Another approach is described on
https://www.domoticz.com/wiki/Setting_u ... spberry_Pi. I use that to contain the Domoticz database and home directories plus /var , which includes the logs
Sent from my iPad using Tapatalk
Re: Disk I/O errors in log - failing SD card on Pi?
Posted: Friday 06 May 2016 14:17
by epierre
looks better than the ramlog that does not worn anymore with somez recent rsyslogd evolution...
thanks !
Re: Disk I/O errors in log - failing SD card on Pi?
Posted: Tuesday 15 December 2020 10:00
by SpeedyEddy
A simple solution is to use Ramlog which creates a temporary disk in memory where the logfiles are stored and updated. At boot the log files are loaded in memory. At shutdown they are saved to SD Card. During runtime writes are done in memory and not to disk!
wget
http://www.tremende.com/ramlog/download ... .0_all.deb
url does'nt respond anymore
so replace with
wget
https://raw.github.com/swirepe/personal ... .0_all.deb