Prevent sysupgrade to shrink partition size

Did an sysupgrade from 22.03.0-rc5 -> 22.03.0-rc6 ... no the disk space is shrinked from 32GB to 100 MB :frowning:

Any way to prevent this?

Thanks a lot
meg

create your own image, or extend it, again.

2 Likes

Yes you have only to build your own, if you use the (very useful) online builder you will see your root partition resized to 100MB.

And I tried to extend it again but I got an error from the microSD after 1-2 time. But i was trying squashFS maybe with ext4 is different

Info: Force to fix corruption
Magic Mismatch, valid (0xf2f52010) - read (0x6320)
Can't find a valid F2FS superblock at 0x0
Magic Mismatch, valid (xf2f52010) - read (0x2005)
Can't find a valid F2FS superblock at 0x1

Anyway now I’m living with 100mb, it’s easier and I’m using few MB for the packages and nothing else.

yeah, but I would not expect, that an update (no major, no minor, just a bugfix) would reset partion layout. resizing is possible, but do not want to do it after each micro release... this seems not practicable.

Yes but when you build your image you can choose the size you want, by default it’s 100MB, so the online builder make it also 100MB.

It would be nice to have an option to choose the size, like the packages.

But anyway you don’t need it more than 100mb for install packages and other OpenWrt things. And if you need other space you can create another partition but in the end I prefer not to use the microSD with the OS as storage (due to the wear), I’m using an attached USB drive to save all the data I need. Safer and easier.

I see that rc6 provided Attended Sysupgrade ... maybe this already solving this issue?

No. As @giuliomagnifico pointed out you need to recompile.

sysupgrade will only mess with your partitions, if the partitions on disk are different sizes from the partitions in the image.

Instead of expanding the root partition, you should create a new partition and put all your persistent data in there. That partition wont exist in the image and sysupgrade wont touch it, unless the other partitions change between releases. Make sure you keep backups, because that could happen.

2 Likes

The primary take home from this would be not to use the whole remainder of your disk for the overlay. Just extend it enough to hold your additionally installed packages comfortably (and if you need more than 20-25 MB for that, you're doing something wrong - it's a router, not a general purpose server). Put the data into a new/ additional, dedicated partition and mount it where you need it (e.g. /srv/).

This solves two things, the additional partition will be left alone - and your sysupgrade won't take ages (as the overlay, which is always written out in its entirety, remains small - faster to write than 32 GB).

3 Likes