SD Card corrupt? Can't boot OH3 after power loss

Hello OH friends,

I’m running OH3.1 on a rPi3 since several weeks without issue. This morning I had a power loss and after booting up, I get many many failures :

  • Failed to start Network Time Synchronization
  • Failed to start Entropy daemon using the HAVEGE algorithm
  • Failed to start Update UTMP about system boot shutdown
  • Failed to start dphys-swapfile - set up, mount/umount and delete a swap file
  • Failed to start Mosquitto MQTT v3.1 Broker

Then, at the login screen, here is what I see when I enter my credentials :

Linux openHABianDevice 5.10.17-v7+ #1421 SMP Thu May 27 13:59:01 BST 2021 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Sep  7 08:59:17 2021 from 192.168.2.17

mktemp: failed to create file via template '/tmp/tmp.XXXXXXXXXX': Read-only file                                                                                                         system
/usr/local/bin/FireMotD: line 205: : No such file or directory
/usr/local/bin/FireMotD: line 206: : No such file or directory
rm: missing operand
Try 'rm --help' for more information.
mktemp: failed to create file via template '/tmp/tmp.XXXXXXXXXX': Read-only file                                                                                                         system
/usr/local/bin/FireMotD: line 341: : No such file or directory
/usr/local/bin/FireMotD: line 342: : No such file or directory
/usr/local/bin/FireMotD: line 343: : No such file or directory
/usr/local/bin/FireMotD: line 344: : No such file or directory
/usr/local/bin/FireMotD: line 347: : No such file or directory
rm: missing operand
Try 'rm --help' for more information.
mktemp: failed to create file via template '/tmp/tmp.XXXXXXXXXX': Read-only file                                                                                                         system
/usr/local/bin/FireMotD: line 375: : No such file or directory
/usr/local/bin/FireMotD: line 376: : No such file or directory
/usr/local/bin/FireMotD: line 377: : No such file or directory
/usr/local/bin/FireMotD: line 378: : No such file or directory
/usr/local/bin/FireMotD: line 379: : No such file or directory
rm: missing operand
Try 'rm --help' for more information.
mktemp: failed to create file via template '/tmp/tmp.XXXXXXXXXX': Read-only file                                                                                                         system
/usr/local/bin/FireMotD: line 387: : No such file or directory
/usr/local/bin/FireMotD: line 388: : No such file or directory
rm: missing operand
Try 'rm --help' for more information.
/usr/local/bin/FireMotD: line 395: cannot create temp file for here-document: Re                                                                                                        ad-only file system
/usr/local/bin/FireMotD: line 407: cannot create temp file for here-document: Re                                                                                                        ad-only file system
/usr/local/bin/FireMotD: line 408: cannot create temp file for here-document: Re                                                                                                        ad-only file system
mktemp: failed to create file via template '/tmp/tmp.XXXXXXXXXX': Read-only file                                                                                                         system
/usr/local/bin/FireMotD: line 413: : No such file or directory
/usr/local/bin/FireMotD: line 414: : No such file or directory
/usr/local/bin/FireMotD: line 415: : No such file or directory
/usr/local/bin/FireMotD: line 416: : No such file or directory
/usr/local/bin/FireMotD: line 417: : No such file or directory
/usr/local/bin/FireMotD: line 418: : No such file or directory
rm: missing operand
Try 'rm --help' for more information.
/usr/local/bin/FireMotD: line 425: cannot create temp file for here-document: Re                                                                                                        ad-only file system
/usr/local/bin/FireMotD: line 427: cannot create temp file for here-document: Re                                                                                                        ad-only file system
/usr/local/bin/FireMotD: line 429: cannot create temp file for here-document: Re                                                                                                        ad-only file system
mktemp: failed to create file via template '/tmp/tmp.XXXXXXXXXX': Read-only file                                                                                                         system
/usr/local/bin/FireMotD: line 434: : No such file or directory
/usr/local/bin/FireMotD: line 435: : No such file or directory
/usr/local/bin/FireMotD: line 436: : No such file or directory
/usr/local/bin/FireMotD: line 437: : No such file or directory
/usr/local/bin/FireMotD: line 438: : No such file or directory
/usr/local/bin/FireMotD: line 439: : No such file or directory
rm: missing operand
Try 'rm --help' for more information.
/usr/local/bin/FireMotD: line 446: cannot create temp file for here-document: Re                                                                                                        ad-only file system
/usr/local/bin/FireMotD: line 448: cannot create temp file for here-document: Re                                                                                                        ad-only file system
/usr/local/bin/FireMotD: line 450: cannot create temp file for here-document: Re                                                                                                        ad-only file system
mktemp: failed to create file via template '/tmp/tmp.XXXXXXXXXX': Read-only file                                                                                                         system
/usr/local/bin/FireMotD: line 454: : No such file or directory
/usr/local/bin/FireMotD: line 455: : No such file or directory
/usr/local/bin/FireMotD: line 456: : No such file or directory
/usr/local/bin/FireMotD: line 457: : No such file or directory
/usr/local/bin/FireMotD: line 458: : No such file or directory
/usr/local/bin/FireMotD: line 459: : No such file or directory
rm: missing operand
Try 'rm --help' for more information.
mktemp: failed to create file via template '/tmp/tmp.XXXXXXXXXX': Read-only file                                                                                                         system
/usr/local/bin/FireMotD: line 498: : No such file or directory
/usr/local/bin/FireMotD: line 499: : No such file or directory
rm: missing operand
Try 'rm --help' for more information.
mktemp: failed to create file via template '/tmp/tmp.XXXXXXXXXX': Read-only file                                                                                                         system
/usr/local/bin/FireMotD: line 518: : No such file or directory
/usr/local/bin/FireMotD: line 519: : No such file or directory
/usr/local/bin/FireMotD: line 520: : No such file or directory
rm: missing operand
Try 'rm --help' for more information.
###############################################################################
###############  openHABianDevice  ############################################
###############################################################################
##        Ip = 169.254.220.15
##   Release = Raspbian GNU/Linux 10 (buster)
##    Kernel = Linux 5.10.17-v7+
##  Platform = Raspberry Pi 3 Model B Rev 1.2
##    Uptime = ${UptimeDays} day(s). ${UptimeHours}:${UptimeMinutes}:${UptimeSec                                                                                                        onds}
## CPU Usage = ${CpuUsageAverage}% avg over ${CpuUsageCpuCount} cpu(s) (${CpuUsa                                                                                                        geCoreCount} core(s) x ${CpuUsageSocketCount} socket(s))
##  CPU Load = ${CpuLoad}
##    Memory = Free: ${MemFreeGB}GB (${MemFreePerc}%), Used: ${MemUsedGB}GB (${M                                                                                                        emUsedPerc}%), Total: ${MemTotalGB}GB
##      Swap = Free: ${SwapFreeGB}GB (${SwapFreePerc}%), Used: ${SwapUsedGB}GB (                                                                                                        ${SwapUsedPerc}%), Total: ${SwapTotalGB}GB
##      Root = Free: ${DiskRootFreeGB}GB (${DiskRootFreePerc}%), Used: ${DiskRoo                                                                                                        tUsedGB}GB (${DiskRootUsedPerc}%), Total: ${DiskRootTotalGB}GB
##   Updates = 38 apt updates available.
##  Sessions = ${SessionCount} session(s)
## Processes = ${ProcessCount} running processes of ${ProcessMax} maximum proces                                                                                                        ses
###############################################################################

                          _   _     _     ____   _
  ___   ___   ___   ___  | | | |   / \   | __ ) (_)  ____   ___
 / _ \ / _ \ / _ \ / _ \ | |_| |  / _ \  |  _ \ | | / _  \ / _ \
| (_) | (_) |  __/| | | ||  _  | / ___ \ | |_) )| || (_) || | | |
 \___/|  __/ \___/|_| |_||_| |_|/_/   \_\|____/ |_| \__|_||_| | |
      |_|                          3.1.0 - Release Build

Looking for a place to get started? Check out 'sudo openhabian-config' and the
documentation at https://www.openhab.org/docs/installation/openhabian.html
The openHAB dashboard can be reached at http://openHABianDevice:8080
To interact with openHAB on the command line, execute: 'openhab-cli --help'

openhabian@openHABianDevice:~ $

Then if I try to update OH3, I still get the read-only failures :

openhabian@openHABianDevice:~ $ sudo apt-get update
[sudo] password for openhabian:
Ign:1 http://davesteele.github.io/comitup/repo comitup InRelease
Err:2 http://davesteele.github.io/comitup/repo comitup Release
  Could not open file /var/lib/apt/lists/partial/davesteele.github.io_comitup_repo_dists_comitup_Release - open (30: Read-only file system) [IP: 185.199.110.153 80]
Hit:3 https://deb.nodesource.com/node_14.x buster InRelease
Err:3 https://deb.nodesource.com/node_14.x buster InRelease
  Couldn't create temporary file /tmp/apt.conf.QlPDeP for passing config to apt-key
Ign:4 http://archive.raspberrypi.org/debian buster InRelease
Hit:5 https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable InRelease
Err:5 https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable InRelease
  Couldn't create temporary file /tmp/apt.conf.hbT1iX for passing config to apt-key
Ign:6 http://raspbian.raspberrypi.org/raspbian buster InRelease
Err:7 http://archive.raspberrypi.org/debian buster Release
  Could not open file /var/lib/apt/lists/partial/archive.raspberrypi.org_debian_dists_buster_Release - open (30: Read-only file system) [IP: 46.235.227.39 80]
Err:8 http://raspbian.raspberrypi.org/raspbian buster Release
  Could not open file /var/lib/apt/lists/partial/raspbian.raspberrypi.org_raspbian_dists_buster_Release - open (30: Read-only file system) [IP: 93.93.128.193 80]
