1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Asus rt86u "Format jffs at next boot"

Discussion in 'Asuswrt-Merlin' started by podkaracz, Jan 25, 2020.

  1. podkaracz

    podkaracz Regular Contributor

    Joined:
    Jul 3, 2019
    Messages:
    147
    I would like to ask for a command that will help me achieve what merlin's "Format jffs at next boot" does but in official firmware. I used to use usb drive with custom scripts back in the day when i tested custom firmwares out and now im on stock. I set my router up with official 45717 and i dont want to play with setting up and clearing everything once again in case some1 advises me to flash merlin and use that option. Is there an option for example ssh command that will achieve the same results as "Format jffs at next boot" but in official firmware?
     
  2. L&LD

    L&LD Part of the Furniture

    Joined:
    Dec 9, 2013
    Messages:
    10,957
    Flash the RMerlin firmware on the router, check the 'Format JFFS partition on next boot' option, make sure to hit save at the bottom of the page. Reboot the router 3 times in the next 15 minutes, waiting 5 to 10 minutes between reboots.

    Now, flash the stock firmware version you want and do a full reset to factory defaults and you should be good to go! :D

    (Sorry, can't sleep and have had too much cold medicine). :)
     
    a5m, podkaracz and Treadler like this.
  3. podkaracz

    podkaracz Regular Contributor

    Joined:
    Jul 3, 2019
    Messages:
    147
    I did that in night before ur response cuz no1 answered but is there any command like that for future use might be useful . Setting up my router with ur guide took me 2 hours with only 2 flashes once merlin and once stock to "wait out" all those settings i can tell its visible in performance but it should not be like this. Too much knowledge and time needed to make it work decently.
     
  4. L&LD

    L&LD Part of the Furniture

    Joined:
    Dec 9, 2013
    Messages:
    10,957
    @podkaracz, it shouldn't take two hours to do that 'dance'. :)

    The important point in time is when you've flashed the firmware you want to use and then do the M&M Config fully. ;)

    This should have been possible in less than half an hour. But of course, I get to practice this much more than anyone here. :)
     
    SheikhSheikha and a5m like this.
  5. podkaracz

    podkaracz Regular Contributor

    Joined:
    Jul 3, 2019
    Messages:
    147

    You should update point 2 by adding info that on some models u need to reboot manually after wps reset . Also waiting after clear jffs and next boot and i replaced 2 mins wait with router off and router on with 5 mins thats why it took so long
     
    L&LD likes this.
  6. podkaracz

    podkaracz Regular Contributor

    Joined:
    Jul 3, 2019
    Messages:
    147
    Those hidden features in USB Application are disgusting no1 disables that also should i disable something in NAT WINDOW ? I saw OzarkEdge recommend to disable SIP there something more?
     
  7. podkaracz

    podkaracz Regular Contributor

    Joined:
    Jul 3, 2019
    Messages:
    147
    Also you should add info that at the end of configuration hard reboot is needed ( unplug power cord from router ) wait 2 mins then run again as last point in guide. With gui reboot it feels more delayed.
     
  8. podkaracz

    podkaracz Regular Contributor

    Joined:
    Jul 3, 2019
    Messages:
    147
    Why are people not giving information here about clearing jffs2 from ssh like @RMerlin did in 2017 for older models :

    "mtd-erase -d jffs2
    reboot
    umount /jffs"

    Those commands wont work for 86u . I need commands that will work . If you give options to people using asus-wrt merlin like "format jffs at next boot" i want to do it myself on stock asus-wrt over ssh for example . If you dont want to share that knowledege to public just write it on private message. I dont get why i cant this information yet and its essential to wipe router and restore its factory-like state.

    #edit

    From what i understand to restore "factory like" state after using merlin firmware and trying to use scirpts and wanting state like from out of the box i need to initialize or wps reset and remove jffs2 at next boot but cant get those commands. Also doing it hard way like using winscp to get into router then get completly out to the first possible directory and CTRL+A and then DEL key will probably get state that even recovery tool wont restore and will have to send it back to asus for repair thats why i need commands.
     
    Last edited: Feb 8, 2020
  9. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    10,640
    Location:
    UK
    People are not "giving information" because they don't know the answer to your question.

    This subforum is for Merlin's firmware not stock asuswrt. If those commands don't work for the 86U then we don't know of any other commands.
     
  10. podkaracz

    podkaracz Regular Contributor

    Joined:
    Jul 3, 2019
    Messages:
    147
    Yes this command is on asus merlin thats why i write here also if you dont know commands which stand behind it, why is there "format jffs partition at next boot" there? Its just for people who are bored and want to tick something that wont change anything? Lets be serious tell me exactly what commands can be seen on cmd prompt when format jffs partition at next boot is initiated so i can reproduce them over ssh.
     
  11. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    10,640
    Location:
    UK
    Yes let's be serious. There are no commands seen on cmd prompt when "format jffs partition at next boot" is initiated. It has to be done by the router during the boot process before the jffs partition is mounted. You can see the code here:

    https://github.com/RMerl/asuswrt-me...b16b3991f2/release/src/router/rc/jffs2.c#L249

    and here:

    https://github.com/RMerl/asuswrt-me...b16b3991f2/release/src/router/rc/jffs2.c#L303
     
    dave14305 and podkaracz like this.
  12. podkaracz

    podkaracz Regular Contributor

    Joined:
    Jul 3, 2019
    Messages:
    147
    "cmd prompt" message was just an example of what i imagine it to be .My knowledge is very limited. Is there a single/series of commands that can be run on rt86u that will achieve the same results as "format jffs at next boot" ?( for example over ssh) I can see the script that is checking variables and does action lets say "jffs2 erase" in case of something what does it actually do and which part applies to 86u since from what i understand the mtd~ part is for older models. Its like it checks for location of said jffs2 parition and in case of different models it applies different pattern to remove . Correct me if im wrong because i dont know any of this.
     
  13. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    10,640
    Location:
    UK
    What output do you get from this command?

    cat /proc/mtd
     
  14. podkaracz

    podkaracz Regular Contributor

    Joined:
    Jul 3, 2019
    Messages:
    147
    /$ cat /proc/mtd
    dev: size erasesize name
    mtd0: 05aa0000 00020000 "rootfs"
    mtd1: 05ac0000 00020000 "rootfs_update"
    mtd2: 00800000 00020000 "data"
    mtd3: 00100000 00020000 "nvram"
    mtd4: 05f00000 00020000 "image"
    mtd5: 05f00000 00020000 "image_update"
    mtd6: 00460000 00020000 "bootfs"
    mtd7: 00440000 00020000 "bootfs_update"
    mtd8: 03000000 00020000 "misc2"
    mtd9: 00800000 00020000 "misc1"
    mtd10: 0557e000 0001f000 "rootfs_ubifs"
     
  15. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    10,640
    Location:
    UK
    OK that's completely different from the earlier model routers which had a "brcmnand" (jffs) partition. So it looks like the mtd-erase2 command is not compatible with your router.

    The best you can probably achieve from the command line is to use the rm command.
    Code:
    sync
    rm -rf /jffs/*
    sync
    Then turn off the router using the power button.

    EDIT: Looking at this section of code it looks like the equivalent to brcmnand on HND is misc2. But there is still no support for that partition in the mtd-erase2 command.
     
    Last edited: Feb 8, 2020
    podkaracz likes this.
  16. podkaracz

    podkaracz Regular Contributor

    Joined:
    Jul 3, 2019
    Messages:
    147
    You see i told you mtd2 is not working cuz its different architecture . I think @RMerlin might know some more but not sure if he wants to share this knowledge.
     
  17. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    10,640
    Location:
    UK
    Nobody said it was working. The format option in the GUI doesn't use the mtd-erase2 command it calls an internal C function that formats the device directly.
     
    podkaracz likes this.
  18. podkaracz

    podkaracz Regular Contributor

    Joined:
    Jul 3, 2019
    Messages:
    147
    So again is there command to do this with help of ssh?
     
  19. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    10,640
    Location:
    UK
    So again the answer is...
     
    podkaracz likes this.
  20. podkaracz

    podkaracz Regular Contributor

    Joined:
    Jul 3, 2019
    Messages:
    147
    Ok thanks for help and interest you helped me understand it a bit. Maybe @RMerlin clarify it more since he wrote this code/scripts.