[SOLVED] Is it possible to Shrink a partition without breaking OpenWrt?

After installing Openwork on an SSD of 240GB, it became obvious that 240GB is a lot of disk space lost. I<d like to claim it back for other uses.
So I would like to revert the enlargement process by shrinking back the partition to a more reasonable size like 500MB.
I found this Topic answer from NC1 that propose a procedure to extent a partition.
NC1 extending partition

The Question: Can this procedure be applied also for shrinking the partition ?
Assuming that no useful data be present in the removed area, of course.
Or, is there another more appropriate approach ?

This is an assumption that will be difficult to validate before shrinking the partition. Yes, if no useful data is there, it should theoretically be safe, but you should just assume that this will be a destructive operation.

Therefore, my recommendation would be to make a backup of your configs, and ensure that you know what packages need to be installed system for proper functionality. Then, just go ahead and wipeout the whole system. Delete the partition entirely and create a new table with the partitions sized as you want. Then reinstall OpenWrt (possibly with the packages pre-installed using the image builder), repeat the expansion if necessary to fill the partition size you want, and restore your config.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.