Extroot configuration across sysupgrades?

I have a question that is OT, but only related to using snapshots.

For those on the SNAPSHOT as we all are, I have a problem you can help me with.
I have a 64GB USB drive attached to my router, which I use for file sharing (some media).
I configured EXTROOT on this drive so that the router can also take advantage of the storage. So I configured extroot in a pretty standard way:

DEVICE="/dev/sda1"
mkfs.ext4 -L extroot ${DEVICE}

eval $(block info ${DEVICE} | grep -o -e "UUID=\S*")
uci -q delete fstab.overlay
uci set fstab.overlay="mount"
uci set fstab.overlay.uuid="${UUID}"
uci set fstab.overlay.target="/overlay"
uci commit fstab

mount ${DEVICE} /mnt
tar -C /overlay -cvf - . | tar -C /mnt -xf -

After rebooting, I am able to access all this storage as expected.
However, every time I flash a new snapshot image, this EXTROOT config goes away and I have to reestablish it (by wiping again!).
I always "keep config" when applying a snapshot, but my EXTROOT config always goes away :frowning:

Is there a way to preserve the same config across these updates?

I don't know if this is what you are looking for: /etc/sysupgrade.conf contains the files preserved when using sysupgrade.

I know about /etc/sysupgrade.conf, but what should I put in there?

the directories and files you want to preserve during a sysupgrade ...

Extroot cannot be preserved across sysupgrades (regardless if it is snapshot or stable).

My personal workflow is to make a backup of the working configuration and then reboot with the extroot disk removed. From there, I run the sysupgrade and install the packages required to run the extroot process (you can also build your own image with those packages included). I actually take the extra step to erase the extroot drive just prior running the pivot-to-extroot process (just to ensure that no junk gets left behind), and then I install all my packages (I have them in a list for easy installation), and finally I restore my backup.

There are alternative methods to do this, but fundamentally, you have to repeat the extroot process each time you do a sysupgrade.

1 Like

Is it possible with attended sysupgrade, to preserve all the packages?

No. The reason is simple: ASU creates a monolithic firmware image with all of the packages pre installed. This would need to be installed on the base (embedded) storage, not the external storage.

4 Likes

I assume you do the steps 2 and 4 from the extroot guide (https://openwrt.org/docs/guide-user/additional-software/extroot_configuration) after the Firmware Upgrade? I assume the fstab config is preserved or is this the reason why you restore the backup?

Thanks!

I actually repeat the entire process for extroot, and I even erase all the files on the external media before doing so.

I could build a custom image with the extroot related packages pre-installed (or use ASU for this part), but I just go fresh each time. It is easy enough since I have scripts to do most of this for me.

1 Like