🛠 Boot sur SD, partitions et procédure de recouvrement
Objectives
Understand the atypical boot chain of the Model B Rev 1 and learn how to restore a non-working card. Specifics: no EEPROM and no OTP boot configuration, so no USB boot — the VideoCore ROM loads bootcode.bin directly from the FAT partition of the SD card (standard format, not microSD). Recovery consists of re-flashing the card. You will learn how to write an image, diagnose boot failures via the LEDs, and save your data before re-flashing.
Hardware
- Raspberry Pi Model B Rev 1 + standard SD card (the card's only boot/root storage)
- SD card reader on a PC, Raspberry Pi OS legacy 32-bit (Buster) image
- balenaEtcher / Raspberry Pi Imager /
ddon the PC - A second Linux machine (or another card) for data recovery.
Complete code
# 1) Ecrire l'image sur la SD depuis le PC (verifier le disque !)
sudo dd if=2021-05-07-raspios-buster-armhf.img of=/dev/sdX bs=4M status=progress conv=fsync
sync
# 2) Diagnostic d'un boot qui echoue (LED verte du Pi) :
# eteinte ou clignotements irreguliers = carte lisible mais image invalide
# clignote normalement puis fixe = kernel charge
# 3) Sauver ses donnees AVANT re-flash : monter la partition root
# sur un autre Linux (la partition 2 est ext4)
sudo mount /dev/sdX2 /mnt && cp -r /mnt/home/pi /salvegarde && sudo umount /mnt
# 4) Recouvrement minimal : reecrire seulement la partition FAT de boot
# (bootcode.bin, start.elf, config.txt) si le rootfs est sain
ls /mnt # doit contenir bootcode.bin, start.elf, config.txt, fixup.dat
Expected verification
After re-flashing, the green LED blinks regularly at startup, then the card boots to the desktop/terminal. lsblk on the Pi shows the root partition extended on the first reboot. In case of a dead card: no green LED blinking, test another SD slot and another card.
Common errors
- Attempting a USB boot: explicitly unavailable on the original Pi, unlike recent models with EEPROM.
- Writing the compressed
.img.xzimage instead of the decompressed image (some tools handle this,dddoes not). - Using
/dev/sdXinstead of/dev/sdX1is correct fordd, but an incorrect drive letter will wipe the PC: verify withlsblkbeforehand. - Worn-out SD card: old SD cards from Pi 1s often fail; symptoms = random corrupted files, re-flashing that fixes nothing.
- Modifying
config.txtwith options from recent models (extreme overclocking): the Pi then refuses to boot; remove the SD card and run it on a PC to repair the FAT partition.
Other tutorials for this board
- Allumer une LED via le GPIO avec libgpiod
- Lire un bouton poussoir et afficher l'état dans la console
- Premier script Python : faire clignoter la LED
- Variation d'intensité LED avec le PWM matériel (et son piège)
- Lire un capteur I2C (température/humidité) sur le bus 1
- Configurer l'Ethernet 10/100 et piloter le Pi en SSH
Code examples for this board
led_blink.pyPythonbutton_led.pyPythonservo_sweep.pyPythondht_temp.pyPythonoled_i2c.pyPythonmcp3008_read.pyPython