Exit failsafe mode (Banana Pi R64)

Hi,

How do I restore my settings after entering failsafe mode? The system entered failsafe mode after the power was accidentally switched off at the wall. I have already tried mount_root and dmesg and /var/logs to check the log files but there were not reports about why it went into failsafe mode.

Thanks,

Aaron

Failsafe mode shouldn’t be triggered by a power cut, but you can try ‘reboot’ and see what it does.

Already tried that but didn't take my back to normal mode.

This really depends on the specific device model...

E.g. The Linksys e8450/ Belkin rt3200 has triggers entering (a semi-external) recovery system if your system crashed (which may be a result of a power cut), meaning there are crash splats in pstore (which need to be either manually deleted XOR removed by powering off the router completely (stored in a reserved RAM area) and then powering it up again). Other devices might have different approaches.

I am running OpenWrt on a Banana Pi R64.

what is the output of

ubus call system board

System

{
	"kernel": "5.10.161",
	"hostname": "OpenWrt",
	"system": "ARMv8 Processor rev 4",
	"model": "Bananapi BPI-R64",
	"board_name": "bananapi,bpi-r64",
	"rootfs_type": "initramfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "22.03.3",
		"revision": "r20028-43d71ad93e",
		"target": "mediatek/mt7622",
		"description": "OpenWrt 22.03.3 r20028-43d71ad93e"
	}
}

I am able to remount the rootfs

mount /dev/mmcblk1p66 /overlay/

However, it does not survive reboot, could I make a backup of /dev/mmcblk1p66 to restore it after I flash the device?

You've got initramfs running... that's your problem.

Use this to flash a full/normal version of OpenWrt (such as the 'sysupgrade' image)
https://firmware-selector.openwrt.org/?version=22.03.3&target=mediatek%2Fmt7622&id=bananapi_bpi-r64

What is "initramfs", sys upgrade? if so I installed that after the problem was already here. I uploaded the image via Luci but it did not work.

See this.
In partiuclar:

The initramfs-kernel image is used for development or special situations as a one-time boot as a stepping stone toward installing the regular sysupgrade version. Since the initramfs version runs entirely from RAM, it does not store any settings in flash, so it is not suitable for operational use.

The other image format types are described there, too, including the sysupgrade image type.

Can you describe your exact steps or show screenshots of what you did?

Also, are you running from an SD card? If so, did you follow the directions here? (specficially, it tells you to download and install the sdcard image).

Oh, I flashed the openwrt-22.03.3-mediatek-mt7622-bananapi_bpi-r64-sdcard.img.gz download using BalenaEtcher is that a problem?

That sounds like the right thing to do.

Try removing the sd card. Does the thing still boot?

No! Although, reinstalling the operating system solved the problem.


{
	"kernel": "5.10.161",
	"hostname": "OpenWrt",
	"system": "ARMv8 Processor rev 4",
	"model": "Bananapi BPI-R64",
	"board_name": "bananapi,bpi-r64",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "22.03.3",
		"revision": "r20028-43d71ad93e",
		"target": "mediatek/mt7622",
		"description": "OpenWrt 22.03.3 r20028-43d71ad93e"
	}
}

I just wish there was another way because I had to wipe all my data.

I just wish there was another way because I had to wipe all my data.

just fyi, yes and no.

guessing here since i do not own a bpi (nice little kits btw) so i am unsure if failsafe brings up the ethernet adapters (probably does...)... but, since you had ssh access you could have backed up your /etc/* at a minimum.

untested but you could have also done a mount_root followed by opkg list-installed and generated a package list to get a list of packages to install post sysupgrade.

Is it possible to detect the filesystem type via bash script?

fstype=`ubus call system board | grep rootfs | awk -F '"' '{print $4}'`
echo $fstype

Cool! Thanks.