CoreMP135 partition expansion

1.In order to adapt to different MicroSD card capacities and speed up firmware burning, the root file system partition of the image will not completely fill all the capacity. You can refer to the following fdisk command to achieve expansion. For M5_CoreMP135_debian12_20240507/M5_CoreMP135_buildroot_20240508 or above, the resize_mmc.sh expansion script is provided in the /usr/local/m5stack path, which can be directly executed for automatic expansion, and then restarted.

1.View partition

fdisk /dev/mmcblk0

# View the current partition
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

2.Rebuild partition

1.Use the d command to delete partition No.10

Command (m for help): d
Partition number (1-10, default 10): 10

Partition 10 has been deleted.

2.Create the partition again, Note: The First sector address of the new partition needs to be consistent with the original partition information (183330), otherwise data will be lost.When prompted whether to remove the existing partition mark, 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 an ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: n

3.Save changes

1.Enter the command p to view the new partition information, and enter the command w to write and save.

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.Capacity expansion completed

5.Use the resize2fs command to update the file system size, and then restart the device to complete the expansion.

resize2fs -f /dev/mmcblk0p10
On This Page