Member
Posts: 248
Registered: ‎09-16-2011
Kudos: 52
Solutions: 2

ERX, ERX-SFP System Recovery

Good day...

 

First of all, the solution is not mine, so credits go to all the friends who worked hard to make it happen.

 

Based on whatever has been discussed in https://community.ubnt.com/t5/EdgeMAX/What-are-the-recovery-options-on-a-EdgeRouter-X/m-p/1678385#M1...

 

Download The following:

1. lede-ramips-mt7621-ubnt-erx-initramfs-kernel.bin file from https://drive.google.com/drive/folders/0B1VOQQ-_EIXKWXVhNG5YUDlvNXc

2. Download the latest firmware from UBNT, extract files: version.tmp, squashfs.tmp, squashfs.tmp.md5, and vmlinux.tmp

 

Setup TFTP server

1. Setup TFTP server and put all files in its virtual directory.

 

Setup connections: (tested on ERX-SFP)

1. For TFTP, use eth0

2. for scp, I do not know why it happened to be eth1. use -scp with no password to copy (default is -sftp and it will give an error).

 

Recovery:

1. you need a USB-TTL.

2. Open your ERX, ERX-SFP, this WILL void any warranty.

3. Connect GND, TX, RX only between the TTL and your ERX, GND is the rightmost pin (if pins are at bottom).

4. Open any terminal (I used PUTTY), set it to your COM port, 57600 8N1 with no parity and no flow control.

5. Connect the power to ERX/ERX-SFP, if no output is there, disconnect power and switch the RX/TX cables.

6. when this appears:

Please choose the operation: 
   1: Load system code to SDRAM via TFTP. 
   2: Load system code then write to Flash via TFTP. 
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial. 
   9: Load Boot Loader code then write to Flash via TFTP. 
default: 3

press 1 to select (Load system code to SDRAM via TFTP), fill in all required info, use lede-ramips-mt7621-ubnt-erx-initramfs-kernel.bin file

7. LEDE will boot, giving you the following:

BusyBox v1.26.2 () built-in shell (ash)

     _________
    /        /\      _    ___ ___  ___
   /  LE    /  \    | |  | __|   \| __|
  /    DE  /    \   | |__| _|| |) | _|
 /________/  LE  \  |____|___|___/|___|                      lede-project.org
 \        \   DE /
  \    LE  \    /  -----------------------------------------------------------
   \  DE    \  /    Reboot (SNAPSHOT, r3742-894ee95)
    \________\/    -----------------------------------------------------------

=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@LEDE:/# ls
bin      etc      lib      overlay  rom      sbin     tmp      var
dev      init     mnt      proc     root     sys      usr      www
root@LEDE:/#

 

8. SCP the remaining 3 files to /tmp

9. Do the following, one by one:

ubiformat /dev/mtd5
ubiattach -p /dev/mtd5
ubimkvol /dev/ubi0 --vol_id=0 --lebs=1925 --name=troot
mount -o sync -t ubifs ubi0:troot /mnt/
cp /tmp/version.tmp /mnt/version
cp /tmp/squashfs.tmp /mnt/squashfs.img
cp /tmp/squashfs.tmp.md5 /mnt/squashfs.img.md5

 

10. Then:

dd if=/tmp/vmlinux.tmp of=/dev/mtdblock3
dd if=/tmp/vmlinux.tmp of=/dev/mtdblock4

11. Reboot

 

 

If everthing went good, the router will reboot normally and give you the login prompt

 

As per the original instruction, do a reset, then update the firmware to 1.9.7H3, reboot, reset again.

Regular Member
Posts: 506
Registered: ‎04-26-2016
Kudos: 136
Solutions: 25

Re: ERX, ERX-SFP System Recovery

[ Edited ]

@alawadhi

 

This worked great for reviving a dead ER-X (non-SFP). Thank you for compiling all the relevant information in that post to something that is easily readable/do-able. I turned a doorstop back into a usable router because of you.

 

Here are a few clarifications:

 

  • SCP username for LEDE is root with NO password to SCP files to the ERX/ERX-SFP.
  • You do have to move ethernet from eth0 to eth1 after the TFTP for the SCP to work. So TFTP via eth0, and SCP via eth1. The IP address doesn't change from whatever you enter in the initial startup script via option 1.
  • Option 1 the bootloader... first prompt is LOCAL ER-X address, second prompt is TFTP server for the firmware files (your PC typically).
  • There's no need to default and reflash after your instructions. Just grab the latest firmware (in my case was 1.9.7 HF3 and use those files)... the ERX came right up on 1.9.7 HF3 in default mode.

And if you don't believe me..... this ER-X was a failed attempt of upgrade from 1.9.7 hf1 to hf2 and was completely dead. Now it looks like

Capture.JPG

 

Cheers2

 

(2) ER4s, (5) ER-8s, (15) ERXs, (2) ER5POE , UNMS (@Vultr), too much UniFi stuff to list.
New Member
Posts: 1
Registered: ‎12-20-2017
Kudos: 2

Re: ERX, ERX-SFP System Recovery

@alawadhi +@chewychewbacca

 

I was able to save my edgerouter X today thanks to the information you shared here. Because I made some things differently (and also found some differences) I'm going to share my experience.

 

I used as my OS kubuntu 16.04 with the following steps:

  • to install the app that connects to the TTL adapter and the tftp server:
    sudo apt install gtkterm tftpd-hpa
  • then add your user account to the group "dialout", so he can write to the interface:
    sudo usermod -a -G dialout your_username
  • change the permissions on the TFTP default dir:
    sudo chown -R tftp /var/lib/tftpboot/
  • copy the required files to the TFTP dir: /var/lib/tftpboot (you can change this dir in file /etc/default/tftpd-hpa)
  • restart the TFPT server: sudo service tftpd-hpa restart
  • then logout and login again, so the group change comes to effect
  • open gtkterm and configure it to connect to /dev/ttyUSB0 (the other parameters are the same ones mentioned in @alawadhi post) 
  • connect the cables and make sure the edgerouter is the last one to be powered

On point 8, when I changed the cable to eth1 the  IP address of the edgerouter actually changed to 192.168.1.1. To checkout the ip address of your interfaces do:

  • ip a   (this command will list all interfaces and its IP addresses)

Then copy the files:

  • cd /var/lib/tftpboot
  • scp * root@edgerouter_IP:/tmp

 

On point 9:

  • the first command in point 9 gave me an error:
    ubiformat /dev/mtd5
    ubiformat: error!: please, first detach mtd5 (/dev/mtd5) from ubi0
  • to solve do: 
    ubidetach -p /dev/mtd5

All the remain commands worked flawlessly.

One reboot was enough (no reset required).

 

Hurray

 

New Member
Posts: 1
Registered: ‎07-06-2017

Re: ERX, ERX-SFP System Recovery

I recieved a new ER-X that I could not connect to. Currently attempting to fix the issue, but I have ran into a problem and am hoping I can recieve some assistance on. Following the instructions given by alawadhi, I got to step 6 and was unable to boot LEDE. The attached screenshot shows the terminal when I attempt to load the file.

 

The ER-X is connected physically through USB-TTL and eth0 to my laptop (Windows 8.1). If I use option 3 and log in with the default username and password, I am able to pin my TFTP server address (127.0.0.1).

 

Terminal Screenshot.JPG

Emerging Member
Posts: 87
Registered: ‎07-18-2016
Kudos: 35
Solutions: 3

Re: ERX, ERX-SFP System Recovery

127.0.0.1 is a lookback address, the er-x is trying to TFTP to itself which of course will not work. use the ip address of your servers ethernet interface.

New Member
Posts: 14
Registered: ‎12-03-2016
Kudos: 14

Re: ERX, ERX-SFP System Recovery

[ Edited ]

Unfortunately this just throws a "resource busy" error so I can not continue with the steps

 

ubidetach -p /dev/mtd5

 

ubidetach: error!: cannot detach "/dev/mtd5"

                  error  16   (Resource busy)

 

 

Im not sure how to proceed now.  Any suggestions?  I logged out, rebooted, nothing, I am unable to proceed in restoring Factory firmware.  Will stick with LEDE for now, works fine minus the offloading support which is present in the UBNT firmware.

New Member
Posts: 14
Registered: ‎12-03-2016
Kudos: 14

Re: ERX, ERX-SFP System Recovery

FIXED.   Working now.

 

What I did.

 

Grabbed the LEDE 17.01.3 version of the ubnt-erx-initramfs-kernel.bin file to TFTP and then proceeded with the rest of the steps.  Yes I still had to run the ubidetach -p /dev/mtd5 command to proceed further, but this time it workd.

 

Before I was using the latess snapshot version of the .......initramfs-kernel.bin file and could not run the ubidetach without geting an error.

 

Sweet....  back to stock and vice versa....  no kernal panics either.

Member
Posts: 151
Registered: ‎12-10-2014
Kudos: 63
Solutions: 2

Re: ERX, ERX-SFP System Recovery

[ Edited ]

many thanks for the steps!

with thankful help from @eripek i actually was able to debrick an EP-R6 this way which didnt boot after a firmware upgrade.

 

sidenote, we had to detach before ubiformat with:

ubidetach -m 5

 

New Member
Posts: 5
Registered: ‎01-20-2018
Kudos: 1

Re: ERX, ERX-SFP System Recovery

Like so many others, my ERX bricked while updating.

 

So, thanks to this post I've gotten to step 8, but being a complete newbie, I have no idea how to "SCP the remaining 3 files to /tmp".

 

I download the latest firmware (ER-X/ER-X-SFP/EP-R6: Firmware v1.9.7+hotfix.4 ),

extracted the files: version.tmpsquashfs.tmpsquashfs.tmp.md5, and vmlinux.tmp to the tptp64 directory on my laptop.

 

I'm at the u-boot prompt on the ERX.

 

Could someone please let me know if I'm correct so far, and walk me through step 8?

Veteran Member
Posts: 8,069
Registered: ‎03-24-2016
Kudos: 2117
Solutions: 927

Re: ERX, ERX-SFP System Recovery

For most windows users, scp is easiest done with:

https://winscp.net/eng/download.php

New Member
Posts: 5
Registered: ‎01-20-2018
Kudos: 1

Re: ERX, ERX-SFP System Recovery

[ Edited ]

Aha... Makes sense now.

Thank You!

 

UPDATE: 

 

I used the latest v1.9.7+hotfix.4 files, and it's running great.

 

Thank you all so much!

 

 

New Member
Posts: 2
Registered: ‎10-30-2017

Re: ERX, ERX-SFP System Recovery

Hello everyone. I'm stuck at point 8. 

 

Can someone explain me better how to copy the files? 

 

Which are the 3 files that need to be copied?

 

thanks 

New Member
Posts: 5
Registered: ‎01-20-2018
Kudos: 1

Re: ERX, ERX-SFP System Recovery

Download the free windows WINSCP program from the link above.

 

Use that to log into the router, then drag & drop the files into tmp folder in ERX:

version.tmp
tmp/squashfs.tmp
squashfs.tmp.md5

Then continue at step 9.

 

Don't forget to move cable from port 0 to port 1 as noted. 

New Member
Posts: 2
Registered: ‎10-30-2017

Re: ERX, ERX-SFP System Recovery

Everything works fine! thank you @Paul_J for your support

New Member
Posts: 1
Registered: ‎05-19-2017
Kudos: 1

Re: ERX, ERX-SFP System Recovery

Just want to add that the above worked for me one time, but had a problem with this last update (1.10) where it didn't work.  I was able to use the serial cable and select option 4 (

4: Entr boot command line interface.

I then had two different kernels to boot from.  bfd40000 and .c0040000.  I did a "bootm c0040000" and was able to boot the other kernel.

 

Prior to this, even with the solution shown above in this thread, I was getting CRC corrupt data, memory errors, magic block error, or something to the extent of those.  I thought my nand memory was corrupted.  Fortunetly it wasn't and everything works find.  Guess I'll have an "extra" ER-X SFP coming in the mail tomorrow.

New Member
Posts: 5
Registered: ‎01-20-2018
Kudos: 1

Re: ERX, ERX-SFP System Recovery

The 1.10 update said it failed, but when I tried to delete the backup bootfile to make room and try again, it said I needed to reboot.

 

After reboot it appears to be working with 1.10, so we'll see.

New Member
Posts: 1
Registered: ‎12-11-2016

