12-28-2016 11:42 AM
This is also a good tutorial, writing from a Mac user perspective, but really, the process isn't that Mac-centric. Mainly the TFTP portion is Mac-ish.
He just does a good job narrating the experience. I assume you have a serial connection to the ERL already: the important part here is inturrupting the boot process to drop into the bootloader console. You should see console output indicating there is a USB device mounted and ready for action (doesn't matter what's on it at this point, as long as it is formatted correctly).
If you have a USB device that doesn't become ready quickly enough, then you won't see it as mounted in the console output. If you do a warm reboot at that point from the command line, and again go into the boot console, you'll probably see the drive mounted since it is already "up" at that point.
If that is the case, it means you need to introduce a delay in the cold start boot process to give the USB drive time to get ready. There is a configuration line called "bootcmd" that needs to be edited to add the delay.
View your bootcmd settings with the command printenv bootcmd
You'll see one long line, something like:
'fatload usb 0 $loadaddr vmlinux.64;bootoctlinux $loadaddr coremask=0x3 root=/dev/sda2 rootdelay=15 rw rootsqimg=squashfs.img rootsqwdir=w mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@3072k(eeprom)'
Note the apostrophes!
This is from my ERL; yours may look different! In particular, the 3072k(eeprom) is 1024k(eeprom) on some units. Don't know what that part is doing, and I've tried my ERL's with both and didn't notice an obvious difference. Until one night it exploded while trying to read a non-existant part of the eeprom...
Edit your bootcmd in a text editior by adding sleep 10;usb reset; to the beginning of the string.
It will now look like:
'sleep 10;usb reset;fatload usb 0 $loadaddr vmlinux.64;bootoctlinux $loadaddr coremask=0x3 root=/dev/sda2 rootdelay=15 rw rootsqimg=squashfs.img rootsqwdir=w mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@3072k(eeprom)'
Put it in the ERL using the setenv bootcmd command. Just paste:
setenv bootcmd 'sleep 10;usb reset;fatload usb 0 $loadaddr vmlinux.64;bootoctlinux $loadaddr coremask=0x3 root=/dev/sda2 rootdelay=15 rw rootsqimg=squashfs.img rootsqwdir=w mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@3072k(eeprom)'
Use command save to commit it, followed by a reset to restart everything.
The console output should now show a 10 second pause, then the USB device mounted and available.
You can putter with the sleep value if feeling compulsive; it is probably excessive at 10 seconds.
Hope this helps!
12-28-2016 12:24 PM
Thanks ssisak and haef for the instructions re the sleep command, great stuff. I've already recovered my ERL with a brand new SanDisk Cruzer Fit flash drive so I now have a working backup router again. I expect that the flash in my current ERL will go bad as well within a few months so I have another flash drive standing by.
12-28-2016 01:21 PM
Flash memory is pretty dang robust, esp. if all you are doing is reading it. It's the writes that are more finite. I've rarely had flash die in any gadget; this whole mess with the ER's dying seems to be more about a batch of bad drives UBNT used. In other words, I don't think you will have this problem again. (He said, hopefully.)
01-27-2017 03:06 AM
For me it was working with a Kingston DataTraveller 16GB G2 model, see picture. Quite easy to open at the rear end (e.g. with a sharp knife)
THX to all for the great contributions to this forum
02-10-2017 03:38 PM
thanks for the reponse. USB is this an internal bus? My device does nto have a USB port. Anyways I can make it as far as here:
Enter EdgeOS image url: ftp://10.91.19.5/pub/ER-e100.v188.8.131.5274253.tar % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 68.3M 100 68.3M 0 0 8319k 0 0:00:08 0:00:08 --:--:-- 6318k
However I think my corporate firewall may be blocking it. Is there a procedure to write to the flash after I have booted from the RAM? How can I load any image into the flash?
02-10-2017 11:42 PM
Whenever I try to do this,it will automatically reset and I never get the chance to save and reset....
This is what I entered:
setenv bootcmd sleep10;usb reset;fatload usb 0 $loadaddr vmlinux.64;bootoctlinux $loadaddr coremask=0x3 root=/dev/sda2 rootdelay=15 rw rootsqimg=squashfs.img rootsqwdir=w mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@1024k(eeprom)
Would appreciate your advice?
02-11-2017 05:04 AM
I loaded the usb stick connected to my laptop using PassMark imageUSB software. Then changed the hardware into the Edgerouter POE, see picture above. After that I updated to the latest version 1.9.1 and went back to my settings with my latest saved config settings. See also the earlier posts in this thread. It migh help to read it completely.
03-15-2017 11:12 AM
Hi all. Who can clearly explain why I have "counterfeit" error after restore usb. I installed 3 ap's lr, and wanted to buy better router. And after upgrade firmware I have this error. On this forum I only saw that ubnt exchange device if it has warranty. but if this heppend and there is no warrany? I read on some forum that there is a digital sing in firmware. I think that this problem can be solved by flashing bios chip wich present on the board. Does someone have bios firmware for ERL?
03-16-2017 04:09 PM
Im not sure what you mean by counterfeit error but at the top of this page is a post that describes recovering a bricked ERL. It contains a link that has a good description of the procedure. Wtihin that link there is another link to the binary that gets programmed into the Flash memory. Luckily the Cavium Octeon has a separate NOR flash containing Uboot so this recovery is possible. It took me a day or two to work it out......good luck
03-17-2017 07:17 AM
The issue is that I and others have un-bricked their ERL's as described above and elsewhere. They work fine, but the command line then shows an error A13 and the GUI in the system tab does not show a "Genunine Ubiquiti" graphic in the UR corner. No idea if this impacts actual operation in some way, but it's another reason I won't use their stuff in production settings
03-17-2017 07:56 AM
03-17-2017 04:20 PM
This helped me revive an ERL in the lab that refused to boot with Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,2).
I did a emrk-reinstall so the USB drive would get reformatted.
It works for now and I'll have an eye on future boot messages.
03-26-2017 09:56 PM
A little commentary about the Initialization error A12 I have seen pop up on my router since i swapped its (failed) USB stick with a different one:
The original USB stick must have some sort of signature that walidates the router as "authentic". Some sort of file or checksum. I confirmed this by loading version 1.0.2 of the firmware on one of my USB sticks and putting it in to the edgerouter. Where i had an "Initialization error A12" I got a "Counterfeit warning" instead. Moreover, inside the filesystem there is a file called Error-A12 that can be deleted and the system tab of the GUI appears clean, the initial CLI still shows it however. ("Linux Error-A12" blurb) As an editorial comment I would suggest against such a checksum being present in the router, it's unnecessary in my opinion. Just my €.02
03-27-2017 08:13 AM
If it helps, I formatted the drive with Disk Utility on macOS and dropped the image on from there and did not get an "authentic" warning -- was using a SanDisk drive. See my replay many pages back for details.
04-02-2017 03:49 PM
Well, I had to reboot an ERLite due to rewiring power and got this wonderful error.
SQUASHFS error: Unable to read data cache entry [47160a]
SQUASHFS error: Unable to read page, block 47160a, size 18173
So I'll have fun tomorrow. I have plenty of USB sticks, and since the original is a 4GB stick, I'll probably use something fairly new (I bought 3 SandDisk Ultra USB 3.0 16GB just a couple of days ago),
I'll just pop the plastic case off.
I believe the ERLite uses USB 2.0, but that shouldn't be a problem. Won't bother. It's almost one hour past midnight so it's too late and bedtime since 3 hours....
05-17-2017 10:07 PM - edited 05-17-2017 10:11 PM
Why is all of this complexity necessary?
Can't someone (perhaps UBNT) use Win32DiskImager to create an image file from the USB Drive on a working Edgerouter Lite that we can then burn to a new USB Drive using Win32DiskImager?
05-19-2017 12:52 PM
But you can see a variation of imaging a USB drive as you propose at the link mentioned earlier: https://hilo90mhz.com/ubiquiti-edgerouter-lite-erlite-3-internal-usb-storage-fail/
The complexity seems to grow from a few different things:
•You can't just download a firmware update and jam it on a USB drive.
•Different USB drives requiring tweaking to work properly.
•Dependent too upon how badly you want to load your backup configuration. That means the latest firmware might be a bad choice in that case.
•Restoring the drive in situ is a popular approach too, but it definitely adds to the complexity.
•In the Ubiquiti way, they let users sort it all out and don't provide support for the resurrection process. Ubiquiti owned up to the problem for a while and replaced dead routers, but they've moved on from that.
•They also won't provide the drive image in a way to facilitate this simply despite their customers desperately trying to fix their beloved routers and essentially helping the brand's reputation & loyal fan base.
Go figure. Stuff like that.