In versions M5_CoreMP135_debian12_20240507/M5_CoreMP135_buildroot_20240508 or later, an expansion script named resize_mmc.sh is provided under the /usr/local/m5stack path. You can execute it directly for automatic expansion, and a reboot is required after completion.
cd /usr/local/m5stack
./resize_mmc.sh Use the core-config tool to perform expansion.
core-config
Follow the steps below to perform expansion using the fdisk command.
fdisk /dev/mmcblk0
# View current partitions
Command (m for help): p
Disk /dev/mmcblk0: 29.72 GiB, 31914983424 bytes, 62333952 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: 7067FB81-6C05-45AC-9375-326E6B8BE20A
Device Start End Sectors Size Type
/dev/mmcblk0p1 34 545 512 256K Linux reserved
/dev/mmcblk0p2 546 1057 512 256K Linux reserved
/dev/mmcblk0p3 1058 1569 512 256K Linux reserved
/dev/mmcblk0p4 1570 2081 512 256K Linux reserved
/dev/mmcblk0p5 2082 10273 8192 4M unknown
/dev/mmcblk0p6 10274 18465 8192 4M unknown
/dev/mmcblk0p7 18466 19489 1024 512K Linux reserved
/dev/mmcblk0p8 19490 150561 131072 64M Linux filesystem
/dev/mmcblk0p9 150562 183329 32768 16M Linux filesystem
/dev/mmcblk0p10 183330 2621406 2438077 1.2G Linux filesystem
1.Use the d command to delete partition #10
Command (m for help): d
Partition number (1-10, default 10): 10
Partition 10 has been deleted. 2.Create a new partition. Note: The First sector address of the new partition must match the original partition (183330), otherwise data loss may occur. When prompted to remove the existing partition signature, select no.
Command (m for help): n
Partition number (10-128, default 10):
First sector (183330-62333918, default 184320): 183330
): t sector, +/-sectors or +/-size{K,M,G,T,P} (183330-62333918, default 62332927)
Created a new partition 10 of type 'Linux filesystem' and of size 29.6 GiB.
Partition #10 contains a ext4 signature.
Do you want to remove the signature? [Y]es/[N]o: n
3.Enter the p command to view the new partition information, then use the w command to write and save the changes.
Command (m for help): p
Disk /dev/mmcblk0: 29.72 GiB, 31914983424 bytes, 62333952 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: 7067FB81-6C05-45AC-9375-326E6B8BE20A
Device Start End Sectors Size Type
/dev/mmcblk0p1 34 545 512 256K Linux reserved
/dev/mmcblk0p2 546 1057 512 256K Linux reserved
/dev/mmcblk0p3 1058 1569 512 256K Linux reserved
/dev/mmcblk0p4 1570 2081 512 256K Linux reserved
/dev/mmcblk0p5 2082 10273 8192 4M unknown
/dev/mmcblk0p6 10274 18465 8192 4M unknown
/dev/mmcblk0p7 18466 19489 1024 512K Linux reserved
/dev/mmcblk0p8 19490 150561 131072 64M Linux filesystem
/dev/mmcblk0p9 150562 183329 32768 16M Linux filesystem
/dev/mmcblk0p10 183330 62332927 62149598 29.6G Linux filesystem
Command (m for help): w
The partition table has been altered.
Syncing disks.
4.Use the resize2fs command to update the filesystem size, then reboot the device to complete the expansion.
resize2fs -f /dev/mmcblk0p10