Re: ERX, ERX-SFP System Recovery

Thank you for these instructions.  You REALLY saved me.  I used a serial cable I bought for my Raspberry Pi to connect to the Router serial interface, after opening the case.  It worked like a champ.  These are the best unbricking instructions I've ever found.  Having a cable on-hand to connect to the serial pins on the main board was a Godsend. Man Happy

 

I, too, have a new EdgeRouter coming tomorrow.  Fortunately, it's an upgraded model so my newly fixed ER-X will have to be my backup router.  It's working great now, though.

 

Steve

New Member
Posts: 6
Registered: ‎07-30-2017

Re: ERX, ERX-SFP System Recovery

[ Edited ]

Hi all, I have tried to follow the instruction as said and I am unable to complete the last step (i.e. Step 10). Can anyone help?

 

[    0.190000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.190000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.190000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.190000] CPU2 revision is: 0001992f (MIPS 1004Kc)
[    0.280000] Synchronize counters for CPU 2: done.
[    0.290000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[    0.290000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.290000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[    0.290000] CPU3 revision is: 0001992f (MIPS 1004Kc)
[    0.380000] Synchronize counters for CPU 3: done.
[    0.390000] Brought up 4 CPUs
[    0.390000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.400000] futex hash table entries: 1024 (order: 3, 32768 bytes)
[    0.410000] pinctrl core: initialized pinctrl subsystem
[    0.420000] NET: Registered protocol family 16
[    0.490000] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    0.500000] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    0.510000] mt7621_gpio 1e000600.gpio: registering 32 gpios
[    0.520000] clocksource: Switched to clocksource GIC
[    0.540000] NET: Registered protocol family 2
[    0.550000] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[    0.560000] TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
[    0.570000] TCP: Hash tables configured (established 2048 bind 2048)
[    0.580000] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.600000] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.610000] NET: Registered protocol family 1
[    1.680000] Crashlog allocated RAM at address 0x3f00000
[    1.690000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.700000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    1.730000] io scheduler noop registered
[    1.730000] io scheduler deadline registered (default)
[    1.740000] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    1.760000] console [ttyS0] disabled
[    1.770000] 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 33, base_baud = 3125000) is a 16550A
[    1.780000] console [ttyS0] enabled
[    1.780000] console [ttyS0] enabled
[    1.800000] bootconsole [early0] disabled
[    1.800000] bootconsole [early0] disabled
[    1.810000] MediaTek Nand driver init, version v2.1 Fix AHB virt2phys error
[    1.830000] Allocate 16 byte aligned buffer: 80613130
[    1.840000] Enable NFI Clock
[    1.840000] # MTK NAND # : Use HW ECC
[    1.850000] Device found in MTK table, ID: 1da, EXT_ID: 909546
[    1.860000] Support this Device in MTK table! 1da
[    1.870000] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xda
[    1.890000] nand: AMD/Spansion NAND 256MiB 3,3V 8-bit
[    1.900000] nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
[    1.910000] [NAND]select ecc bit:12, sparesize :112 spare_per_sector=28
[    1.920000] Scanning device for bad blocks
[    2.600000] Bad eraseblock 1975 at 0x00000f6e0000
[    2.630000] Bad eraseblock 2041 at 0x00000ff20000
[    2.640000] 6 ofpart partitions found on MTD device MT7621-NAND
[    2.660000] Creating 6 MTD partitions on "MT7621-NAND":
[    2.670000] 0x000000000000-0x000000080000 : "u-boot"
[    2.680000] 0x000000080000-0x0000000e0000 : "u-boot-env"
[    2.690000] 0x0000000e0000-0x000000140000 : "factory"
[    2.700000] 0x000000140000-0x000000440000 : "kernel1"
[    2.710000] 0x000000440000-0x000000740000 : "kernel2"
[    2.720000] 0x000000740000-0x00000ff00000 : "ubi"
[    2.730000] [mtk_nand] probe successfully!
[    2.740000] Signature matched and data read!
[    2.750000] load_fact_bbt success 2047
[    2.760000] netif_napi_add() called with weight 128 on device eth%d
[    2.790000] libphy: mdio: probed
[    4.200000] mtk_soc_eth 1e100000.ethernet: loaded mt7530 driver
[    4.210000] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 10
[    4.230000] mt7621_wdt 1e000100.wdt: Initialized
[    4.240000] NET: Registered protocol family 10
[    4.250000] NET: Registered protocol family 17
[    4.260000] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
[    4.280000] 8021q: 802.1Q VLAN Support v1.8
[    4.300000] UBI: auto-attach mtd5
[    4.300000] ubi0: attaching mtd5
[    6.170000] mtk_soc_eth 1e100000.ethernet eth0: port 0 link up
[    6.760000] ubi0: scanning is finished
[    6.780000] ubi0: attached mtd5 (name "ubi", size 247 MiB)
[    6.790000] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    6.810000] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    6.820000] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    6.830000] ubi0: good PEBs: 1981, bad PEBs: 1, corrupted PEBs: 0
[    6.850000] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[    6.860000] ubi0: max/mean erase counter: 9/6, WL threshold: 4096, image sequence number: 1785028699
[    6.880000] ubi0: available PEBs: 0, total reserved PEBs: 1981, PEBs reserved for bad PEB handling: 39
[    6.900000] ubi0: background thread "ubi_bgt0d" started, PID 302
[    6.900000] hctosys: unable to open rtc device (rtc0)
[    6.920000] Freeing unused kernel memory: 1420K (8047d000 - 805e0000)
[    6.950000] init: Console is alive
[    6.950000] init: - watchdog -
[    6.970000] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    6.980000] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    7.000000] init: - preinit -
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    9.200000] procd: - early -
[    9.200000] procd: - watchdog -
[    9.800000] procd: - ubus -
[    9.860000] random: ubusd: uninitialized urandom read (4 bytes read, 24 bits of entropy available)
[    9.870000] random: ubusd: uninitialized urandom read (4 bytes read, 24 bits of entropy available)
[    9.890000] random: ubusd: uninitialized urandom read (4 bytes read, 24 bits of entropy available)
[    9.910000] random: ubusd: uninitialized urandom read (4 bytes read, 24 bits of entropy available)
[    9.930000] random: ubusd: uninitialized urandom read (4 bytes read, 24 bits of entropy available)
[    9.950000] random: ubusd: uninitialized urandom read (4 bytes read, 24 bits of entropy available)
[    9.960000] random: ubusd: uninitialized urandom read (4 bytes read, 24 bits of entropy available)
[    9.980000] procd: - init -
Please press Enter to activate this console.
[   10.100000] kmodloader: loading kernel modules from /etc/modules.d/*
[   10.110000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   10.130000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   10.140000] nf_conntrack version 0.5.0 (3981 buckets, 15924 max)
[   10.180000] xt_time: kernel timezone is -0000
[   10.190000] PPP generic driver version 2.4.2
[   10.200000] NET: Registered protocol family 24
[   10.210000] kmodloader: done loading kernel modules from /etc/modules.d/*
[   11.290000] random: jshn: uninitialized urandom read (4 bytes read, 35 bits of entropy available)
[   11.360000] random: jshn: uninitialized urandom read (4 bytes read, 35 bits of entropy available)
[   11.490000] random: jshn: uninitialized urandom read (4 bytes read, 35 bits of entropy available)
[   14.660000] device eth0.1 entered promiscuous mode
[   14.670000] device eth0 entered promiscuous mode
[   14.680000] br-lan: port 1(eth0.1) entered forwarding state
[   14.690000] br-lan: port 1(eth0.1) entered forwarding state
[   16.690000] br-lan: port 1(eth0.1) entered forwarding state
[   20.310000] random: nonblocking pool is initialized



BusyBox v1.26.2 () built-in shell (ash)

     _________
    /        /\      _    ___ ___  ___
   /  LE    /  \    | |  | __|   \| __|
  /    DE  /    \   | |__| _|| |) | _|
 /________/  LE  \  |____|___|___/|___|                      lede-project.org
 \        \   DE /
  \    LE  \    /  -----------------------------------------------------------
   \  DE    \  /    Reboot (SNAPSHOT, r3742-894ee95)
    \________\/    -----------------------------------------------------------

=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@LEDE:/# [  452.940000] mtk_soc_eth 1e100000.ethernet eth0: port 0 link down
[  456.390000] mtk_soc_eth 1e100000.ethernet eth0: port 1 link up
ls
bin      etc      lib      overlay  rom      sbin     tmp      var
dev      init     mnt      proc     root     sys      usr      www
root@LEDE:/# ubiformat /dev/mtd5
ubiformat: error!: please, first detach mtd5 (/dev/mtd5) from ubi0
root@LEDE:/# ubidetach -p /dev/md5
libubi: error!: cannot stat "/dev/md5"
        error 2 (No such file or directory)
ubidetach: error!: cannot detach "/dev/md5"
           error 2 (No such file or directory)
root@LEDE:/# ubidetach -p /dev/mtd5
[  810.760000] ubi0: detaching mtd5
[  810.770000] ubi0: mtd5 is detached
root@LEDE:/# ubiattach -p /dev/mtd5
[  835.890000] ubi0: attaching mtd5
[  838.330000] ubi0: scanning is finished
[  838.360000] ubi0: attached mtd5 (name "ubi", size 247 MiB)
[  838.370000] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[  838.390000] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[  838.400000] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[  838.410000] ubi0: good PEBs: 1981, bad PEBs: 1, corrupted PEBs: 0
[  838.430000] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[  838.440000] ubi0: max/mean erase counter: 9/6, WL threshold: 4096, image sequence number: 1785028699
[  838.460000] ubi0: available PEBs: 0, total reserved PEBs: 1981, PEBs reserved for bad PEB handling: 39
[  838.480000] ubi0: background thread "ubi_bgt0d" started, PID 1033
UBI device number 0, total 1981 LEBs (251539456 bytes, 239.9 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
root@LEDE:/# ubimkvol /dev/ubi0 --vol_id=0 --lebs=1925 --name=troot
ubimkvol: error!: UBI device does not have free logical eraseblocks
root@LEDE:/# ubimkvol /dev/ubi0 --vol_id=0 --lebs=1925 --name=troot
ubimkvol: error!: UBI device does not have free logical eraseblocks
root@LEDE:/# ubiformat /dev/mtd5
ubiformat: error!: please, first detach mtd5 (/dev/mtd5) from ubi0
root@LEDE:/# ubidetach -p /dev/mtd5
[ 1321.120000] ubi0: detaching mtd5
[ 1321.130000] ubi0: mtd5 is detached
root@LEDE:/# ubiformat /dev/mtd5
ubiformat: mtd5 (nand), size 259784704 bytes (247.8 MiB), 1982 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 1981 -- 100 % complete
ubiformat: 1981 eraseblocks have valid erase counter, mean value is 6
ubiformat: 1 bad eraseblocks found, numbers: 1917
ubiformat: formatting eraseblock 1981 -- 100 % complete
root@LEDE:/# ubiattach -p /dev/mtd5
[ 1374.690000] ubi0: attaching mtd5
[ 1377.140000] ubi0: scanning is finished
[ 1377.160000] ubi0: attached mtd5 (name "ubi", size 247 MiB)
[ 1377.170000] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 1377.190000] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 1377.200000] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 1377.210000] ubi0: good PEBs: 1981, bad PEBs: 1, corrupted PEBs: 0
[ 1377.230000] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
[ 1377.240000] ubi0: max/mean erase counter: 10/7, WL threshold: 4096, image sequence number: 329140134
[ 1377.260000] ubi0: available PEBs: 1938, total reserved PEBs: 43, PEBs reserved for bad PEB handling: 39
[ 1377.280000] ubi0: background thread "ubi_bgt0d" started, PID 1045
UBI device number 0, total 1981 LEBs (251539456 bytes, 239.9 MiB), available 1938 LEBs (246079488 bytes, 234.7 MiB), LEB size 126976 bytes (124.0 KiB)
root@LEDE:/# ubimkvol /dev/ubi0 --vol_id=0 --lebs=1925 --name=troot
Volume ID 0, size 1925 LEBs (244428800 bytes, 233.1 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "troot", alignment 1
root@LEDE:/# mount -o sync -t ubifs ubi0:troot /mnt/
[ 1401.900000] UBIFS (ubi0:0): default file-system created
[ 1401.910000] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 1050
[ 1402.030000] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "troot"
[ 1402.050000] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 1402.070000] UBIFS (ubi0:0): FS size: 242778112 bytes (231 MiB, 1912 LEBs), journal size 12189696 bytes (11 MiB, 96 LEBs)
[ 1402.090000] UBIFS (ubi0:0): reserved for root: 4952683 bytes (4836 KiB)
[ 1402.100000] UBIFS (ubi0:0): media format: w4/r0 (latest is w4/r0), UUID 1B1BA7C8-E219-4C7A-B3D4-EDBA3D9239C0, small LPT model
root@LEDE:/# cp /tmp/version.tmp /mnt/version
root@LEDE:/# cp /tmp/squashfs.tmp /mnt/squashfs.img
cp /tmp/squashfs.tmp.md5 /mnt/squashfs.img.md5

root@LEDE:/# cp /tmp/squashfs.tmp.md5 /mnt/squashfs.img.md5
root@LEDE:/#
root@LEDE:/# dd if=/tmp/vmlinux.tmp of=/dev/mtdblock3
dd: can't open '/tmp/vmlinux.tmp': No such file or directory
root@LEDE:/# dd if=/tmp/vmlinux.tmp of=/dev/mtdblock3
dd: can't open '/tmp/vmlinux.tmp': No such file or directory
root@LEDE:/# dd if=/tmp/vmlinux.tmp of=/dev/mtdblock4
dd: can't open '/tmp/vmlinux.tmp': No such file or directory
root@LEDE:/# dd if=/tmp/vmlinux.tmp of=/dev/mtdblock3
3357+1 records in
3357+1 records out
root@LEDE:/# dd if=/tmp/vmlinux.tmp of=/dev/mtdblock4
[ 1615.530000] blk_update_request: I/O error, dev mtdblock4, sector 2432
dd: writing '/dev/mtdblock4': I/O error
2433+0 records in
2432+0 records out
[ 1616.440000] blk_update_request: I/O error, dev mtdblock4, sector 2304
[ 1616.450000] Buffer I/O error on dev mtdblock4, logical block 288, lost async page write
[ 1616.500000] blk_update_request: I/O error, dev mtdblock4, sector 2312
[ 1616.520000] Buffer I/O error on dev mtdblock4, logical block 289, lost async page write
[ 1616.570000] blk_update_request: I/O error, dev mtdblock4, sector 2320
[ 1616.580000] Buffer I/O error on dev mtdblock4, logical block 290, lost async page write
[ 1616.640000] blk_update_request: I/O error, dev mtdblock4, sector 2328
[ 1616.650000] Buffer I/O error on dev mtdblock4, logical block 291, lost async page write
[ 1616.700000] blk_update_request: I/O error, dev mtdblock4, sector 2336
[ 1616.720000] Buffer I/O error on dev mtdblock4, logical block 292, lost async page write
[ 1616.770000] blk_update_request: I/O error, dev mtdblock4, sector 2344
[ 1616.780000] Buffer I/O error on dev mtdblock4, logical block 293, lost async page write
[ 1616.840000] blk_update_request: I/O error, dev mtdblock4, sector 2352
[ 1616.850000] Buffer I/O error on dev mtdblock4, logical block 294, lost async page write
[ 1616.900000] blk_update_request: I/O error, dev mtdblock4, sector 2360
[ 1616.920000] Buffer I/O error on dev mtdblock4, logical block 295, lost async page write
[ 1616.970000] blk_update_request: I/O error, dev mtdblock4, sector 2368
[ 1616.980000] Buffer I/O error on dev mtdblock4, logical block 296, lost async page write
[ 1617.040000] Buffer I/O error on dev mtdblock4, logical block 297, lost async page write
[ 1617.280000] VFS: Dirty inode writeback failed for block device mtdblock4 (err=-5).

  

Veteran Member
Posts: 8,069
Registered: ‎03-24-2016
Kudos: 2117
Solutions: 927

Re: ERX, ERX-SFP System Recovery

Those I/O errors looks like faulty flash to me

Since hardware seems broken, I'd give up on that unit

New Member
Posts: 6
Registered: ‎07-30-2017

Re: ERX, ERX-SFP System Recovery

That is sad to hear.