Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
rescue needed: corrupted /lib/libc.so.6
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
erickfour
n00b
n00b


Joined: 16 Dec 2004
Posts: 32
Location: christchurch, NZ

PostPosted: Thu Dec 14, 2006 7:07 pm    Post subject: rescue needed: corrupted /lib/libc.so.6 Reply with quote

For reasons I'm not going to go into here, I no longer have a working /lib/libc.so.6. Is there anything to be done besides a complete reinstall? I can't chroot in to re-emerge it... help!


thanks,

e
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54387
Location: 56N 3W

PostPosted: Thu Dec 14, 2006 8:09 pm    Post subject: Reply with quote

erickfour,

You need a working glibc of the same version as you broke for your arch, or a compatible one.
I have some but no 64 bit ones.

When you have the binary package tarball, you boot with the liveCD, mount your partitions and get the tarball into /mnt/gentoo.
After you untar it there, you should be back in business.

The first thing you do after that is emerge glibc.

You may find that
Code:
chroot /mnt/gentoo /bin/busybox
still works. It depends how your busybox was made.
Unfortunately, gcc depends on glibc, so emerge will still be broken
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
erickfour
n00b
n00b


Joined: 16 Dec 2004
Posts: 32
Location: christchurch, NZ

PostPosted: Thu Dec 14, 2006 8:22 pm    Post subject: Reply with quote

Thanks for the advice, NeddySeagoon.

I need a glibc 2.3.6 (for a PIII). I have another gentoo box with a more up to date profile that has a glibc 2.4. Could I temporarily change the profile to something without nptl, make a package, then move it over? Also, I've never installed something directly from a package tarball... are there some dox for that or will it be obvious?

I'm now trying to tread delicately so not to screw up another computer!

e
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54387
Location: 56N 3W

PostPosted: Thu Dec 14, 2006 10:29 pm    Post subject: Reply with quote

erickfour,

I'm not having a lot of luck posting this ... I had an emerge running in the background (3 times now).
It drank all the beer in my fridge and filled up all of memory and swap, causing me to loose my post.
Thats life with ~x86 sometimes.

Anyway - back to yor problem. I don't have a glibc that will suit you. When you get one, you untar it like a stage tarball. tar xjpvf <file> in the root of your normal install. Thats /mnt/gentoo when you boot the liveCD and mount your partitions.

You can get a glibc out of a stage 3, or make one to suit as follows. You will need space to untar a stage 3 and a little bit more.

Boot the liveCD, mount your filesystems and your swap.
Make a new dir at say /mnt/gentoo/newdir
Put a stage 3 tarball into /mnt/gentoo/newdir and untar it there.
mount your /proc and /dev onto the /mnt/gentoo/newdir/proc and /mnt/gentoo/newdir/dev
Check that /mnt/gentoo/newdir/usr/portage exists and make it if not
bind mount your real /usr/portage there, it saves getting a snapshot.
mount -o bind /mnt/gentoo/usr/portage /mnt/gentoo/newdir/usr/portage
copy your /etc/resolv.conf to mnt/gentoo/newdir/etc/resolv.conf, or yor network wont work shortly.
You now have a stage 3, in newdir thats ready to be chrooted into.
Do it with
Code:
chroot /mnt/gentoo/newdir /bin/bash
and run the three environmant settings from the handbook.

Other than the extra bind mount to use your own /usr/portage and the location, its all standard recovery stuff, as detailed here

Now you are in a working system with a working glibc, you can run
Code:
quickpkg glibc
if your stage 3 has the right version. You may need to
Code:
emerge gentoolkit
, if its not in the stage 3.
If your need to make a glibc, you can and quickpkg it afterwards.

quickpkg leaves packages in /usr/portage/packages/All/..., which is very handy, as thats your real portage tree too (remember the bind mount ?)

Exit the chroot, or in another VT, copy the package tarball to /mnt/gentoo and untar it there.
Code:
tar xjpvf <file>

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
erickfour
n00b
n00b


Joined: 16 Dec 2004
Posts: 32
Location: christchurch, NZ

PostPosted: Thu Dec 14, 2006 11:12 pm    Post subject: Reply with quote

Neddy--

Awesome! OK, now my system is mostly back to normal.

There is one rather embarassing problem to fix. In a true shooting-self-in-foot moment, previous to the total corruption of libc.so.6, I added glibc to package.unmask, then emerged glibc-2.4. Ook! Now that i'm back to 2.3.6, I get the error message

Code:
find: /lib/tls/libc.so.6: version 'GLIBC_2.4' not found (required by find)


when I try to restart eth0.

thanks a ton. i feel very very stoopid.


e
Back to top
View user's profile Send private message
erickfour
n00b
n00b


Joined: 16 Dec 2004
Posts: 32
Location: christchurch, NZ

PostPosted: Fri Dec 15, 2006 12:22 am    Post subject: Wahoo! Reply with quote

after a bit more fudging about, i'm back to normal.

Neddy-- THANK YOU! People like you make gentoo possible for people like me (who occasionally do very stupid things).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum