I needed to power down my pi, so I went to ssh and typed “sudo shutdown now”. I waited a minute or so. Then I took away the power.
After reboot I went to emoncms webpage and got this: “Can’t connect to local MySQL server”. So I did some analysis, and I found out that the mysqld process wouldn’t start, it says “Segmentation Fault”.
Earlier I had already something weird after a reboot, but then it was php not working anymore. It complained about incorrect php.ini. When I checked php.ini it had strange characters in a certain part of the file, so it was basically corrupted. I managed to recover this file and it worked again.
Is this SD card corruption? I’m only running it for 3 months or so in “low write mode”. Am I doing something else wrong? Would it be a good idea to re-install everything and move the filesystem to a HDD?
Extra info: it is a raspberry pi 3 with a RFM69PI board. On the pi there is also “weewx” running, which is connected to a weather station and every 5 minutes writes data to the mysql DB.
edit: it is getting even worse, I tried installing a node red module:
pi@emonpi(ro):.node-red$ npm install node-red-node-mysql
The mysqld segmentation fault after a reboot is usually caused by a lack of disc space. What size SDcard are you using? Have you expanded the filesystem? What does this return?
df -h
It’s difficult to say whether it is sdcard corruption or not, although we rarely experience sd failures since making emoncms “low-write” and the os read-only, but it is still possible to corrupt a sdcard even with those measures if a file write is interrupted, eg a power failure.
If it is a lack of disc space, trying to install more, will make it worse. Plus if mysql isn’t functional, installing a mysql connector to node-red might not be succesful.
Also I see you are trying to install the module whilst the filesystem is “ro” that could also cause an issue.
Not looking like diskspace is the problem.
I have an external HDD, so I’m going for the reinstall and move to the HDD. I have a backup of a week ago. I’ll let you know if it pops up again.