OpenWrt Forum Archive

Topic: USB flash key -> Extra storage memory (overlay)

The content of this topic has been archived on 18 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I've succeed to setup an USB flash key as extra software storage / overlay on my TP-LINK 1043ND routers (v2 and v3)

Normally there's only 4MB :-)

But after restart password is cleared and some installed packages are also gone :-(
It's not a problem to set the password and install packages again.
But can someone explain why that is?
I'm also worried I don't find all the disappeared packaged....and what if some system settings/files are gone too?   How can I control this?

In short I did these steps (maybe I did it wrong?):

  • Installed "kmod-usb-storage-extras" (needed for pivot-ovelay support, "kmod-usb-storage" is not enough)

  • Installed "kmod-fs-ext4" (support for ext{2|3|4} fileformat)

  • Installed "block-mount" (for auto-mount, fstab and also give gui in luci)

  • Installed "fdisk" (partition util)

  • Created two partitions using fdisk on dev/sda (the USB flash drive)

  • Installed "e2fsprogs" (disc tools e.g. format util)

  • Format partitions: "mkfs.ext4 -O ^has_journal /dev/sda1" and "mkfs.ext4 -O ^has_journal /dev/sda2"

  • Redetect USB flash partitions: "block detect > /etc/config/fstab"

  • Created mounts in luci:

  • Restart

All the above installed packages are gone (or at least not visible in luci software or doing "opkg list-installed")

I'm very confused why the overlay still works when especially these packages are gone, I would expect these are required for the USB Flash to work as overlay.?


(Last edited by MrBW on 8 Jul 2016, 11:03)

You did not configure your overlay properly: instead of overlaying your external device on top of the internal overlay, you are mounting your external device instead of the internal overlay, thus all changes that are present on the internal overlay are lost.

Have a look to the overlay guide, and check how you should configure your fstab file.

Ahhh.....basicly I need to copy the content of the original /overlay folder to the flash key before mounting it as "/overlay"....correct me if I'm wrong.
Thanks for pointing me in the right direction :-)

did you follow the extroot guide from openwrt wiki, specially the step 2 is.

2. Prepare your external storage root overlay

mount /dev/sda1 /mnt ; tar -C /overlay -cvf - . | tar -C /mnt -xf - ; umount /mnt

Yes....exactly that line :-)

Another thing I saw in this guide was:

System Upgrade

Recommended by extroot maintainer

I recommend that you DO NOT try to do upgrades using opkg upgrade.
You will likely end up with an inconsistent state and bricked router that way:

The main reason is that the uClibc ABI (Application Binary Interface) is unstable and changes from 
revision to revision, so binaries for one version of uClibc may be incompatible with versions from another.
Another problem that can arise is if you try to upgrade the kernel packages, then flash and reboot, but your
operation is interrupted in any way, then you will have a kernel and module mismatch and likely a brick.
Finally, if you upgrade all packages but the kernel and the kernel modules, some packages like iptables 
will be broken.

What does this mean?
Kernel: If I wanna update the kernel this should only be done by installing the latest OpenWRT FW image (...sysupgrade.bin), right?
Packages: Can I update individual packages using "opkg install <pkgs>"?
Perhaps using "opkg list-upgradable" to find them. I could imaging that would be a good thing to do regularly?

MrBW wrote:

What does this mean?

This is the warning to not attempt to launch the opkg upgrade command while the ExtRoot is active - for the reasons stated in the text.
Actually, even without ExtRoot it is not wise to run that command - beause of the nature of the SquashFS, explaned here.

With ExtRoot you will be able to update the packages installed on the overlay (with opkg update; opkg install packagename). For the packages installed in the image (on the SquashFS) - you should flash a newer image instead.

(Last edited by booBot on 8 Jul 2016, 22:37)

The discussion might have continued from here.