Workaround for dirty filesystem (and delta updates)

There are occasions where a quick fix is needed in the read-only partition and going through the standard release takes more time than we can afford. Remounting as read-write and patching the code is the quick and dirty solution but as we use differential (delta) updates, a dirty fs blocks future delta updates of course. We thought of a workaround and we would like your feedback on this.
Assume the machine has p2 as active partition and p3 as inactive. Runs mender 2.6.1 and artifact v1 that needs patching which will be later released as v2. Here are the suggested steps:

  1. dd p2 to p3
  2. Remount p2 as rw and change anything needs changing
  3. When we need to deploy v2 (set mender_boot_part, mender_boot_part_hex and upgrade_available) reboot to p3
  4. Initiate delta update v1-to-v2 from mender cloud

We expect to reboot back to p2 with v2 clean filesystem. Are we missing something?

@valeria could you give us a hand here please?

1 Like

I think this should work. A notable consequence is that you will be temporarily running without the quick fix in p3 while the deployment is happening, but if this is ok I see no reason this wouldn’t work.

I did try a little bit and realised that the mender db getting in the way so the complete list of steps are below:

  • stop mender service
  • dd active to inactive partition
  • take a copy of mender db
  • boot to inactive
  • dirty it

When its time to deploy the new release:

  • stop mender
  • overwrite db with the above copy
  • boot to old active
  • send mender cloud update

It seems to work fine so far. This is a lifesaver