Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
cancel
Showing results for 
Search instead for 
Did you mean: 

restore library file

SOLVED
Go to solution
Randy_9
Regular Advisor

restore library file

When restoring my system, I could not get the most recent copy of /usr/lib/libc.2 restored. The file is always busy, I tried it in single user mode (after I had copied the file to a temporary directory I created in /usr. While the system was in single-user mode I mounted /usr and tried to move it, but got the "file busy" message. How can I resolve this?

Thanks,

Randy
10 REPLIES
Clemens van Everdingen
Honored Contributor

Re: restore library file

Hi,

I have been thinking on this one.... hmmmm....

Idea...
1. Restore libc.2 in some temp dir.
2. Boot from hp-ux install cd into recovery mode
3. Hopefully now it's not busy/in use.
4. Try to access disc and copy recovered file into place.
5. Reboot system.

Never tried this before, but might be the solution. So no warranty :)

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
John Poff
Honored Contributor

Re: restore library file

Hi,

I think Clemens probably has it right. That file gets opened by just about everything in the world so you'd have a real tough time replacing it on a running system.

I'm curious, why do you need to restore that file?

JP
A. Clay Stephenson
Acclaimed Contributor

Re: restore library file

Your fundamental problem is that you are using cp (and guess what? - it needs libc). The 'trick' is to use statically linked utilities (those in sbin).

1) While you are in multi-user mode copy your new version to a file in /usr/lib/. e.g. /usr/lib/libc.2.tmp

2) Shutdown and boot in single-user mode.

3) mount /usr

4) /sbin/mv /usr/lib/libc.2.tmp /usr/lib/libc.2

5) umount /usr

6) sync; sync; sync

7) Reboot in normal fashion.
If it ain't broke, I can fix that.
Clemens van Everdingen
Honored Contributor

Re: restore library file

Hi,

Clay gave as usual the best possible answer.
I didn't think of that. :(

C.
The computer is a great invention, there are as many mistakes as ever, but they are nobody's fault !
Randy_9
Regular Advisor

Re: restore library file

My reason for wanting to replace the current one? because my last backup of it is different than that on the "make_rec_tape". I think I
am left to Clemens idea, I did
try the steps Clay mentioned and the little bugger was still busy. I created a /usr/park directory and restored the more recent version there, then in single
user mode I had mounted /usr
and tried to move it (/sbin/mv) and got the error
message. Do you think I really
need to replace it, even though it is a bit different
in size.

Thanks all,

Randy
John Poff
Honored Contributor

Re: restore library file

Randy,

I'd be a little hesitant to replace that file. It probably just gets updated when you load patches from HP. My guess is that you might have loaded a patch in between your last backup and your "make_rec_tape". Can you post the two different file sizes you are seeing? Have you patched the system recently?

JP
James R. Ferguson
Acclaimed Contributor

Re: restore library file

Hi Randy:

The only sure way to operate in single-user mode is to *boot into* it so that no filesystems get mounted and executables in those filesystems aren't ever run. Transitioning downward with 'init' is unlikely to work in situations like yours.

Regards!

...JRF...
Randy_9
Regular Advisor

Re: restore library file

John,
Yes I did install some patches
during that period. Do you think I should still hold off?.

James,
I did "boot-into" into single-user mode and mounted /usr.
Your point is well taken.

Thanks,

Randy
John Poff
Honored Contributor
Solution

Re: restore library file

Randy,

If you aren't having any specific problems with that library, I wouldn't replace the file. It probably was updated by one of the patches you loaded, and if you put back the older file you might have some problems with other programs that might rely on the updated libc.2 file. My philosophy is, don't fix it if it isn't broken. :)

JP
Randy_9
Regular Advisor

Re: restore library file

John,

I'll follow your advice.

Thanks,

Randy