Operating System - HP-UX
1823200 Members
3721 Online
109648 Solutions
New Discussion юеВ

/usr/lib/libc.2 deleted, now nothing works. can boot from install cd - how do i replace

 
SOLVED
Go to solution
Fred Ruffe
New Member

/usr/lib/libc.2 deleted, now nothing works. can boot from install cd - how do i replace

hi all

hp d/9000 hpux 11.0

in the course of investigating an issue for a client with "/usr/lib/dld.sl Can't find path for shared library libc.2", our libc.2 file was deleted.

The client problem is now fixed (was cos the s/w had been build on 11 and was attempting to be run on 10.2 which only has libc.1).

However we are left with the issue that our libc.2 file has been deleted. None of the unix commands that deal with files work, all return the error above.

i have tried booting from the install CD, which works ok, but i cannot replace the file as when doing this it appears that the cd is mounted on / therefore making any mount points under this inaccessible.

i'm beginning to think that the only way round is to re-install, which i really don't want to do.

any ideas will be very gratefully rec'd

ta
11 REPLIES 11
John Palmer
Honored Contributor

Re: /usr/lib/libc.2 deleted, now nothing works. can boot from install cd - how do i replace

Hi Fred,

If that's all that's missing, you should be able to boot into single user mode, mount /usr and restore /usr/lib/libc.2 from a backup.

This is one occasion when the Recovery CD isn't required.

Regards,
John
Fred Ruffe
New Member

Re: /usr/lib/libc.2 deleted, now nothing works. can boot from install cd - how do i replace

i wish it were as simple as that.

without this file the system will not boot properly as none of the commands that access a file work, (e.g. mv, cp, cat, more etc.)

all i did was try to replicate the client's problem by setting my LD_LIBRARY_PATH to null. This didn't have any effect so i renamed libc.2 oldlibc.2. this replicated the client's issue, then i tried mv oldlibc.2 libc.2, it didn't work, i tried a cp, it didn't work i tried all sorts, they didn't work. i could no longer start new telnet sessions or log into the console.

the system will not boot properly, as i presume it needs to do file access stuff, if i set the LD_LIBRARY_PATH to another version of the file in /opt/..... then it still doesn't work as the dld.sl must have /usr/lib/libc.2 hardcoded
James R. Ferguson
Acclaimed Contributor

Re: /usr/lib/libc.2 deleted, now nothing works. can boot from install cd - how do i replace

Hi Fred:

I agree with John. Boot up into single user mode; but don't attempt to mount /usr. Rather, use '/sbin/mv' to restore your library.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: /usr/lib/libc.2 deleted, now nothing works. can boot from install cd - how do i replace

You should be able to use the statically linked commands in /sbin. You may not have cp but you do have mv, cat, tar, link, ln, mount, and ls. That should be enough to get you out of the ditch.
If it ain't broke, I can fix that.
Jeff Schussele
Honored Contributor

Re: /usr/lib/libc.2 deleted, now nothing works. can boot from install cd - how do i replace

Hi Fred,

Have you tried to link the file?

ln oldlibc.2 libc.2

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
pap
Respected Contributor

Re: /usr/lib/libc.2 deleted, now nothing works. can boot from install cd - how do i replace

Hi,
You can do following thing.

just "ftp" the required file from other machine running HP-UX 11.0 and put it in to your machine.

You can also use "rcp".
Remember if you use ftp, it will not need your machine to look for any commands if you login from remote machine and put the files in your problematic machine.

If this thing is not working then you need to recover your system using Ignite backup tape.

hope this helps.

-pap
"Winners don't do different things , they do things differently"
John Palmer
Honored Contributor

Re: /usr/lib/libc.2 deleted, now nothing works. can boot from install cd - how do i replace

Fred,

All the programs in /sbin are 'statically linked' and thus don't use shared libraries.

In single-user mode, these are pretty much the only commands that you can use anyway.

If you hadn't rebooted then you could have used /sbin/mv in the first place.

You will have to mount /usr because the file to be restored is in there.

So specifically:

1. Boot to single user mode - interact with ISL and run 'hpux -is'
2. At the shell prompt:
mount /usr
cd /usr/lib
/sbin/mv oldlibc.2 libc.2
3. Run /usr/bin/ls or something to check that all is well
4. Reboot

Regards,
John
Lisa  Mauer
Regular Advisor

Re: /usr/lib/libc.2 deleted, now nothing works. can boot from install cd - how do i replace

I agree with pap as the simplest and quickest solution, just pull that file from a different 11.0 machine. That particular library does not link to anything else so you should be safe in just adding it in. We have done this before and have had no problems.
Fred Ruffe
New Member

Re: /usr/lib/libc.2 deleted, now nothing works. can boot from install cd - how do i replace

hi all

thanks for all your suggestions for far.

unfo. i still have not solved the problem.

i cannot ftp cos the machine will not start or accept ftp connections.

the machine will not start in single user mode due to being unable to find /stand/vmunix

i can only boot the machine from the hp-ux 11 install cd, this does not let me mount any of the file systems, due to a /dev/rdsk/c1t5d0 must be a block device error.

the only thing i can think of is to reinstall hp-ux

cheers

fr
John Palmer
Honored Contributor
Solution

Re: /usr/lib/libc.2 deleted, now nothing works. can boot from install cd - how do i replace

Fred,

I thought that all you'd changed was the name of a library ;??)

See this recent thread for instructions on how to use the Recovery CD.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x4e847d4cf554d611abdb0090277a778c,00.html

What happened to the kernel?

Regards,
John
Fred Ruffe
New Member

Re: /usr/lib/libc.2 deleted, now nothing works. can boot from install cd - how do i replace

John

you are a star!!

the link you provided helped me use chroot_lvmdisk to get the system up in single user mode (think the kernel was not accesible as the system was booted from the recovery CD).

from there i used your previous post to use the statically linked /sbin commands to mv the libc.2 library

am happy, and can now enjoy the long bank holiday instead of being at work.

thanks again

fr