Reading package lists... Done
N: Ignoring file 'openhab.liste' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
W: chown to _apt:root of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (30: Read-only file system)
W: chown to _apt:root of directory /var/lib/apt/lists/auxfiles failed - SetupAPTPartialDirectory (30: Read-only file system)
W: chmod 0700 of directory /var/lib/apt/lists/auxfiles failed - SetupAPTPartialDirectory (30: Read-only file system)
W: Not using locking for read only lock file /var/lib/apt/lists/lock
W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.Zu5uSz - IsAccessibleBySandboxUser (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.0o7DyS - IsAccessibleBySandboxUser (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.PCaJfb - IsAccessibleBySandboxUser (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.eJaTWt - IsAccessibleBySandboxUser (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/.apt-acquire-privs-test.9zwQDM - IsAccessibleBySandboxUser (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/davesteele.github.io_comitup_repo_dists_comitup_InRelease - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/davesteele.github.io_comitup_repo_dists_comitup_Release - PrepareFiles (30: Read-only file system)
E: The repository 'http://davesteele.github.io/comitup/repo comitup Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Problem unlinking the file /var/lib/apt/lists/partial/deb.nodesource.com_node%5f14.x_dists_buster_InRelease - PrepareFiles (30: Read-only file system)
W: chown to _apt:root of file /var/lib/apt/lists/deb.nodesource.com_node%5f14.x_dists_buster_InRelease failed - Item::QueueURI (30: Read-only file system)
W: chmod 0600 of file /var/lib/apt/lists/deb.nodesource.com_node%5f14.x_dists_buster_InRelease failed - Item::QueueURI (30: Read-only file system)
W: chown to root:root of file /var/lib/apt/lists/deb.nodesource.com_node%5f14.x_dists_buster_InRelease failed - 400::URIFailure (30: Read-only file system)
W: chmod 0644 of file /var/lib/apt/lists/deb.nodesource.com_node%5f14.x_dists_buster_InRelease failed - 400::URIFailure (30: Read-only file system)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://deb.nodesource.com/node_14.x buster InRelease: Couldn't create temporary file /tmp/apt.conf.QlPDeP for passing config to apt-key
W: Problem unlinking the file /var/lib/apt/lists/partial/archive.raspberrypi.org_debian_dists_buster_InRelease - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/openhab.jfrog.io_artifactory_openhab-linuxpkg_dists_stable_InRelease - PrepareFiles (30: Read-only file system)
W: chown to _apt:root of file /var/lib/apt/lists/openhab.jfrog.io_artifactory_openhab-linuxpkg_dists_stable_InRelease failed - Item::QueueURI (30: Read-only file system)
W: chmod 0600 of file /var/lib/apt/lists/openhab.jfrog.io_artifactory_openhab-linuxpkg_dists_stable_InRelease failed - Item::QueueURI (30: Read-only file system)
W: chown to root:root of file /var/lib/apt/lists/openhab.jfrog.io_artifactory_openhab-linuxpkg_dists_stable_InRelease failed - 400::URIFailure (30: Read-only file system)
W: chmod 0644 of file /var/lib/apt/lists/openhab.jfrog.io_artifactory_openhab-linuxpkg_dists_stable_InRelease failed - 400::URIFailure (30: Read-only file system)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://openhab.jfrog.io/artifactory/openhab-linuxpkg stable InRelease: Couldn't create temporary file /tmp/apt.conf.hbT1iX for passing config to apt-key
W: Problem unlinking the file /var/lib/apt/lists/partial/raspbian.raspberrypi.org_raspbian_dists_buster_InRelease - PrepareFiles (30: Read-only file system)
W: Problem unlinking the file /var/lib/apt/lists/partial/archive.raspberrypi.org_debian_dists_buster_Release - PrepareFiles (30: Read-only file system)
E: The repository 'http://archive.raspberrypi.org/debian buster Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Problem unlinking the file /var/lib/apt/lists/partial/raspbian.raspberrypi.org_raspbian_dists_buster_Release - PrepareFiles (30: Read-only file system)
E: The repository 'http://raspbian.raspberrypi.org/raspbian buster Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (30: Read-only file system)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (30: Read-only file system)
openhabian@openHABianDevice:~ $

Please help me, I have over hundreds and hundreds of hours through OH1-2-3 over the past years. I have a SD backup of last July but I really wish to repair my setup instead.

What logs or what info do you need so you can help me?

Thanks in advance!

That’s not possible and just a waste of time for both, you and anyone to help you.
Export your config, install openHABian to a fresh SD and import your config.
And make sure to setup Amanda (backup) this time so you have up to date backup next time.

What will I lose from my previous SD backup? Are all my Things/Rules/Items gonna be saved? Thank you.

Depends what you mean by “SD backup”. Things,items,rules are part of the export so will be kept.
Anything you installed on the box beyond OH will be lost.

Ok well noted. I’ll flash a new SD then… Thanks for your help!