🛠 Boot sur SD/USB et procédure de recouvrement

Raspberry Pi 3 Model B (model-3b) · avance · Schéma : IMG-model-3b-avance-1-model3b-boot-sd-usb-recouvrement.svg — chaîne de boot du Pi 3B : ROM du SoC, bootcode.bin et start.elf sur la partition FAT de la microSD ou du disque USB, bit OTP program_usb_boot_mode activé une fois pour toutes

Objectives

Understand the boot chain of the Raspberry Pi 3 Model B (SoC ROM → files on FAT partition → Linux kernel), boot from a USB mass storage device, and know how to restore a card after a corrupted image. Specificity of the 3B: no updatable boot EEPROM (unlike the 3B+/4); USB boot exists but booting from host is disabled by default and enabled by a permanent OTP bit.

Hardware

Complete code

# 1) Démarrer sur SD, puis activer le boot USB (OTP PERMANENT, irréversible)
echo 'program_usb_boot_mode=1' | sudo tee -a /boot/firmware/config.txt
sudo reboot
sudo vcgencmd otp_dump | grep 17:   # doit afficher 17:3020000a
# Penser à retirer la ligne de config.txt après le redémarrage.

# 2) Copier le contenu de la SD vers le disque USB
sudo apt install -y rsync
sudo rsync -aax --exclude '/dev' --exclude '/proc' --exclude '/sys' \
     /media/$USER/rootfs/ /media/$USER/usbdrive/
# Adapter /etc/fstab du disque (root=PARTUUID...) puis éteindre proprement.

# 3) Tester sans SD : le Pi doit booter sur l'USB.

# 4) Recouvrement : carte SD illisible ou config.txt cassée
#    a) dépannage léger : monter la partition FAT sur le PC, éditer config.txt,
#       retirer dtoverlay/over_voltage suspects, rajouter « initramfs » si besoin
#    b) solution radicale : réécrire Raspberry Pi OS avec Imager,
#       puis restaurer la partition home depuis une sauvegarde.

Expected verification

After enabling OTP, vcgencmd otp_dump | grep 17: returns 17:3020000a and the Pi boots from USB without any SD card inserted. The disk activity LED blinks during boot. In case of a deliberately broken config.txt (bad dtoverlay), mounting the FAT partition from a computer allows you to fix the file and reboot normally — the Pi comes back to life without rewriting.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials