Operating System - HP-UX
1748185 Members
4414 Online
108759 Solutions
New Discussion юеВ

Re: /etc accidentally deleted

 
SOLVED
Go to solution
Kuekuatsheu
Advisor

/etc accidentally deleted

The /etc directory was accidentally deleted. how to recover /etc directory from tape with the following situation:
latest ignite:yesterday
media tape:dds3
os:hpux 11.11
uname:HP-UX hostname B.11.11 U 9000/800 1684319383 unlimited-user license

question 1:possible ways to recover /etc directory?
question 2:already used command tar xvf /dev/rmt/0m /etc,still no output?any idea?
11 REPLIES 11
Pete Randall
Outstanding Contributor

Re: /etc accidentally deleted

You need to skip the tape forward to get past the boot headers:

mt fsf /dev/rmt/0mn 1

then you can use tar to extract what you need.


Pete

Pete
Patrick Wallek
Honored Contributor
Solution

Re: /etc accidentally deleted

To recover /etc from a make_tape_recovery_tape. I will assume a tape device of /dev/rmt/0mn. Use your device as appropriate:

# mt -f /dev/rmt/0mn rew

# mt -f /dev/rmt/0mn fsf 1

# cd /

# tar -xvf /dev/rmt/0mn etc

In your example above you used '/etc' as the path to restore. With m_t_r all paths are stored relative to the '/' directory **without** a leading '/'.

To verify this you could do a 'tar -tvf /dev/rmt/0mn' instead of the 'tar -xvf' above.
Kuekuatsheu
Advisor

Re: /etc accidentally deleted

follow up question:only have one back up tape,does it affect(corrupt/damage) the tape from extracting /etc directory?does mt command also have an affect?
Patrick Wallek
Honored Contributor

Re: /etc accidentally deleted

>>does it affect(corrupt/damage) the tape from
>>extracting /etc directory?

NO, you are just **extracting** (reading) data, not writing to the tape.

>>does mt command also have an affect?

NO, mt just repositions the tape. Again it does not write anything.

Bijeesh
Respected Contributor

Re: /etc accidentally deleted

hi
The backup you are taking is to use at critical situation.
Put your last ignite tape to the drive.Issue these commands.

# mt -f /dev/rmt/0mn rew
# mt -f /dev/rmt/0mn fsf 1
# cd /
# tar -xvf /dev/rmt/0m etc

Pete Randall
Outstanding Contributor

Re: /etc accidentally deleted

Just noticed I had a mainframe flashback there. Patrick has the correct syntax. Lord only knows what mine would do - probably nothing.


Pete

Pete
Sherif A. Louis
Valued Contributor

Re: /etc accidentally deleted

hi aquino, in the original post you mentioned it was an "ignite" and in the follow up u mentioned it was a backup!
if it isn't an ignite, let us know what kind of back up it is!
good luck
Kuekuatsheu
Advisor

Re: /etc accidentally deleted

command line used:make_tape_recovery -Av
Sherif A. Louis
Valued Contributor

Re: /etc accidentally deleted

it is an ignite. you will have to follow the procedure as adviced. forward the header tape using the mt command and then extract /etc with tar