Operating System - HP-UX
1833784 Members
5103 Online
110063 Solutions
New Discussion

/usr directory deleted how to recover.

 
SOLVED
Go to solution
Mubarak Rebhan
Occasional Advisor

/usr directory deleted how to recover.

One of our admins has accidentally deleted the /usr directory:
(1) How can we recover from this situation specially that we can not logon to the system??
(2) What are possible impacts on our SAP application on the system??

Please help.
10 REPLIES 10
harry d brown jr
Honored Contributor

Re: /usr directory deleted how to recover.

TAPE backup is the ONLY way!


live free or die
harry
Live Free or Die
harry d brown jr
Honored Contributor
Solution

Re: /usr directory deleted how to recover.

You need to HALT your machine immediately.

Get your recovery tapes out.

Boot into single user mode.

restore /usr if possible, otherwise recover root.

Impact to SAP will be that it won't be running for a few hours, like at least FOUR!!!

live free or die
harry
Live Free or Die
Trond Haugen
Honored Contributor

Re: /usr directory deleted how to recover.

In adittion to what Harry expleined; If you can't log on and don't have a have a shell you can do su from your only option is to hit the switch. In which case I guess you will not be able to gracefully halt SAP. :-(

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Dirk Wiedemann
Respected Contributor

Re: /usr directory deleted how to recover.

Hello

afaik: without /usr/lib you nearly can't do anything. Even simple commands like cp, ln, mv or so need the libs in /usr. I'm not sure about the possibility, to restart your system in single user mode.
If nothing else possibel:
- boot your system from the last ignite-tape, interrupt the automated recover process and interactivly recover only the lvol with the /usr directory. After that you should be able to boot your system.
- if you haven't an ignite tape: boot your system from the Support Plus cdrom, do not interact with IPL and select "Run a recovery shell".

good luck
harry d brown jr
Honored Contributor

Re: /usr directory deleted how to recover.

Fortunately a lot of commands have STATICALLY linked commands in /sbin, so you don't really need /usr to recover


live free or die
harry
Live Free or Die
Dirk Wiedemann
Respected Contributor

Re: /usr directory deleted how to recover.

hello harry,

that was my estimation, too. But a time ago i wanted to move the /usr/lib to another lv and create a link. So I have moved /usr/lib to /usr/lib.bak and than died. I couldn't do absolutly nothing, always errormessage to /usr/lib/dld.sl.
My PATH-variable for root looks always first in /sbin and so i have thought the static-linked commands must work.

What's my mistake?

thanks, Dirk


pap
Respected Contributor

Re: /usr directory deleted how to recover.

Hi,
You can do following.

1. boot the system in single user mode.
2. restore the /usr directory from backup.

If your running system is on the network, just copy /usr from any other similar HP server temporarily and try to recover the /usr from backup. You can restore /usr directory from other server using rcp.

Hope this helps as rcp resides in /bin.

-pap
"Winners don't do different things , they do things differently"
MANOJ SRIVASTAVA
Honored Contributor

Re: /usr directory deleted how to recover.

Hi

DO u have ignite , the amy be you can just run ercovery from there or reload the OS , this if is recent thne wont impact anything.


Manoj Srivastava
Mubarak Rebhan
Occasional Advisor

Re: /usr directory deleted how to recover.

We do have ignite and we are using that to recover. I will update you with thre results.

Thanks to all of you.
Pete Randall
Outstanding Contributor

Re: /usr directory deleted how to recover.

When you're done recovering, I've got a pair of cast iron mittens you can borrow for the admin that deleted /usr. Let me know if you'd like to borrow them - they really slow down typing to the point where he can think about what he's doing before he does it.

Pete

Pete