# [Solved] Kernel Panic after removing old version of glibc

## BlakeJob

I'm running the am64 version of this distro.  Recently I found my environment out of whack and started running commands to clean it up.  I had one blocking error that was due to an old version of glibc hanging around (I checked and saw I had two version installed).

I removed the old version (2.3 or earlier I believe -- hard to check now) and the command failed during the emerge -C of it.  I then tried to run other commands but no commands would work (sudo, halt, cp were all broke).  I push the power button to turn it off and then again to turn it back on and receive the following error on all my old kernels (2.6.23, 2.6.29 [current version i'm on][/code]):

```

Kernel panic - not syncing: No init found.  Try passing init= option to kernel.

Clocksource tsc unsatble (delta = 414106947 ns)

atkbd.c: Spurious ACK on isa0060/serio0.  Some program might be trying to access hardware directly

Hangcheck: hangcheck value pas margin!

```

I use a boot cd (install-amd-64-minimal-20100311) and mount my partitions successfully. I've read maybe i need a new kernel so i try to chroot so i can build a new one and unfortunately I get this error

```

chroot: failed to run command `/bin/sh': No such file or directory

```

.

I thought maybe I could use the kernel from the livecd so i copied it (i think i got the right file "/mnt/cdrom/isolinux/gentoo") to my boot partition and modified grub.conf but using that kernel I get an error like the following

```

Kernel panic - not syncing: No init found.  Try passing init= option to kernel.

Pid: 1, comm: swapper Not tained 2.6.31-gentoo-r6

Call Trace:

......

```

Does anyone have any suggestions on how I can bring my system back without a fresh install?  Not only is the kernel in panic, i am t0o  :Smile: Last edited by BlakeJob on Sun Mar 14, 2010 9:43 pm; edited 1 time in total

----------

## NeddySeagoon

BlakeJob,

Lets take the error messages at face value. init is really called /sbin/init do you have that file ?

If you really had two versions of glibc, your system is very confused as glibc is not slotted. I suspect that glibc is damaged.

Go to tinderbox.dev.gentoo.org and get the binary package for glibc.

Untar it like it was a stage3 to the root of your system.  

With your mounts done and from outside the chroot, thats 

```
tar xjpf <tarball_name> -C /mnt/gentoo
```

Ignore the "extra garbage at end of file ignored" warning.

Now try to chroot - using your new glibc.

If that works, build your own glibc

----------

## BlakeJob

Neddy,

Thank you for your quick reply.  I do have /sbin/init.

I'm looking for the binary glibc but I am unable to find it on tinderbox.dev.gentoo.org.  Would you be help point me where to get the binary from that website?  I'm looking around http://tinderbox.dev.gentoo.org/portage/sys-libs/glibc/ but I'm not seeing any tar files to download.

-Blake

----------

## NeddySeagoon

BlakeJob,

Here is the 64 bit sys-libs.

The 32 bit version is in a similar path

You were looking in the ebuilds.

----------

## BlakeJob

I tried the above but was unsuccessful.  It may be that i require further hand holding.

The following are the steps I executed:

booted into windows (I have it setup to dual boot)

downloaded glibc-2.10.1.r1.tbz2

booted with CDROM

mounted root filesystem that I normally boot into when system is working /mnt/normal_root

mounted windows system into /mnt/win

ran tar command exactly as suggested

ignored EOF error

executed chroot "chroot /mnt/normal_root /bin/sh" and continued to receive error stating failed to run /bin/sh

i looked at /mnt/gentoo to see if it had a version chroot I could call but it does not.  Am I missing something?  How would chroot know to use libraries in /mnt/gentoo/?  My guess is your assuming I'm mounting into /mnt/gentoo but if that is what I'm missing I would prefer confirmation before messing my system up even more  :Smile: 

----------

## Hu

 *BlakeJob wrote:*   

> 
> 
> mounted root filesystem that I normally boot into when system is working /mnt/normal_root
> 
> ran tar command exactly as suggested

 

Exactly?  The command posted above assumes that you mounted your broken Gentoo installation at /mnt/gentoo, not at /mnt/normal_root.

 *BlakeJob wrote:*   

> i looked at /mnt/gentoo to see if it had a version chroot I could call but it does not.  Am I missing something?  How would chroot know to use libraries in /mnt/gentoo/?

 The chroot program executes a chroot syscall to set the root to the specified path, then executes a new program in the resulting environment.  Since your system C library is broken, no dynamically linked programs on your system can run, so that executed program fails.  Once you unpack the new C library, then it can be used to run dynamically linked programs in the chroot environment.

----------

## NeddySeagoon

BlakeJob,

ignored EOF error ?

What was the text of the error - as I explained ?

Without exact commands all I can say is it looks ok.

What does

chroot /mnt/normal_root /bin/bash

or 

chroot /mnt/normal_root /bin/bb

do ?

/bin/sh is a symbolic link to /bin/bash, so I would expect the chroot /mnt/normal_root /bin/bash to fail unless the symlink is damaged.

/bin/bb is busybox. Its many of the usual commands in a single binary ... unless you have made it with the static USE flag, it still needs glibc.

----------

## NeddySeagoon

Hu,

Well caught

----------

## BlakeJob

Thank you both, the solution you provided worked!  If you're ever in Rochester, NY USA please let me know and I'll buy you a beer.

----------

