Page 1 of 1

microSDD is toast and I have root partition backup

Posted: Thu Nov 20, 2025 10:45 pm
by thegrind
Running gentoo on a Rpi5. I had made a backup of my root partition but I didn't have a backup of the boot partition. What is the best way to restore my backup. My original install was with a stage3 file that I have. I compiled a kernel and the headers are in the root directory so I am guessing they don't match the stage3. I am confident the SDD is toast as it just shows as 30MB capacity and it just shows /dev/sdb and none of the other partitions.

Posted: Wed Dec 03, 2025 9:59 pm
by gentoo_ram
There is a Gentoo package called sys-kernel/raspberrypi-image that has the /boot files you're looking for. It has a compiled kernel and modules. I copied the boot partition files from another SDCard which contained a Raspberry Pi OS install on it. That would be another option.

I build my own kernel and modules from the Raspberry PI kernel sources direct from GitHub.

Posted: Wed Dec 03, 2025 10:36 pm
by NeddySeagoon
thegrind,

The kernel that you built will still be in /usr/src
Its modules will still be in /lib/modules.

You will need the GPU files ... see Raspberry Pi Install Guide
Copy the kernel binary, the *.dtb and overlays dir from your kernel build location into /boot

All that's missing now is config.txt and cmdline.txt, which are gone for good, probably.
They will need to be recreated unless you want to try to coax them out of the SD Card?

Posted: Thu Dec 04, 2025 2:35 am
by thegrind
I ended up following the wiki installation guide and used my backup as my stage3. I pulled the kernel over from /usr/src. The problem was is I didn't have the /boot/overlay files. I tried to get them from github but could not find the one for my kernel. I ended up using the current one. then recreated the config.txt and the cmdline.txt file.

I rebooted and my Pi fan stayed on so I figured this wasn't going to work I then just used the latest kernel image and moved the /lib/modules over. Kodi was then crashing on boot. I created a blank profile and this worked so then I had to figure out the plugin causing the issue which turned out to be pvr.simpleiptv. I just recompiled PVR and rebooted. All is working great. Turned out not to be very complicated.