How to prevent data corruption during image installation with sysupgrade on X86

Hi all,

I am using openwrt on X86 platform.
I implement the boot via UEFI and I used for this image the ext4 filesystem.

I am trying to think about how to implement a mechanism to prevent data corruption during sysupgrade flashing process.
This problem can happen for example when the platform is accidentally powered off during sysupgrade.

The current platform has one EMMC device and no other disk.

So the first implementation I though was to keep the current partitions and create new ones after the first partitions block and boot up on the new flashed block via grub configuration.

But I would like to know if someone think about an other concept.
Does someone have an idea ?

Thanks in advance

2 Likes

I already integrate these bunch of modifications to support EFI in my branches.
I probably need a robust mechanism to avoid system lost after a power off during sysupgrade.

Any thoughts ?

UPS should do the trick

1 Like

Unfortunately, there is no UPS.
It is an embedded system.
Power supply failure can happen.

If you are seraching for a robust solution, then get a UPS.

You could create two partitions. Before update you clone the active system to the 2nd partition, update it and if successful change the grub default entry to the 2nd partition. Next time doing the same with 1st partition.

I personally use a 2nd partition (independent OpenWrt instance) to always update the 1st one (no overlayfs/pure ext4).

2 Likes

Hi HectoPascal,

That is what I thought to do.
But I tried to see by posting this question on this forum, that an other solution.

Thanks for your help