Logging stops and files are read only

Platform information:

  • RPi 3B compute module with openhabian and openHAB 3.2.0
  • 1 Gb RAM
  • 16 Gb SD card class 10

After some hours running the logging stops and the log (:9001) show only the log names

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

When I check the logs they are read only.

Outputs from free -m:

[09:32:22] openhabian@<hostname>:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:            972         567          53           1         351         387
Swap:          2647          17        2630

and also from FireMotD:

## CPU Usage = 32.65% avg over 4 cpu(s) (4 core(s) x 1 socket(s))
##  CPU Load = 1m: 5.29, 5m: 1.72, 15m: 0.61
##    Memory = Free: 0.04GB (4%), Used: 0.90GB (96%), Total: 0.94GB
##      Swap = Free: 2.58GB (100%), Used: 0.00GB (0%), Total: 2.58GB
##      Root = Free: 6.54GB (48%), Used: 6.82GB (52%), Total: 13.97GB

I have read that it is not recommended to use Zram with SBCs with less than 1 Gb. As the memory log show 972 Mbyte it is slightly less and I wonder if this is significant.

Here is one of the last lines from syslog

Jan 10 06:50:12 <hostname>rsyslogd[820]: file '/var/log/syslog'[7] write error - see https://www.rsyslog.com/solving-rsyslog-write-errors/ for help OS error: Read-only file system [v8.2102.0 try https://www.rsyslog.com/e/2027 ]

Except for the logging, the system seems to work.

What may I do to get logging working as it should? Any help is appreciated

Best regards


I am not sure it applies to your situation as you use zram, but readonly files on an SD card often mean that the SD card is broken.

On a failed SD card all the files remain available for reading. You can backup them, but you cannot write anything to the card.

It seems that the SD card is in order.
I have tried to reduce log sizes and to increase the /var/log portion of zram to 750 from 600 Mb. But probably not enough to have it stable over a longer period.