[GL-MT6000] Possible to permanently resize rootfs partition on eMMC?

I have an OpenWrt snapshot I built installed on my GL-MT6000 and want to resize the rootfs partition /dev/mmcblk0p7 from the current 7.2G to something smaller like 0.5G. The purpose is so that I can partition the remaining ~6.7G for a data partition.

How can I go about doing this and will it create issues down the road for me? I never want the rootfs partition to change size-wise and I will be running snapshots from OpenWrt.

Thank you.

# fdisk -l
Disk /dev/loop0: 7.23 GiB, 7758151680 bytes, 15152640 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
The backup GPT table is not on the end of the device.


Disk /dev/mmcblk0: 7.28 GiB, 7818182656 bytes, 15269888 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: gpt
Disk identifier: xxx

Device         Start      End  Sectors  Size Type
/dev/mmcblk0p1  8192     9215     1024  512K Linux filesystem
/dev/mmcblk0p2  9216    13311     4096    2M Linux filesystem
/dev/mmcblk0p3 13312    17407     4096    2M Linux filesystem
/dev/mmcblk0p4 17408    21503     4096    2M Linux filesystem
/dev/mmcblk0p5 21504    25599     4096    2M Linux filesystem
/dev/mmcblk0p6 25600    91135    65536   32M Linux filesystem
/dev/mmcblk0p7 91136 15269887 15178752  7.2G Linux filesystem
1 Like