deleted /boot partition Need to reinstall kernel
I got a virus or something on my linux partition, so I had to reinstall windows, so I did. Then I realized that I had to reinstall grub, so I booted into knoppix and tried to run grub-install /dev/hda3. It didn't work, so I formated my /boot partition not thinking about the fact that my kernel is there. now I need to reinstall it, but i don't know how. I don't have a /usr/src/linux folder.
btw, I'm using a debian based knoppix hd install. |
A virus on your Linux system? Highly unlikely, but there's always the proverbial exception...
Anyway, did you try installing grub as root? (or with the sudo command, provided Knoppix has that. Don't know about that). If all fails, re-installation isn't that difficult, just save your data on the Knoppix system before re-installing. |
Quote:
|
I don't want to have to reinstall. Grub isn't really the big problem, the problem is I deleted my kernel. Does anyone know how to re install it?
|
Is there any package that I can install that has the kernel?
|
OK. This might work or might not. Boot up knoppix on Live cd.
Download the kernel image and the grub package (grub stores a lot of its files on /boot so you need to reinstall that too), assuming you have etch 4.0 you want linux-image-2.6.18-4-zzz and grub As root: Code:
mount -v /dev/hdax /mnt/tmp From inside the chroot, mount all of your other partitions /boot,/var,/usr,/tmp etc. Make sure you have mounted them all. apt will work if you want to set up an internet connection inside chroot, but we already have the debs. So install them with Code:
dpkg -i package1 package2 Code:
grub-install (hd0) |
Yes, open Synaptic and search for kernel or linux as keywords. Either one will give you a suitable kernel. But, that's not all! You also need the tools for making an initrd image and you'll need to make the /boot dir again. I think, given your inexperience, that re-installing Knoppix would be wiser and less time-consuming. It might not be the answer you're looking for because you don't learn anything from that, but for something complicated as this you lack the skills to do it properly. Over time you'll acquire those skills, but for now you're better of as a regular user IMHO.
<edit>@Daws: he's using Knoppix on his harddrive, so no Etch.</edit> |
where do I download the kernel?
|
Quote:
EDIT: Quote:
|
Oh come on Dutch Master, he'll learn a lot and maybe have a bit of fun fixing this! :)
Here are a few things that you may have to do get all the way there if there's not enough in Daws' post. From a knoppix terminal: Code:
su Install grub and run grub-install (hd0) as per Daws. You may also need to install initramfs-tools and run "update-initramfs -u -k all". And let us know on either success or failure. I haven't had to do quite what you're doing, but I've done stuff kinda close, so let us know what works! |
okay, I'm not sure if this has worked yet, but what I did was
mount /dev/hda2 /mnt/root mount /dev/hda4 /mnt/root/boot mount -t proc none /mnt/root/proc chroot /mnt/root apt-get install linux-image-2.6.18-4-386 apt-get install grub right now it says it's generating menu.lst, but it's been doing it for a while. |
This has an easy easy solution. If the only thing you lost was your /boot partition then you are perfectly safe. The /boot partition actually does not hold your kernel, just some vital information about the kernel needed to boot. Your actual kernel is located in /lib/modules/2.6.x - And you should have a .deb package containing your custom kernel in the /usr/src dir. If not, you can download a stock kernel from http://packages.debian.org
1) bootup using the knoppix livecd 2) As Daws said: Quote:
3) Run grub-install Code:
grub-install (hd0) 4) Install your kernel again from the .deb (either the custom one you built in the past, or a new stock from http://packages.debian.org). This step will fill up the /boot partition again with your kernel information and automagically update grub for you. 5) Reboot and take out the livecd to boot to your real system. |
All times are GMT -5. The time now is 12:19 PM. |