Openhabian boot problem on RPi2 Model B V1.1

I´ll second that!

For windows users, winscp is a great peace of free software to help with transfering files to/from a Rpi/or other devices (Odroid). I´ve used it every day for years, even for editing openhab config files realtime, as it has a build-in editor. Alternative is to use Samba… But that will require some more configuration to do.
So stick with winscp. It simply makes life alot easier. All you need to know is:

  1. IP of your Rpi
  2. username/password. (default: openhabian/openhabian).

A small tip - Putty can be linked and started directly within Winscp. Then you´ll have a neat and free SSH client as well.

Thats the most important tools to use when dealing with a SMB/Rpi running openhab, and remote handling from windows.

1 Like

You story is a bit hard to follow… I wouldn’t bother continue trying to recover your box but suggest to simply install from scratch (to a different(!) SD card of course).

No worries, you can still mount the old card from the new/reinstalled box and copy your config off there. If you used openhab-cli backup as recommended by the docs you just have to retrieve that backup archive file. If not, you can still go collect (or copy right away) the various files yourself.
You need a USB card reader to attach to the Pi, but that’s all.

1 Like

VSCode can edit files in place on the RPi through SSH too. Then you get all the syntax checking that comes with using the openHAB extension.

1 Like

Yup, I have seen others mention that. Never got it to work myself, (not sure why though). It would be great to edit files with correct syntacts.

@mstormi I’m currently installing openhabian on a new SD card on the RPi 2. I suppose it’d be faster if i use the RPi 4 to do the install, but I’m afraid if I install on the RPi 4, that maybe it won’t work on the RPi 2…
@MDAR I have used PuTTY many times with OpenHABian before, I’ll try PuTTY with the bad SD once the install on the new SD is finished.
@ rlkoshak I too used VSCode through SSH, very handy!

I did make a backup a few months ago. But I’ll try to make a new one, and if that doesn’t work, I’ll use the USB-stick, I have (or had…) one, just have to find it :blush:

Thanks for the help guys.
I’ll post an update with news soon.

1 Like

Neither PuTTY nor WinSCP can connect to the bad SD, I suppose that’s because it doesn’t fully boot…
Now I’ll try to restore the (few months old) backup.
I can try to restore a newer backup or copy the files manually later.
Just want to see it running again :smile:

IIRC, it goes both ways actually. You can’t run a Raspbian installed on an RPi 2 on the RPi 4 either.

In a pinch, you can spin up a VM with Ubuntu or your Linux of choice to access the SD card if doing so on the RPi is too much of a challenge. Or Paragon Soft makes an ext file system driver for Windows that has a 30 day free trial that will let you read the “please format” partition on your Windows machine.

2 Likes

Atm everything is running like it did back in March (when I made the backup).
I’ll try the usb-stick-sd-reader thingy to copy my recent files tomorrow.
I will somehow add a weekly auto backup I think :thinking:

@MDAR @Kim_Andersen Big Thanks :+1: :fist_right: :raised_hands:

1 Like

@mstormi @rlkoshak Big Thanks :+1: :fist_right: :clap:

(system allows new users to mention only 2 users :wink: )

Are you aware that openHABian includes a backup solution? openhabian-config, option 51

I was not, thank you

I have installed Oracle VM Virtual Box on my Windows machine with Ubuntu, and I have a USB card reader. I tried to access the files but I don’t know how.
I plugged the USB card reader in the RPi, but again, no success.
I haven’t made a recent backup, so I guess I’ll have to pick the files myself, but I don’t know which ones…

Hi

Can you access these folders on the Pi SD card from Ubuntu?

/etc/openhab2
/var/lib/openhab2
/usr/share/openhab2

As you’ve got openHAB2 up and running, I’d suggest that you only need to look at the Items, Things, Rules, Persistence etc folders and files within /etc/openhab2

Unless you did a lot of the work within PaperUI, in which case you’ll need to grab the JSON filles from /var/lib/openhab2/jsondb

I can’t access the SD card at all…

fdisk -l to find out the device, sda or sdb usually, then mount /dev/sdX /mnt

So this is what I get before plugging in:

[13:18:22] openhabian@openhab:~$ sudo fdisk -l
[sudo] password for openhabian:
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram4: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram5: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram6: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram7: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram8: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram9: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram10: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram11: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram12: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram13: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram14: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/mmcblk0: 14.6 GiB, 15640559616 bytes, 30547968 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8f43d0e9

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 532480 524289 256M c W95 FAT32 (LBA)
/dev/mmcblk0p2 540672 30547967 30007296 14.3G 83 Linux

And this after I plug it in:

[13:18:28] openhabian@openhab:~$ sudo fdisk -l
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram4: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram5: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram6: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram7: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram8: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram9: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram10: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram11: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram12: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram13: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram14: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/mmcblk0: 14.6 GiB, 15640559616 bytes, 30547968 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8f43d0e9

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 532480 524289 256M c W95 FAT32 (LBA)
/dev/mmcblk0p2 540672 30547967 30007296 14.3G 83 Linux

So pretty much the same, but the RPi’s been hanging for 1h30 now…

I opened another PuTTY session, tried to mount, gives me this:

[14:52:57] openhabian@openhab:~$ sudo mount /dev/sda /mnt
[sudo] password for openhabian:

again, hanging…

FTR, use code fences.

Your card writer device does not show up (no /dev/sdX).
Looks like something is seriously screwn up.
You could try either of Rich’s suggestion to access the card from your PC.

Rich inspired me to Google around, I found an amazing free software Ext2Read.
This allowed me to access the SD on my Windows machine, I saved the folders mentioned by Stuart:

But now my question is, do I just stop the Openhab service, overwrite the mentioned folders with the backupped ones? What can I do exactly to get my Openhab back up and running like it was right before the crash?

As your initial problems at least might mean your SD is corrupted, I would not do this.
Start with a clean install (openHABian), access the running instance from your PC and only copy over those files you really have changed.
Preferrably don’t blindly copy but cross-check, then copy’n paste.

1 Like

@mstormi I’m just gonna leave it like it is, and (some day) start over with an all new Velbus-openHAB-RPi4.

Many thanks for the help and advice!