Recover corrupt Raspberry pi sd card
William McKeehan
William McKeehan
September 4, 2022

Recover corrupt Raspberry pi sd card

Recover corrupt Raspberry pi sd card

Get a new SDCard and a USB reader. Etch a copy of Raspbian Lite on the new card. Boot that.

Mount the broken system in a USB reader. Mount the USB reader in your RPi.

Open a command line and use sudo -s to get a root shell.

Run these commands for i in a1 a2 a5 a6; do umount /dev/sd$i; fsck -f -y /dev/sd$i; done

mount /dev/sda2 /mnt or mount /dev/sda6 (if NOOBS)

mount /dev/sda1 /mnt/boot or mount /dev/sda5 /mnt/boot (if NOOBS)

mount -o bind /dev /mnt/dev

mount -o bind /sys /mnt/sys

mount -t proc /proc /mnt/proc

cd /mnt; chroot . (note the trailing full stop)

apt update; apt install --reinstall raspberrypi-kernel raspberrypi-bootloader

exit

poweroff