Today is a different day.
Downloaded image and flashed to virgin 16GB SDcard using etcher. Installed in emonPi, powered up and walked away for a few hours. Did initial set up on WiFi - will come back to wired Ethernet issue later. Ran Full Update, but I think it had already done so, as nothing was pulled in.
Enabled SSH from button by LCD. Put old SDcard into USB reader and plugged into emonPi. Tried Setup | Backup | Import USB - this was the output.
=== USB Emoncms import start ===
2020-04-29-12:59:27
Backup module version:
"version" : "2.2.2"
EUID: 1000
Reading /opt/emoncms/modules/backup/config.cfg....
Location of data databases: /var/opt/emoncms
Location of emonhub.conf: /etc/emonhub
Location of Emoncms: /var/www/emoncms
USB drive not found
Assumed SDcard corrupted. From SSH session ran
pi@emonpi:~ $ sudo fsck.ext4 /dev/sda2
e2fsck 1.44.5 (15-Dec-2018)
rootfs contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Inode 98182 is in use, but has dtime set. Fix<y>? yes
Inodes that were part of a corrupted orphan linked list found. Fix<y>? yes
Inode 98184 was part of the orphaned inode list. FIXED.
Inode 98182 has a bad extended attribute block 32768. Clear<y>? yes
Inode 98182, i_size is 576460752303423488, should be 0. Fix<y>? yes
Pass 2: Checking directory structure
Directory inode 42052, block #0, offset 520: directory corrupted
Salvage<y>? yes
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Unattached zero-length inode 8197. Clear<y>? yes
Inode 98182 (...) has invalid mode (01000).
Clear<y>? yes
Inode 98184 (...) has invalid mode (00).
Clear<y>? yes
Pass 5: Checking group summary information
Block bitmap differences: -(155136--155378)
Fix<y>? yes
Free inodes count wrong for group #12 (8050, counted=8048).
Fix ('a' enables 'yes' to all) <y>? yes
Free inodes count wrong (190683, counted=190681).
Fix ('a' enables 'yes' to all) <y>? yes
rootfs: ***** FILE SYSTEM WAS MODIFIED *****
rootfs: 74903/265584 files (0.1% non-contiguous), 559467/1053440 blocks
And then
pi@emonpi:~ $ sudo fsck.ext2 /dev/sda3
e2fsck 1.44.5 (15-Dec-2018)
/dev/sda3: clean, 40/665088 files, 210847/10634240 blocks
pi@emonpi:~ $
Tried Import USB again, same message. Unplugged USB card reader, plugged into different USB port and tried again - still nothing found.
No linux guru so not understanding that Import USB can’t see the card in the reader, but fsck
has seen and fixed some errors. Were the errors that fsck
fixed found on the SDcard, or some other storage on the Pi motherboard? Are /dev/sda2
and /dev/sda3
on the SDcard or somewhere else?
What is my next step to attempt to restore my feeds and data? Painful and disappointing if I can’t but not disastrous.
Now to the Wired Ethernet. Before Corruption (BC) I had tried and failed to move the emonPi onto my wired network. I used a Powerline plug pair to present 10/100Mb LAN at the utility meter. A normal laptop happily DHCP’d there to my 10.5.1.0/24 home network and connected to all network resources. The emonPi did not, it came up on the LCD as 169.254.204.239, and still does now After Corruption (AC).
This makes me think that either (a) there is be some other stored state in the emonPi - like an MMC, Flash or EEPROM chip that is corrupted, or (b) there’s a fault in my emonPi’s Ethernet port.
Can anyone comment.