General
cancel
Showing results for 
Search instead for 
Did you mean: 

How to untar files/directories from a tar tape

SOLVED
Go to solution
frederick hannah
Super Advisor

How to untar files/directories from a tar tape

I have created an ignite tape and i wont to untar several directories and files from the tape to the server. I dont need to re-ignite. The server is an rp7400 running 11.11
4 REPLIES
Mel Burslan
Honored Contributor
Solution

Re: How to untar files/directories from a tar tape

in order to get a file from an ignite tape, you need to skip past the first file which is LIF (used for booting from tape), using these commands:

mt -t /dev/rmt/0mn fsf 1
tar xvf /dev/rmt/0mn

make sure you use the no-rewind device as in 0mn not the 0m.

HTH
________________________________
UNIX because I majored in cryptology...
Patrick Wallek
Honored Contributor

Re: How to untar files/directories from a tar tape

Insert the tape in the drive.

My example assumes tape device /dev/rmt/0mn. Substitute your device where appropriate.

# mt -f /dev/rmt/0mn rew
Make sure tape is at the beginning

# mt -f /dev/rmt/0mn fsf 1
Skip over the boot head of the tape

To get a list of files:
# tar -tvf /dev/rmt/0mn

To extract a file (/etc/hosts for example)
# tar -xvf /dev/rmt/0mn etc/hosts

To extract a dir: (/etc/ for example)
# tar -xvf /dev/rmt/0mn etc

Notice that I am not specifying a leading '/' when specifying a file or directory. All files are stored on the tape relative to the '/' dir, so instead of /etc you have etc on the tape.

You can see this if you do the 'tar -tvf...' to get a list of files on the tape.
Dennis Handly
Acclaimed Contributor

Re: How to untar files/directories from a tar tape

After you have spaced forward, you could also use pax to read your tape:
To get a list of files:
pax -v -f /dev/rmt/0mn
To extract a file (/etc/hosts for example)
pax -v -r -f /dev/rmt/0mn etc/hosts
frederick hannah
Super Advisor

Re: How to untar files/directories from a tar tape

Yep. Thanks to you HP-MEN, I know no longer fear tar and I am experimenting with pax