Reverting extroot config to normal overlay config

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.

  1. Preserve the data on the current extroot device
  2. Change the flash-based overlay to disable mounting of the extroot
  3. 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

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:

  1. 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, since poweroff was used to shutdown, then pressed it again to boot the router up normally).
  2. 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.
  3. Ran dd if=/dev/sdb1 of=/home/username/backup.img as your Step 1 suggests, as well as mkswap /dev/sdb2.
  4. I didn't want to reflash the ROM since it was hard enough the first time (LOL :stuck_out_tongue:) 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).
  5. 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 and mkdir /mnt/ntfs2 via SSH).
  6. 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! :smiley: