🛠 Exploiter les 32 Go d'eMMC d'un CM3+ après flash

Raspberry Pi Compute Module 3+ (CM3+ / CM3+ Lite) · debutant · Schéma : un module CM3+ avec sa puce eMMC 32 Go, illustré par deux barres de stockage : l'image système de 2 Go occupant une petite partie, et l'espace non alloué grisé à étendre.

Objectives

Raspberry Pi OS images are written "to the letter" (~2 GB): flashed onto the 8/16/32/64 GB eMMC of a CM3+, they leave most of the storage unallocated. This tutorial extends the root partition and file system to utilize the entire chip, then sets up trim (fstrim) to preserve the eMMC's lifespan — as no official endurance data is published by Raspberry Pi, we apply best practices. Note: The CM3+ Lite does not have an eMMC, so this tutorial does not apply to it.

Hardware

Complete code

# 1. État initial : la racine est bien plus petite que le disque
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT    # mmcblk0 ~32 Go, mmcblk0p2 ~2 Go

growpart /dev/mmcblk0 2               # étend la partition 2 jusqu'à la fin
sudo reboot

# 2. Étendre le système de fichiers (ext4)
sudo resize2fs /dev/mmcblk0p2
df -h /                               # la racine occupe désormais ~32 Go

# 3. Trim périodique pour la santé de l'eMMC
systemctl status fstrim.timer || sudo systemctl enable --now fstrim.timer

# 4. (Optionnel) Méthode tout-en-un via raspi-config :
sudo raspi-config --expand-rootfs && sudo reboot

Expected verification

After growpart + resize2fs (or raspi-config --expand-rootfs), df -h / displays a root of approximately 32 GB with several GB available. lsblk shows mmcblk0p2 at the disk size. systemctl list-timers | grep fstrim confirms the periodic trim execution.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials