Resizing Root Partiton


I'm running LEDE in a x86_64 machine working great.
My internal HD has 30 Gb. and each time I sysupgrade LEDE, my rootfs goes to 256 Mb.

root@LEDE:~# fdisk -l
Disk /dev/sda: 29.3 GiB, 31488000000 bytes, 61500000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x49843315

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 512 33279 32768 16M 83 Linux
/dev/sda2 33792 558079 524288 256M 83 Linux

To resize again to 30 Gb. I've to boot from USB using any distribution and resize the partition /dev/sda2 using fdisk + resize2fs tools.

Is there any way to sysupgrade LEDE without changing the partitions size?


It's likely because buildbot is using the default partition size in menuconfig, which is 256MB.

There may be another way to workaround this, but a sure fire way would be to simply build your own images and change the partition size in menuconfig

You may be able to take the rootfs tar from the build and extract it to an empty pre-formatted partition.

When the build creates an image, the rootfs is handled as a file filled with zeros in the empty space. Making that a .gz compresses the zeros to practically no size for distribution. But the filesystem size must be limited because the machine used for flashing needs to have space for that file when it is unzipped.

Ok!! Thanks everyone!!

Will be great to upgrade via sysupgrade preserving the current size partitions, maybe in future versions will be posible.

Once again, thanks everyone for your help and info!!!