Openhabian boot problem on RPi2 Model B V1.1

Hi guys

My RPi2 with openhabian doens’t boot anymore. (I already ordered a RPi 4 but I hate to lose everything (things, rules, persisence,…), I would like to install the RPi 4 at my pace, not hurry-hurry because “it doesn’t work anymore”)
Anyway, I get this error:

—[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,2)

After a Google search I tried to change cmdline.txt on a Windows machine (I ignored the Windows prompts to format the SD), I changed “root=PARTUUID=c6bc21bc-02” to 06, then booted the RPi again.
So then the RPi hangs on

random: crng init done

Another Google search tells me this:

At boot, the kernel waits for mouse movements to initialize the random number generator.

So I plug in a mouse, a new USB device number 5 gets installed (using USB HID v1.10 Mouse (SIGMACHIP Usb Mouse)), but then it disconnects (I didn’t pull it out), then a new USB device number 6 gets installed, then disconnects again, then number 7, and so on, and so on.
So I was thinking maybe it’s the mouse.
I pull out the mouse, plug in another one (USB HID v1.11 Mouse (PixArt USB Optical Mouse) but then the screen hangs again.

So I pull the power, plug it back in (with the second mouse plugged in an USB port), last thing I see is the mouse being installed, then I get the “random: crng init done”. I try to move the mouse, click buttons, scroll the wheel, nothing happens.

I’m gonna pull the power again, plug in the first mouse, and just leave it like that for a couple of hours, maybe at some point it’ll get past the install/disconnect the mouse.

If there’s any news, I’ll post an update.

Any ideas?

Greetings
Bernd

*Edit: It seems that the mouse only gets disconnected when I move it, USB device number 61 atm…

Hello :slight_smile:

I don’t use Raspberry Pi, so this is a ‘best guess’

If you power up your pi without a USB keyboard or mouse (and Velbus USB), can you make a SSH connection from your Windows computer?

Either from the Windows command prompt
ssh {username}@{RPi_IP}

Or by using PuTTY ?

Once you’ve got a Terminal session (TTY) this command will create a useful zip backup of all things openHAB2, which is easy to restore onto your replacement machine.

sudo openhab-cli backup

If you can, you will be able to zip up the important folders and FTP them to a different machine for safe keeping.

WinSCP might be able to connect to your RPi via SFTP and give you a Drag and Drop file manager experience in Windows if that’s easier.

1 Like

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?