🛠 Booter sur NVMe/USB et procédure de recouvrement
Objectives
The Pi 4B is the first flagship Pi with an embedded SPI boot EEPROM: boot from USB/NVMe, network boot, customizable boot order, LED codes, and HDMI diagnostics in case of failure. This tutorial migrates the system to an SSD and then documents the recovery procedure.
Hardware
- Raspberry Pi 4B, NVMe SSD + USB 3.0 enclosure/adapter
- >
- microSD card for the EEPROM and Raspberry Pi Imager
- 5.1 V 3 A power supply (USB SSDs draw significant power)
Complete Code
# 1) Copier le systeme sur le SSD (Imager : choisir le SSD comme cible)
sudo apt install rpi-eeprom
vcgencmd bootloader_version # date de l'EEPROM
vcgencmd bootloader_config | grep BOOT_ORDER
# 2) Changer l'ordre de boot : 0xf = SD, 0x1 = USB
sudo rpi-eeprom-edit
# dans l'editeur : BOOT_ORDER=0xf41 (SD puis USB, puis reseau)
# sauvegarder : l'utilitaire reprogramme l'EEPROM, puis :
sudo reboot
# 3) Apres boot sur le SSD, verifier :
df -h / ; lsblk
Expected Verification
After removing the microSD card, the Pi boots directly from the SSD (df -h / shows /dev/sda2 or nvme). In case of failure, recovery is simple: inserting a valid SD card with a fixup.dat file forces an EEPROM reflash, or the default BOOT_ORDER falls back to the SD card. The green LED blinking patterns code the failure.
Common Errors
- Overwriting the EEPROM with firmware from another model: use only
rpi-eeprom-updateon an up-to-date OS. - Forgetting the VL805 firmware (driver for the VIA VL805 USB controller): it is versioned separately in the EEPROM; a partial update can disable USB.
- Power-hungry SSD on an unpowered hub: the total USB power budget is capped at 1.2 A.
- Misspelled
BOOT_ORDER: the EEPROM refuses the write, and everything remains unchanged. - Removing the SD card before verifying USB boot: keep a backup SD card.
Other tutorials for this board
Code examples for this board
led_blink.pyPythonbutton_led.pyPythonservo_sweep.pyPythondht_temp.pyPythonoled_i2c.pyPythonmcp3008_read.pyPython