ozwoz
Posts: 2
Joined: Wed Oct 25, 2017 8:23 am

code to replace kernel.img after Rpi 3 crash

Wed Oct 25, 2017 9:05 am

My raspberrry pi 3 powered down in the midst of a remote update and now has the 7 green light problem and wont boot.
I 'd like to get it up and running as it has apps on it that I don't want to lose.
In the closed topic opened by tpylkko on March 24 2017 called 'Manually place kernel.img on boot partition ' dougielawson posted:

It's not that simple. But you can repair things on your RPi if you have (or can make) a second bootable SDCard.

Get your second SDCard with Jessie and boot your RPi from that. Get your "broken" SDCard in a USB reader, insert that in your RPi.

for i in /dev/sda*;do sudo umount $i; done
sudo mount /dev/sda2 /mnt
sudo mount /dev/sda1 /mnt/boot
sudo mount -o bind /dev /mnt/dev
sudo mount -o bind /sys /mnt/sys
sudo mount -t proc proc /mnt/proc
cd /mnt
sudo chroot .
sudo rpi-update
exit
cd /
for i in t/boot t/dev t/sys t/proc t; do umount /mn$i; done
poweroff
Swap cards and reboot. That will get you a 4.9.16 kernel on your broken SDCard.


If I follow this advice above will my data on the broken SDcard be wiped or will just the bootcode, kernel and /lib/modules be changed?

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: code to replace kernel.img after Rpi 3 crash

Thu Oct 26, 2017 10:53 pm

That should still work. You'll get a 4.9.58 #1046 kernel and matching bootcode.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Beginners”