Extroot is mounted in volatile memory. How to revert to factory?

Hi all,

I have installed OpenWRT and want to take advantage of external memory. For this purpose I have moved the root to the USB device. Here are the instructions I followed:

It worked but after that I performed a hard reset/reflash the firmware. Now everytime I reflash, the firmware is mounted in /tmp. Of cource I did a lot of attempts with different firmware - factory, DD-WRT, Gargoyle, etc. but nothing changes this behavior.
I cannot preserve swap, it does not survive a reboot.
Gargoyle shows an error:
"Router storage full (read only) or is mounted in volatile storage (RAM). It will not function correctly, or will revert to a previous state after rebooting. Restore default configuration or flash new firmware (without preserving settings)."

I want to go back to factory state, but this appears impossible to me. I appreciate any help from a knowledgable person, who can end my 4 days agony.

I'd reflash with the latest OpenWrt and then follow the extroot guide:

But just so we know what you're currently running, lets see the output of:

ubus call system board
1 Like

Thank for the answer. I did it several times.

Output of ubus call system board

{
"kernel": "5.10.176",
"hostname": "Gargoyle",
"system": "Qualcomm Atheros QCA956X ver 1 rev 0",
"model": "TP-Link Archer C7 v5",
"board_name": "tplink,archer-c7-v5",
"rootfs_type": "squashfs",
"release": {
"distribution": "OpenWrt",
"version": "22.03.5",
"revision": "r20134-5f15225c1e",
"target": "ath79/generic",
"description": "OpenWrt 22.03.5 r20134-5f15225c1e"
}
}

Flash the sysupgrade version of 22.03.5 and do not keep settings.
https://firmware-selector.openwrt.org/?version=22.03.5&target=ath79%2Fgeneric&id=tplink_archer-c7-v5

After that, let's see the output of

mount
df -h

Every time I write the firmware to flash using TFTP with server address 192.168.0.66, thinking that this is the last and most powerful option.

tftp is fine. In that case, make sure you are using the factory image.

But once that is done, and with no other configuration changes, let's see the output of the two commands I requested earlier.

Here it is after the fresh install of latest stable release:
root@OpenWrt:~# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /tmp/root type tmpfs (rw,noatime,mode=755)
tmpfs on /dev type tmpfs (rw,nosuid,noexec,noatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
/dev/mtdblock9 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 4.0M 4.0M 0 100% /rom
tmpfs 59.7M 76.0K 59.6M 0% /tmp
tmpfs 59.7M 64.0K 59.6M 0% /tmp/root
tmpfs 512.0K 0 512.0K 0% /dev
/dev/mtdblock9 8.9M 428.0K 8.5M 5% /overlay
overlayfs:/overlay 8.9M 428.0K 8.5M 5% /

These look good. Now your system should be running a normal overlay on persistent storage.

Try making a small config change or creating a file (such as touch /root/test.txt) and then reboot. Make sure that the change you made persists across the reboot. If so, everything is fine.

And then, if you wnt to extroot, just follow the link I sent previously.

1 Like

Thanks for your help, Peter!
I did it several times and now settings survive the reboot. But what is strange is that the overlay is still in /tmp and I cannot manage to cleant it as a brand new.

root@OpenWrt:~# ls /tmp
0.db bird6.log etc luci-modulecache softethervpn
TZ board.json fwknop lvm spool
adb_runtime.json cache hosts privoxy.hotplug squid
adblock-Backup cjdroute.sock keepalived.conf qos.nft state
babeld.d clamav ksmbd.lock resolv.conf sysinfo
bird4.conf clamd.log lib resolv.conf.d tmp
bird4.err collectd.conf lock rrd trm_runtime.json
bird4.log dawn_mac_list log run xinetd.d
bird6.conf dhcp.leases luci-indexcache.JCPTyAyF8O1OsRXUxgo73..json ser2net.conf yggdrasil.conf
bird6.err dnsmasq.d luci-indexcache.o6D2Ibzb8FV8aQLo1KmJT..lua shm

tmp is a partition in the RAM, and it is there for the running configs, so this is probably okay.

What is the output of:

mount
df -h

Here is the output of df -h

root@OpenWrt:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 4.0M 4.0M 0 100% /rom
tmpfs 59.7M 8.4M 51.3M 14% /tmp
/dev/sda2 1.5G 214.4M 1.2G 15% /overlay
overlayfs:/overlay 1.5G 214.4M 1.2G 15% /
tmpfs 512.0K 0 512.0K 0% /dev

This is your overlay. It appears to be a 1.2GB volume on /dev/sda2.

Your extroot is working properly.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.