Factory reset to vanilla OpenWRT



  • We use OM2+ in a few of our devices for commercial purposes. Recently, we encountered a scenario where the OM2+ got factory reset to vanilla OpenWRT. While looking through WinSCP, we found there are no files or folders at all. I have attached a screenshot of the console below.

    I have no answers to how the hostname is retained, i.e. AirSENCE-06233B5B40356. We tried flashing the Omegaware-0.3.3 b253 image, but it didn't allow us to. We have had situations where the device got restored to factory settings but this is something extraordinary that we cannot find answers for.

    b5e4dc58-2f6d-42e7-af8f-b41808bc41b8-image.png

    After running, firstboot -y && sync && reboot, we could get the default OM2+ console page.
    Any feedback/thoughts would be highly appreciated.
    Thank you.


  • administrators

    @mrahul said in Factory reset to vanilla OpenWRT:

    we encountered a scenario where the OM2+ got factory reset to vanilla OpenWRT

    Can you explain how it got factory reset? What led to the factory reset?

    @mrahul said in Factory reset to vanilla OpenWRT:

    We tried flashing the Omegaware-0.3.3 b253 image, but it didn't allow us to.

    And what do you mean by it didn't allow you to flash a different image? What happens?



  • Can you explain how it go factory reset? What led to the factory reset?

    That is exactly what I'm looking to get answers for. We just have a couple of scripts running and log some error/info messages in the SD card. Are there any diagnostics tools we can use to tell us more about the cause?

    Another thing we found is the problem is not consistent. For e.g., one of the devices deleted all the files from the /root/ folder while I was logged in, and couldn't find any log files in the SD card that is usually created by our scripts. While connected in the same session, I can't find anything in logread or dmesg

    And what do you mean by it didn't allow you to flash a different image? What happens?

    Since the device was restored to vanilla OpenWRT, we thought of trying to install the firmware image by downloading from Onion repo and installing using sysupgrade but I couldn't copy it through WinSCP. There were no folders at all. However, firstboot -y && sync && reboot brings it back to the default console page, just like a brand new device.

    Thanks



  • @mrahul I find troubleshooting things like this can be assisted by using remote logging. If the file system is corrupted you lose your logs but if you use remote logging the logging is still available.

    Add these entries to /et/config/system

    option log_port '514'
    option log_proto 'udp'
    option log_ip '192.168.1.214'  -<--- point this to your log host
    option log_remote '1'


  • @mrahul said in Factory reset to vanilla OpenWRT:

    Thanks @crispyoz We do have remote logging enabled in other devices with the same expectation but nothing so far.

    Another thing we found is the problem is not consistent. For e.g., one of the devices deleted all the files from the /root/ folder while I was logged in, and couldn't find any log files in the SD card that is usually created by our scripts. While connected in the same session, I can't find anything in logread or dmesg

    But after situations like this, I doubt if I'll get anything from logread or dmesg. At this time, I was still connected to the device and checked the logs right away through logread but I didn't see anything that would give me some hints.



  • @mrahul In the past where I had a tricky issue like this I troubleshoot it like this. Pipe top command to the logger, and run a script to log the file systems, with remote logging on, so you can postmortem the logs.

    top | logger &
    ./myscript.sh &

    The script is like this:

    #!/bin/sh
    while true; do
      df | logger
      sleep 1
    done
    
    

  • administrators

    I agree with @crispyoz's logging suggestion. This is a good way to get clues as to what file system issues are causing the device to look like it's factory restored.

    If it is something going on with the filesystems, then logread and dmesg output will probably have some helpful warnings or messages.

    This should be able to help get to the root cause of the issue



  • Thanks, @crispyoz & @Lazar-Demin. I'll try these suggestions and get back with the logs.

    In the meantime, apart from filesystem corruption, are there any other possible scenarios where the device can get reset?



  • @mrahul My guess is the issue is one of 2 causes.

    1. power issue
    2. you have something that is messing up your file system and the auto file system repair is finishing the job off


Looks like your connection to Community was lost, please wait while we try to reconnect.