[Solved] In recovery mode, firstboot, fails "jffs2reset: writing /dev/ubi0_1 failed: Operation not permitted"

tldr: firstboot reports "jffs2reset: writing /dev/ubi0_1 failed: Operation not permitted" in failsafe
on MI R3G. What should I try next?

I have a fresh mi r3g router which I've been struggling with. Including: wiring up a serial cable, buying a usb adaptor, finding a driver for Mojave, setting up a tftp server, etc. etc

I now have open wrt booting on the router, but it doesn't appear to bring up any interfaces.

Well in failsafe it claims to have brought up eth0, but I can't ping it.

So in failsafe I tried to do firstboot and that complains, as show below.

Any suggestions?

 OpenWrt SNAPSHOT, r8958-8c485fb
================= FAILSAFE MODE active ================
special commands:
* firstboot	     reset settings to factory defaults
* mount_root	 mount root-partition with config files

after mount_root:
* passwd			 change root's password
* /etc/config		    directory with config files

for more help see:
- failsafe_and_factory_reset
- root_password_reset

root@(none):/# mount
/dev/root on / type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /dev type tmpfs (rw,nosuid,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,mode=600,ptmxmode=000)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
root@(none):/# firstboot
[   32.530266] jffs2reset: This will erase all settings and remove any installed packages. Are you sure? [N/y]
[   34.958257] jffs2reset: /dev/ubi0_1 is not mounted
[   34.963187] jffs2reset: /dev/ubi0_1 will be erased on next mount
[   34.969244] jffs2reset: writing /dev/ubi0_1 failed: Operation not permitted

sysupgrade -n /tmp/<image.bin> with the same or any other OpenWrt mir3g image should have the same result as firstboot.

That sounds useful. I assume the image should be the sysupgrade.bin image for this router, i.e. openwrt-ramips-mt7621-mir3g-squashfs-sysupgrade.bin

Trouble is that the router currently is only reachable over the serial cables. And, failsafe doesn't happen to get the usb stick working. At minimum it didn't load the necessary modules, running kmodloader probably addressed that; but I sense there are more steps since /dev/sda1 and /extdisks/sda1 are missing in action.

I took a stab at using c-kermit which while very nostalgic didn't work out either. But that's not surprising since I don't know what state the router needs to be in when I tell kermit to send the file.

Third time the charm I guess. So this issue is resolved. Honestly I don't know what resolved the "jffs2reset: writing /dev/ubi0_1 failed: Operation not permitted" issue, but I fell back to the xiaomi firmware a few times.

It took me a while to realize when I needed to set the root passwd before proceeding. It took me a while to realize that I needed to sysupgrade with openwrt-ramips-mt7621-mir3g-squashfs-sysupgrade.bin to get the webapp; and actually to get anything usable.

Anyhow I now have a mir3g with openwrt. One radio is (5G) not working but it's progress.

Overall so far, quite the hazing ritual :wink:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.