mounting JFFS at boot time

Discussion in 'Asuswrt-Merlin' started by bheiser1, Dec 3, 2012.

  1. bheiser1

    bheiser1 Occasional Visitor

    Joined:
    Nov 21, 2012
    Messages:
    39
    I feel like I'm over-using the forum for questions but I need to ask this one as I need to use JFFS to set up a boot script. I'm seeing the issue described here:

    https://github.com/RMerl/asuswrt-merlin/issues/104

    I have been thru the Administration->System->Enable JFFS, Administration->System->Format at next boot, and to be safe I did an "Apply" and a reboot after each step... still JFFS shows as "unmounted" on the Tools->Sysinfo page.

    Have I missed a step?

    I'm on 3.0.0.4.260.21 on the RT-AC66U.

    Thanks in advance...:confused:
     
  2. Log in / Register to remove this ad

  3. RMerlin

    RMerlin Part of the Furniture

    Joined:
    Apr 14, 2012
    Messages:
    13,376
    Location:
    Canada
    Try rebooting one or two more times to ensure that it does get formatted and mounted (sometimes the two aren't done on the same boot).

    If it still fails, then you probably have the same issue as other users noted here on the forums. The NAND used by the RT-AC66U has a built-in bad block management. For some reason the router often decides that it just encountered a bad block while trying to format it, which will cause the format to abort. Some people were finally able to get it to format properly by trying 2-3 times.

    You can try to format it manually over telnet with the following command:

    At this point I'm not sure if the root of the issue is:

    - Unreliable NAND used by Asus in the RT-AC66U
    - Buggy NAND driver in the kernel
    - Uninitialized bad block list
    - The mtd handling tool isn't properly handling bad blocks

    Again, this only happens with the RT-AC66U, which uses a different type of flash memory than the RT-N66U.
     
  4. bheiser1

    bheiser1 Occasional Visitor

    Joined:
    Nov 21, 2012
    Messages:
    39
    Here's what I get when I try the manual format:

    admin@(none):/tmp/home/root# mtd-erase -d jffs

    Error erasing MTD
    admin@(none):/tmp/home/root#

    If it's bad NAND I guess I should ask Asus to replace the unit. But it sounds like it could be something else ... so no JFFS for me? :)

    I need this so I can create & store a script to perform the "nvram set" command, to enable Country Code setting at each boot, to enable connections from the Mac OS X 10.7 client.

    I'll explore whether I can store the script on a USB drive instead in the meantime.
     
  5. RMerlin

    RMerlin Part of the Furniture

    Joined:
    Apr 14, 2012
    Messages:
    13,376
    Location:
    Canada
    The mtd partition name is jffs2, not jffs - you must have read the message while I was fixing my typo :)
     
  6. bheiser1

    bheiser1 Occasional Visitor

    Joined:
    Nov 21, 2012
    Messages:
    39
    hah! :)

    Here's the new attempt:

    admin@(none):/tmp/mnt/PATRIOT# mtd-erase -d jffs2
    Erasing 0x0 - 0x1ffff
    Erasing 0x20000 - 0x3ffff
    Erasing 0x40000 - 0x5ffff
    Erasing 0x60000 - 0x7ffff
    Erasing 0x80000 - 0x9ffff
    Erasing 0xa0000 - 0xbffff
    Erasing 0xc0000 - 0xdffff
    Erasing 0xe0000 - 0xfffff
    Erasing 0x100000 - 0x11ffff
    Erasing 0x120000 - 0x13ffff
    Erasing 0x140000 - 0x15ffff
    Erasing 0x160000 - 0x17ffff
    Erasing 0x180000 - 0x19ffff
    Erasing 0x1a0000 - 0x1bffff
    Erasing 0x1c0000 - 0x1dffff
    Erasing 0x1e0000 - 0x1fffff
    Erasing 0x200000 - 0x21ffff
    Erasing 0x220000 - 0x23ffff
    Erasing 0x240000 - 0x25ffff
    Erasing 0x260000 - 0x27ffff
    Erasing 0x280000 - 0x29ffff
    Erasing 0x2a0000 - 0x2bffff
    Erasing 0x2c0000 - 0x2dffff
    Erasing 0x2e0000 - 0x2fffff
    Erasing 0x300000 - 0x31ffff
    Erasing 0x320000 - 0x33ffff
    Erasing 0x340000 - 0x35ffff
    Erasing 0x360000 - 0x37ffff
    Erasing 0x380000 - 0x39ffff
    Erasing 0x3a0000 - 0x3bffff
    Erasing 0x3c0000 - 0x3dffff
    Erasing 0x3e0000 - 0x3fffff
    Erasing 0x400000 - 0x41ffff
    Erasing 0x420000 - 0x43ffff
    Erasing 0x440000 - 0x45ffff
    Erasing 0x460000 - 0x47ffff
    Erasing 0x480000 - 0x49ffff
    Erasing 0x4a0000 - 0x4bffff
    Erasing 0x4c0000 - 0x4dffff
    Erasing 0x4e0000 - 0x4fffff
    Erasing 0x500000 - 0x51ffff
    Erasing 0x520000 - 0x53ffff
    Erasing 0x540000 - 0x55ffff
    Erasing 0x560000 - 0x57ffff
    Erasing 0x580000 - 0x59ffff
    Erasing 0x5a0000 - 0x5bffff
    Erasing 0x5c0000 - 0x5dffff
    Erasing 0x5e0000 - 0x5fffff
    Erasing 0x600000 - 0x61ffff
    Erasing 0x620000 - 0x63ffff
    Erasing 0x640000 - 0x65ffff
    Erasing 0x660000 - 0x67ffff
    Erasing 0x680000 - 0x69ffff
    Erasing 0x6a0000 - 0x6bffff
    Erasing 0x6c0000 - 0x6dffff
    Erasing 0x6e0000 - 0x6fffff
    Erasing 0x700000 - 0x71ffff
    Erasing 0x720000 - 0x73ffff
    Erasing 0x740000 - 0x75ffff
    Erasing 0x760000 - 0x77ffff
    Erasing 0x780000 - 0x79ffff
    Erasing 0x7a0000 - 0x7bffff
    Erasing 0x7c0000 - 0x7dffff
    Erasing 0x7e0000 - 0x7fffff
    Erasing 0x800000 - 0x81ffff
    Erasing 0x820000 - 0x83ffff
    Erasing 0x840000 - 0x85ffff
    Erasing 0x860000 - 0x87ffff
    Erasing 0x880000 - 0x89ffff
    Erasing 0x8a0000 - 0x8bffff
    Erasing 0x8c0000 - 0x8dffff
    Erasing 0x8e0000 - 0x8fffff
    Erasing 0x900000 - 0x91ffff
    Erasing 0x920000 - 0x93ffff
    Erasing 0x940000 - 0x95ffff
    Erasing 0x960000 - 0x97ffff
    Erasing 0x980000 - 0x99ffff
    Erasing 0x9a0000 - 0x9bffff
    Erasing 0x9c0000 - 0x9dffff
    Erasing 0x9e0000 - 0x9fffff
    Erasing 0xa00000 - 0xa1ffff
    Erasing 0xa20000 - 0xa3ffff
    Erasing 0xa40000 - 0xa5ffff
    Erasing 0xa60000 - 0xa7ffff
    Erasing 0xa80000 - 0xa9ffff
    Erasing 0xaa0000 - 0xabffff
    Erasing 0xac0000 - 0xadffff
    Erasing 0xae0000 - 0xafffff
    Erasing 0xb00000 - 0xb1ffff
    Erasing 0xb20000 - 0xb3ffff
    Erasing 0xb40000 - 0xb5ffff
    Erasing 0xb60000 - 0xb7ffff
    Erasing 0xb80000 - 0xb9ffff
    Erasing 0xba0000 - 0xbbffff
    Erasing 0xbc0000 - 0xbdffff
    Erasing 0xbe0000 - 0xbfffff
    Erasing 0xc00000 - 0xc1ffff
    Erasing 0xc20000 - 0xc3ffff
    Erasing 0xc40000 - 0xc5ffff
    Erasing 0xc60000 - 0xc7ffff
    Erasing 0xc80000 - 0xc9ffff
    Erasing 0xca0000 - 0xcbffff
    Erasing 0xcc0000 - 0xcdffff
    Erasing 0xce0000 - 0xcfffff
    Erasing 0xd00000 - 0xd1ffff
    Erasing 0xd20000 - 0xd3ffff
    Erasing 0xd40000 - 0xd5ffff
    Erasing 0xd60000 - 0xd7ffff
    Erasing 0xd80000 - 0xd9ffff
    Erasing 0xda0000 - 0xdbffff
    Erasing 0xdc0000 - 0xddffff
    Erasing 0xde0000 - 0xdfffff
    Erasing 0xe00000 - 0xe1ffff
    Erasing 0xe20000 - 0xe3ffff
    Erasing 0xe40000 - 0xe5ffff
    Erasing 0xe60000 - 0xe7ffff
    Erasing 0xe80000 - 0xe9ffff
    Erasing 0xea0000 - 0xebffff
    Erasing 0xec0000 - 0xedffff
    Erasing 0xee0000 - 0xefffff
    Erasing 0xf00000 - 0xf1ffff
    Erasing 0xf20000 - 0xf3ffff
    Erasing 0xf40000 - 0xf5ffff
    Erasing 0xf60000 - 0xf7ffff
    Erasing 0xf80000 - 0xf9ffff
    Erasing 0xfa0000 - 0xfbffff
    Erasing 0xfc0000 - 0xfdffff
    Erasing 0xfe0000 - 0xffffff
    Erasing 0x1000000 - 0x101ffff
    Erasing 0x1020000 - 0x103ffff
    Erasing 0x1040000 - 0x105ffff
    Erasing 0x1060000 - 0x107ffff
    Erasing 0x1080000 - 0x109ffff
    Erasing 0x10a0000 - 0x10bffff
    Erasing 0x10c0000 - 0x10dffff
    Erasing 0x10e0000 - 0x10fffff
    Erasing 0x1100000 - 0x111ffff
    Erasing 0x1120000 - 0x113ffff
    Erasing 0x1140000 - 0x115ffff
    Erasing 0x1160000 - 0x117ffff
    Erasing 0x1180000 - 0x119ffff
    Erasing 0x11a0000 - 0x11bffff
    Erasing 0x11c0000 - 0x11dffff
    Erasing 0x11e0000 - 0x11fffff
    Erasing 0x1200000 - 0x121ffff
    Erasing 0x1220000 - 0x123ffff
    Erasing 0x1240000 - 0x125ffff
    Erasing 0x1260000 - 0x127ffff
    Erasing 0x1280000 - 0x129ffff
    Erasing 0x12a0000 - 0x12bffff
    Erasing 0x12c0000 - 0x12dffff
    Erasing 0x12e0000 - 0x12fffff
    Erasing 0x1300000 - 0x131ffff
    Erasing 0x1320000 - 0x133ffff
    Erasing 0x1340000 - 0x135ffff
    Erasing 0x1360000 - 0x137ffff
    Erasing 0x1380000 - 0x139ffff
    Erasing 0x13a0000 - 0x13bffff
    Erasing 0x13c0000 - 0x13dffff
    Erasing 0x13e0000 - 0x13fffff
    Erasing 0x1400000 - 0x141ffff
    Erasing 0x1420000 - 0x143ffff
    Erasing 0x1440000 - 0x145ffff
    Erasing 0x1460000 - 0x147ffff
    Erasing 0x1480000 - 0x149ffff
    Erasing 0x14a0000 - 0x14bffff
    Erasing 0x14c0000 - 0x14dffff
    Erasing 0x14e0000 - 0x14fffff
    Erasing 0x1500000 - 0x151ffff
    Erasing 0x1520000 - 0x153ffff
    Erasing 0x1540000 - 0x155ffff
    Erasing 0x1560000 - 0x157ffff
    Erasing 0x1580000 - 0x159ffff
    Erasing 0x15a0000 - 0x15bffff
    Erasing 0x15c0000 - 0x15dffff
    Erasing 0x15e0000 - 0x15fffff
    Erasing 0x1600000 - 0x161ffff
    Erasing 0x1620000 - 0x163ffff
    Erasing 0x1640000 - 0x165ffff
    Erasing 0x1660000 - 0x167ffff
    Erasing 0x1680000 - 0x169ffff
    Erasing 0x16a0000 - 0x16bffff
    Erasing 0x16c0000 - 0x16dffff
    Erasing 0x16e0000 - 0x16fffff
    Erasing 0x1700000 - 0x171ffff
    Erasing 0x1720000 - 0x173ffff
    Erasing 0x1740000 - 0x175ffff
    Erasing 0x1760000 - 0x177ffff
    Erasing 0x1780000 - 0x179ffff
    Erasing 0x17a0000 - 0x17bffff
    Erasing 0x17c0000 - 0x17dffff
    Erasing 0x17e0000 - 0x17fffff
    Erasing 0x1800000 - 0x181ffff
    Erasing 0x1820000 - 0x183ffff
    Erasing 0x1840000 - 0x185ffff
    Erasing 0x1860000 - 0x187ffff
    Erasing 0x1880000 - 0x189ffff
    Erasing 0x18a0000 - 0x18bffff
    Erasing 0x18c0000 - 0x18dffff
    Erasing 0x18e0000 - 0x18fffff
    Erasing 0x1900000 - 0x191ffff
    Erasing 0x1920000 - 0x193ffff
    Erasing 0x1940000 - 0x195ffff
    Erasing 0x1960000 - 0x197ffff
    Erasing 0x1980000 - 0x199ffff
    Erasing 0x19a0000 - 0x19bffff
    Erasing 0x19c0000 - 0x19dffff
    Erasing 0x19e0000 - 0x19fffff
    Erasing 0x1a00000 - 0x1a1ffff
    Erasing 0x1a20000 - 0x1a3ffff
    Erasing 0x1a40000 - 0x1a5ffff
    Erasing 0x1a60000 - 0x1a7ffff
    Erasing 0x1a80000 - 0x1a9ffff
    Erasing 0x1aa0000 - 0x1abffff
    Erasing 0x1ac0000 - 0x1adffff
    Erasing 0x1ae0000 - 0x1afffff
    Erasing 0x1b00000 - 0x1b1ffff
    Erasing 0x1b20000 - 0x1b3ffff
    Erasing 0x1b40000 - 0x1b5ffff
    Erasing 0x1b60000 - 0x1b7ffff
    Erasing 0x1b80000 - 0x1b9ffff
    Erasing 0x1ba0000 - 0x1bbffff
    Erasing 0x1bc0000 - 0x1bdffff
    Erasing 0x1be0000 - 0x1bfffff
    Erasing 0x1c00000 - 0x1c1ffff
    Erasing 0x1c20000 - 0x1c3ffff
    Erasing 0x1c40000 - 0x1c5ffff
    MEMERASE: Input/output error

    Error erasing MTD
    admin@(none):/tmp/mnt/PATRIOT#


    and dmesg has this:
    nand_erase: attempt to erase a bad block at page 0x00007880
     
    Last edited: Dec 3, 2012
  7. RMerlin

    RMerlin Part of the Furniture

    Joined:
    Apr 14, 2012
    Messages:
    13,376
    Location:
    Canada
    Yep, same issue as others had. Try running mtd-erase again and see if it gets stuck at the same address.

    If yes, reboot, and try again. It seems that doing this 2-3 times can eventually let you format it properly. This randomness is even weirder to me.

    I hope to someday find a more permanent solution to this, unfortunately I have very limited technical information related to this - that NAND seems to be pretty unique to the RT-AC66U so far.
     
  8. bheiser1

    bheiser1 Occasional Visitor

    Joined:
    Nov 21, 2012
    Messages:
    39
    I guess I'll need to contact Asus for a warranty replacement :mad:

    I tried 6 times to do the procedure you suggested ... the mtd-erase -d jffs2 command with a reboot after each one before doing the next. I got the same error and failure address each time.
     
  9. RMerlin

    RMerlin Part of the Furniture

    Joined:
    Apr 14, 2012
    Messages:
    13,376
    Location:
    Canada
    Getting an RMA replacement won't you do much good. This is more a software bug than a real defect in your router.
     
  10. bheiser1

    bheiser1 Occasional Visitor

    Joined:
    Nov 21, 2012
    Messages:
    39
    Yes, and I came to realize that I probably can't RMA the device anyway since I'm trying to use a feature (JFFS) not supported by Asus.

    So I'll hope for a fix that addresses the inability to format JFFS. In the meantime, I have a situation where at least one client machine can't connect following a router reboot unless I happen to be available to type the "nvram set wl0_reg_mode=h" to enable 802.11d+h / setting the country code.

    I guess I'll keep the 'ole RT-N16 online in parallel for now as a backup ...
     
  11. jochenthomas

    jochenthomas Occasional Visitor

    Joined:
    Dec 20, 2012
    Messages:
    14
    Had exact the same situation, but doing it different times again and again (manual formatting) brought success :)

    But one short question: This "drive" is now permanent and automatically mounted at start; right? I know it's not intended for permantent write operations...
     
  12. RMerlin

    RMerlin Part of the Furniture

    Joined:
    Apr 14, 2012
    Messages:
    13,376
    Location:
    Canada
    Yes, once formatted, you should no longer have to worry about it. Content will survive reboots, and always gets auto-mounted. And in the case of the RT-AC66U, the content will never be affected by firmware flashes, since it uses a totally unused space of the NVRAM. That is until Asus decides to also make use of that space for something else in a future FW update, if they ever did.
     

Share This Page