- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- File(s) Recovery
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2010 11:08 AM
тАО09-27-2010 11:08 AM
The man page for make_tape_recovery gives an example of locating and extracting a single file from the recovery archive:
mt -t /dev/rmt/0mn fsf 1
tar -xvf /dev/rmt/0mn [filename]
Question:
If needed to extract a complete directory, can the [filename] be a directory path or wildcard. For Example:
tar -xvf /dev/rmt/0mn /var/adm/sw
or
tar -xvf /dev/rmt/0mn /var/adm/sw/*
Thanks in advance for any assistance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2010 11:17 AM
тАО09-27-2010 11:17 AM
SolutionOr possibly pax(1).
>can the filename be a directory path or wildcard.
Yes. No wildcards, unless you use pax(1) and you would have to quote the pattern, unless you are happy with filename completion.
>tar -xvf /dev/rmt/0mn /var/adm/sw
You'll probably have to leave out the leading "/".
Also, for Integrity, the fsf value is 22.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2010 11:18 AM
тАО09-27-2010 11:18 AM
Re: File(s) Recovery
Either will work. Without the wildcard, the directory and its contents will be extracted. With the wildcard, only the contents will be loaded. Should the directory on the *server* be absent, this would fail. Hence, use the form without a wildcard.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2010 11:24 AM
тАО09-27-2010 11:24 AM
Re: File(s) Recovery
You'll probably have to leave out the leading "/".
Also, for Integrity, the fsf value is 22.
[/quote]
??? Why would I leave out the leading "/" in a directory path?
??? What is significance of "22"? Yes, This is for 'Integrity' server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-27-2010 11:30 AM
тАО09-27-2010 11:30 AM
Re: File(s) Recovery
Because ignite is being kind and using a format that allows you to restore the file elsewhere, with tar. Before you waste time trying to restore a file, try just listing the tape.
>What is significance of 22? This is for Integrity server.
A magic number for Integrity, same as 1 is for PA.
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1396648
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1401212
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2010 03:04 AM
тАО09-28-2010 03:04 AM
Re: File(s) Recovery
Using the examples above, ran:
mt -t /dev/rmt/0mn fsf 22
tar -tvf /dev/rmt/0mn | grep sw
That worked ok, so tape 'is' accessible'. Interesting that preceding "/" is omitted in the listing....
So, if I was going to restore the '/var/adm/sw' directory in this example, then cmd would be:
tar -xvf /dev/rmt/0mn var/adm/sw
...run from the root file system?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2010 03:54 AM
тАО09-28-2010 03:54 AM
Re: File(s) Recovery
I need to clarify my response to your original question asking if the filename(s) can be a directory or a directory with a wildcard.
You *might* or you *might not* obtain the results you are looking for if you use the '/path/*' notation in lieu of the '/path'.
The problem is that the shell normally does filename expansion. Thus, something like this:
# mkdir /var/tmp/DUMMYDIR
# cd /var/tmp/DUMMYDIR
# touch f1 f2 f3
# ls
f1 f2 f3
# cd .. && tar -cvf /var/tmp/myarchive.tar ./DUMMYDIR
a ./DUMMYDIR/f1 0 blocks
a ./DUMMYDIR/f2 0 blocks
a ./DUMMYDIR/f3 0 blocks
# rm DUMMYDIR/f1 DUMMYDIR/f2
...this leaves only 'f3' in 'DUMMYDIR'...
Now, compare:
# tar -xvf /var/tmp/myarchive.tar ./DUMMYDIR/*
x ./DUMMYDIR/f3, 0 bytes, 0 tape blocks
...which only restores what's already present in the directory; with:
# tar -xvf /var/tmp/myarchive.tar ./DUMMYDIR
x ./DUMMYDIR/f1, 0 bytes, 0 tape blocks
x ./DUMMYDIR/f2, 0 bytes, 0 tape blocks
x ./DUMMYDIR/f3, 0 bytes, 0 tape blocks
...which restores everything that was archived.
The reason is that the shell is normally optioned ('set +f') to expand filenames. Hence, in the test above:
# tar -xvf /var/tmp/myarchive.tar ./DUMMYDIR/*
...really looked like:
# echo tar -xvf /var/tmp/myarchive.tar ./DUMMYDIR/*
tar -xvf /var/tmp/myarchive.tar ./DUMMYDIR/f3
If you disabled filename expansion, nothing would be restored if you used the "*" as in these examples:
# set -f
# tar -xvf /var/tmp/myarchive.tar ./DUMMYDIR/*
#
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2010 07:34 AM
тАО09-28-2010 07:34 AM
Re: File(s) Recovery
OK, as a test, I loaded one of my Ignite tapes, created a "/var/tmp/roger", changed to that location, then ran some commands:
THIS WORKED:
fndev1-> mt -f /dev/rmt/0mn rew
fndev1-> mt -f /dev/rmt/0mn fsf 22
fndev1-> tar -tvf /dev/rmt/0mn | grep sw
THESE DID NOT WORK:
fndev1-> mt -f /dev/rmt/0mn rew
fndev1-> mt -f /dev/rmt/0mn fsf 22
fndev1-> tar -xvf /dev/rmt/0mn var/adm/sw/*
fndev1-> mt -f /dev/rmt/0mn rew
fndev1-> mt -f /dev/rmt/0mn fsf 22
fndev1-> tar -xvf /dev/rmt/0mn /var/adm/sw/*
fndev1-> mt -f /dev/rmt/0mn rew
fndev1-> mt -f /dev/rmt/0mn fsf 22
fndev1-> tar -xvf /dev/rmt/0mn var/adm/sw
fndev1-> mt -f /dev/rmt/0mn rew
fndev1-> mt -f /dev/rmt/0mn fsf 22
fndev1-> tar -xvf /dev/rmt/0mn /var/adm/sw
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2010 07:45 AM
тАО09-28-2010 07:45 AM
Re: File(s) Recovery
>.fndev1-> mt -f /dev/rmt/0mn fsf 22
>>fndev1-> tar -xvf /dev/rmt/0mn var/adm/sw
This should have worked.
Your first list of statements, with the 'tar -tvf' is just listing the contents of the tape. I assume you saw "var/adm/sw" in your output?
Did you get any messages when you tried extracting?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2010 08:50 AM
тАО09-28-2010 08:50 AM
Re: File(s) Recovery
Yes, "var/adm/sw" was in the list along with all the asscoiated subdirs and files. This was just done to see if the tape could in fact be read - a sort of sanity check.
Did you get any messages when you tried extracting?
Nope, and thats what concerned me. It 'should' have extracted the files, yet didn't, and didn't say why it didn't - no error code or warning. I have no way of interpreting what the problem is.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2010 08:55 AM
тАО09-28-2010 08:55 AM
Re: File(s) Recovery
# set -f
# tar -xvf /var/tmp/myarchive.tar ./DUMMYDIR/*
If you used pax, it would work.
>Patrick: tar -xvf /dev/rmt/0mn var/adm/sw
>This should have worked.
Right. If you see a path with -tvf, you should be able to use this to restore.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2010 10:43 AM
тАО09-28-2010 10:43 AM
Re: File(s) Recovery
As a test:
>I tarred the existing '/var/adm/sw' directory to safe storage.
>Changed to the "/" directory
>executed the commands:
mt -f /dev/rmt/0mn rew
mt -f /dev/rmt/0mn fsf 22
tar -xvf /dev/rmt/0mn var/ad/sw
This worked. The only thing I can think of at this point is that the restore has to be relative to the root directory and not a temporary directory somewhere else on the server.
I may test this a few more times to make sure of the behavior. Fairly certain that that if the process is the same, I can script this out or future use with little or no problem.
Thanks all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2010 10:57 AM
тАО09-28-2010 10:57 AM
Re: File(s) Recovery
>>is that the restore has to be relative to
>>the root directory and not a temporary
>>directory somewhere else on the server.
No, tar really doesn't care, nor does it matter, where you start the restore from. It should work the same whether you start from '/' or from '/fred/flintstone'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2010 11:04 AM
тАО09-28-2010 11:04 AM
Re: File(s) Recovery
I'm open to any explainations at this point.......meanwhile, I'll test some more.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-28-2010 11:25 PM
тАО09-28-2010 11:25 PM
Re: File(s) Recovery
Why don't you toss tar and go with pax(1), perhaps better messages?
cd /var/roger
# fiddle with mt(1) position as above
pax -r -v -f /dev/rmt/0mn var/adm/sw
Should we ask why you are fiddling with trying to restore the IPD in /var/adm/sw/?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2010 02:40 AM
тАО09-29-2010 02:40 AM
Re: File(s) Recovery
Sure, you can ask. I just picked a directory. There was nothing special about using '/var/adm/sw'. I'm a twiddler, and I always wanted a way to extract the files from an Ignite tape as a part of my toolset in case of any future failure(s). I just like to be prepared.
Thanks again to all for the insight and assistance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2010 02:42 AM
тАО09-29-2010 02:42 AM