Subj. I don't need extroot anymore, so how to back to defaults?
There are three things that most people would need to do to revert to the conventional, flash-based overlay system.
- Preserve the data on the current extroot device
- Change the flash-based overlay to disable mounting of the extroot
- Restore packages and data that were previously on the extroot device to the restored configuration
The "cleanest" way to do this, in my opinion, would be to cleanly shutdown
the router, remove the extroot "stick" and safeguard it, then flash a new ROM. The re-configure by adding the needed packages and restore data, either by mounting the previous extroot device temporarily (as read-only, for safety) on the OpenWrt box, or on another `nix box and transferring them to the "fresh" OpenWrt box.
Rather than flashing a new ROM, you could boot into "failsafe" mode and remove the configuration related to mounting of the extroot device, typically /etc/config/fstab
if you followed https://openwrt.org/docs/guide-user/additional-software/extroot_configuration.
In either case, after you've removed the mount configuration and rebooted into "normal" configuration, you'll need to install any user-installed packages, as well as copying over your config from the previous file system on the "stick".
Could you please be a little more specific as to how one would complete your Step 3?
I needed to add a swap partition to my config and needed to make space for it on the extroot drive first, so I have taken your suggestions and slightly modified them as follows:
- Shutdown the router with
poweroff
, removed the USB stick (or USB HDD in my case) and used the physical button on the router to boot it up again (i.e. pressed it once to turn the physical switch off, sincepoweroff
was used to shutdown, then pressed it again to boot the router up normally). - Plugged the USB HDD into my PC, booted from a GParted Live USB and resized the extroot partition to the new size that I needed (512 MB just in case you're curious), then created a new swap partition as well.
- Ran
dd if=/dev/sdb1 of=/home/username/backup.img
as your Step 1 suggests, as well asmkswap /dev/sdb2
. - I didn't want to reflash the ROM since it was hard enough the first time (LOL
) so instead I just removed the extroot mount point via LuCI -> System -> Mount Points, then setup extroot again following the instructions in your linked docs page (of course I shutdown my PC and plugged the USB HDD back into the router first).
- Used the same LuCI page to configure mount points for the swap and a few data partitions that are also on the HDD (had to create the mount points first obviously; did this with
mkdir /mnt/ntfs1
andmkdir /mnt/ntfs2
via SSH). - Rebooted the router via LuCI -> System -> Reboot.
All of this seems to have worked like a charm, but how can I now copy the data back to /overlay
from the backup image? MTIA!