Stuck in "Read-only file system"

  • Platform information:
    • Hardware: CPUArchitecture/RAM/storage
    • OS:Currently running the latest updates on all apps and services.

I am trying to configure anything really and I keep getting an error in my log viewer “Unable to write (blank) “Read-only file system””

I don’t remember ever doing anything to change write or access permissions. When I go in to the configuration tool via puTTY and try to change permissions, my screen is filled with “failed to write *** Read-only file system”

Please help!

First copy off any important data and then try a reboot. The Linux filesystem has some corruption. During the reboot it should automatically run a filesystem check and attempt to correct any errors. Data loss is possible though.

I’ve done both a soft reboot and a hard reset. Still can’t do anything.

2019-10-18 21:56:28.455 [ERROR] [me.storage.json.internal.JsonStorage] - Error writing JsonDB to /var/lib/openhab2/jsondb/thing_status_storage.json. Cause /var/lib/openhab2/jsondb/thing_status_storage.json (Read-only file system).

2019-10-18 21:56:28.457 [ERROR] [me.storage.json.internal.JsonStorage] - Error writing JsonDB to /var/lib/openhab2/jsondb/backup/1571450188457–thing_status_storage.json. Cause /var/lib/openhab2/jsondb/backup/1571450188457–thing_status_storage.json (Read-only file system).

2019-10-18 21:56:28.460 [ERROR] [me.storage.json.internal.JsonStorage] - Error writing JsonDB to /var/lib/openhab2/jsondb/thing_status_storage.json. Cause /var/lib/openhab2/jsondb/thing_status_storage.json (Read-only file system).

2019-10-18 21:56:28.462 [ERROR] [me.storage.json.internal.JsonStorage] - Error writing JsonDB to /var/lib/openhab2/jsondb/backup/1571450188461–thing_status_storage.json. Cause /var/lib/openhab2/jsondb/backup/1571450188461–thing_status_storage.json (Read-only file system).

2019-10-18 21:56:28.464 [ERROR] [me.storage.json.internal.JsonStorage] - Error writing JsonDB to /var/lib/openhab2/jsondb/thing_status_storage.json. Cause /var/lib/openhab2/jsondb/thing_status_storage.json (Read-only file system).

2019-10-18 21:56:28.466 [ERROR] [me.storage.json.internal.JsonStorage] - Error writing JsonDB to /var/lib/openhab2/jsondb/backup/1571450188465–thing_status_storage.json. Cause /var/lib/openhab2/jsondb/backup/1571450188465–thing_status_storage.json (Read-only file system).

File systems don’t just spontaneously go read only so something changed. If you are using a full sized SD card, check to see if it has a little toggle on the side and if so check whether it’s set to read only or not.

Check your /etc/fstab file for any corruption or unexpected changes. This could be a sign that the SD card is failing.

In all likelihood, you will need to rebuild this system on a different SD card.

1 Like

I’m aware something has changed but I am here because I don’t know what that something is. I will check the tab on the card.
The SD card is relatively new.
If I have to rebuild then so be it but i was hoping for an alternative.

proc /proc proc defaults 0 0
PARTUUID=bd3c0142-01 /boot vfat defaults 0 2
PARTUUID=bd3c0142-02 / ext4 defaults,noatime 0 1

a swapfile is not a swap partition, no line here

use dphys-swapfile swap[on|off] for that

/usr/share/openhab2 /srv/openhab2-sys none bind 0 0
/etc/openhab2 /srv/openhab2-conf none bind 0 0
/var/lib/openhab2 /srv/openhab2-userdata none bind 0 0
/var/log/openhab2 /srv/openhab2-logs none bind 0 0
/usr/share/openhab2/addons /srv/openhab2-addons none bind 0 0

Please use code fences! And always take a look at the preview, you could have seen that it’s totally different to your posting.

There are some reasons why a GNU/Linux System changes to read only, most common reason is a damaged file system.

1 Like

So just rebuild then?

Most of us here arr not Linux experts and this is really a problem that has nothing to do with openHAB. You might have better luck along on a Raspbian forum. “Rebuild” is probably going to be the best advice you will find here.

If the SD card is bad it may need replacing.

I know It’s been a long time… But this https://linuxx.info/how-to-fix-read-only-file-system-linux/ guide helped solving my problem with “read-only” filesystem