Ubiquiti Edgerouter ER-X Flash issues (free space, hangs, firmware upgrades)

 

The ER-X is a very cheap 5 port router, with a lot of enterprise-level software features. It's almost too cheap, because it doesn't really have enough Flash memory, and certainly with earlier samples, the Flash itself was rather unreliable.

For a start, there isn't enough Flash space to store three images, so when you want to upgrade the firmware, you always need to delete any old backup version that's still installed to make enough free space ("delete system image" CLI command).

The firmware upgrade process ("add system image") itself can be rather hit&miss on devices that suffer from unreliable Flash, requiring multiple attempts to succeed. The symptom I found is an apparent hang at the "Copying Image" stage, with a crash and reboot after a few minutes.

There are many reports on the Internet of ER-X having random hangs with various software versions, in particular there's a symptom where IP forwarding seems to work normally, but you can't SSH into the router, and the DHCP server stops responding.  

My experience of this problem is that it's caused by the router's R/W Flash filesystem filling up.  The software uses Squashfs and Overlayfs to give a largely read-only filesystem, with just a few configuration files and additional software packages in the R/W area. 

The currently running filesystems are based in /root.dev. There will be a squashfs.img and a "w" directory that contains the R/W overlay filesystem. Any older firmware versions that are still installed will be in the same place but with a ".o" suffix.  This is quite handy because you can easily look at configuration files from an older version in the /root.dev/w.o tree.

Even if it looks like you have enough free space after doing an upgrade, there's a regular cron job that runs every 12 hours and updates the Apt cache. On my device, this job is sometimes enough to fill the filesystem up.  So I always need to remove the old installed firmware once I'm confident that the new firmware is working well enough.  Rather than properly deleting the old firmware, if you still want to retain an easy way of reverting, it's possible to just copy off the squashfs.img.o file; delete it, and then copy it back on  if you ever need to revert back to the earlier version.



Comments

Popular posts from this blog

DECnet-VAX Phase V WAN connectivity with simh

Time Electronics 9814 Programmable Voltage Calibrator

DECnet-VAX Phase V P.S.I. configuration in open_simh