Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I accidently renamed libc library in solaris 10 machine.. commands are not working..IS there any way to restore system back?

share|improve this question
add comment

3 Answers 3

up vote 6 down vote accepted

Use a live CD, mount the partition and rename libc back to its original name.

share|improve this answer
add comment

You don't say which version of solaris 10 -

  • x86 at the grub screen boot Solaris Failsafe. This should mount your existing root filesystem on /a so you can go to /a/lib and rename the file(s) as appropriate.

  • sparc put a Solais Sparc installation CD (DVD) in the drive and from the OK prompt boot -s cdrom. When you get to the miniroot mount your existing filesystem onto the miniroot and then rename the files(s) as appropriate.

share|improve this answer
add comment

I'm not sure if it'll work with solaris' runtime linker, however I've recovered from a similar situation on linux by forcing the runtime linker to load the renamed libc with LD_PRELOAD and then running mv to rename it back to what it was supposed to be. (Man ld.so.1 for solaris does seem to indicate the presence of a LD_PRELOAD environment variable that does what we want)

LD_PRELOAD=/path/to/libc.so.renamed mv /path/to/libc.so.renamed /path/to/libc.so.correct

This assumes you still have a shell on the system.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.