repair linux
hello,
while I was using a live cd, I accidentally deleted some files on the hard drive, including apparently the init file. The fact is that linux doesn't start anymore (kernel panic). Can you help me to repair the system please ? Thanks |
Quote:
Which distro are you using? Can you post the exact error you get when booting up (write it down or take a photo of it)? On a separate note, you really should make regular backups of your system. |
if its debian(ish), I think you can just install kernel again from livecd with chroot+apt.
|
It's ubuntu 10.04.
Can you describe in more details how to chroot+apt please ? Thanks |
Quote:
Code:
sudo mkdir /mnt/ubuntu Code:
sudo mount -t proc none /mnt/ubuntu/proc Code:
sudo mount mount --rbind /dev /mnt/ubuntu/dev Code:
sudo cp -L /etc/resolv.conf /mnt/ubuntu/etc/ now chroot Code:
sudo chroot /mnt/ubuntu /bin/bash |
Quote:
Maybe you need to reinstall your distribution. Try this one. Insert a live cd. Click live installation. select Custom partitioning or use the existing partition. Select sda1 to be formatted and not the home partition. then finish the installation. |
Quote:
Quote:
Also, you're posting information that may not apply to the OP, namely the fact that their home partition may NOT be separate from their root...they never mentioned their disk name, ID, or partition structure. You may be telling them to format their home partition, since you don't know how their drive is laid out. Please try to avoid posting information based on pure assumption, and address the OP's question. |
Thanks a lot TB0ne it feels really reassuring to know that some people are here to check whether others mislead you into taking the wrong measures.
Thanks to tailinlinux too though, I'm sure you meant well. This doesn't work though: sudo mount -t proc none /mnt/ubuntu/proc mount: mount point /mnt/ubuntu/proc does not exist And anyway, assuming I manage to chroot like you said, how can I "use apt-get to install kernel" ? |
I also have a recovery mode a other kernel versions in the grub window, does that help ?
|
Quote:
Code:
sudo mount /dev/sda? /mnt/ubuntu Markus |
I see... So when I get there, how to use apt-get to repair the kernel ?
And this doesn't work either: sudo chroot /mnt/ubuntu /bin/bash chroot: cannot run command `/bin/bash': No such file or directory |
referring to an Ubuntu-Wiki in german language the command
Code:
dpkg --get-selections | grep "\binstall" | awk '{print $1}' > /tmp/dpkg.log Code:
sudo xargs -n1 apt-get --reinstall install -y < /tmp/dpkg.log good luck Markus EDIT: I'll append the link: http://wiki.ubuntuusers.de/apt-get |
Quote:
Code:
ls /mnt/ubuntu Markus |
Quote:
|
the chroot command is correct. This should work with every Linux, I've done it often with Slackware. But I suppose the OP has accidentally deleted files in /bin which may cause his problems.
But if this is the case he will indeed have to perform a complete reinstall. Markus |
All times are GMT -5. The time now is 12:32 PM. |