Smart questions
Smart answers
Smart people
Join Tek-Tips Forums

Member Login

Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

TurtleOp (IS/IT--Management) (OP)
4 Jul 08 9:15
I am on a old AIX trying to restore a backup on tape.
The device /dev/rmt1 exist end I succeed to execute the following command with correct result:
tar -tvf /dev/rmt1
I obtained the containt of the tape backup. It take approx. 2 hours.
But when I try to make any restore, nothing happened, no message, nothing.
Ex. of commmand I've tried:
tar -xvf /dev/rmt1 ./oradata01/DBNAME/dbf/prodtai.dbf
tar -xvf /dev/rmt1 './oradata01/DBNAME/dbf/prodtai.dbf'
tar -xvf /dev/rmt1
tar - xvvf ./oradata01/DBNAME/dbf/prodtai.dbf

No way.. and I do not know if tar generate some log somewhere ...
Any ideas Welcome!

columb (IS/IT--Management)
4 Jul 08 9:28
Have you rewound the tape? The simple answer is to eject and replace before trying the tar -xvf again

On the internet no one knows you're a dog

Columb Healy

TurtleOp (IS/IT--Management) (OP)
4 Jul 08 9:39
Sounds good and easy ;)
I will try!
Thank you,
khalidaaa (TechnicalUser)
4 Jul 08 9:42
You should have used the -c option instead of -t!

-t is used for reading the content of the tape while -c is the actual backup of data!

See this link for more info:

khalidaaa (TechnicalUser)
4 Jul 08 9:46
And here is the man page for tar command:

You don't have to rewind the tape as the command you used should have rewinded the tape already as it is using /dev/rmt1 (rewindable) and not /dev/rmt1.1 (not rewindable).

For more info on tape manupilation have a look here:

TurtleOp (IS/IT--Management) (OP)
4 Jul 08 9:47
Hi Khalid,
No, its correct, the backup was already done, I just tried to restore it. I made an inventory of the tape, successfully. My problem is the restore -x ;)
TurtleOp (IS/IT--Management) (OP)
4 Jul 08 9:50
Pitty, I was hoping that was the problem...
Thank you for useful links,
khalidaaa (TechnicalUser)
4 Jul 08 9:59
Can't be correct!!!


Required Flags
-c Creates a new archive and writes the files specified by one or more File parameters to the beginning of the archive.
-t Lists the files in the order in which they appear in the archive. Files can be listed more than once.
-x Extracts the files specified by one or more File parameters from the archive. If the File parameter refers to a directory, the tar command recursively extracts that directory from the archive. If you do not specify the File parameter, the tar command extracts all of the files from the archive. When an archive contains multiple copies of the same file, the last copy extracted overwrites all previously extracted copies. If the file being extracted does not already exist on the system, the file is created. If you have the proper permissions, the tar command restores all files and directories with the same owner and group IDs as they have on the tape. If you do not have the proper permissions, the files and directories are restored with your owner and group IDs. It is not possible to ask for any occurrence of a file other than the last.

TurtleOp (IS/IT--Management) (OP)
4 Jul 08 10:03
I think we have a small misunderstanding. My bad probably.
In fact, because I did'nt succeed to restore my backup, I made an inventory, that was successfull, using the command:
tar -tvf /dev/rmt1

khalidaaa (TechnicalUser)
4 Jul 08 10:10
Ok now we are on the same track!

When you tried to view the content of the tape, was files appeared in an Absolute or relative format?

Coz if they were backed up using Absolute format then you have to restore files using the following command instead:


tar - xvf /oradata01/DBNAME/dbf/prodtai.dbf


Relative vs Absolute Paths
When restoring files backed up with the backup, cpio, or tar commands, find out FIRST whether RELATIVE or ABSOLUTE pathnames were used BEFORE the restore is initiated. We recommend using RELATIVE.

Relative pathnames will have a ./ pre-fixed to their path.  These files will be restored relative to the current directory.
Absolute pathnames won't have the ., just the /.  These are restored with the full pathname to the exact directory as specified on the archive device.

TurtleOp (IS/IT--Management) (OP)
4 Jul 08 10:14
Relative paths, for sure, starting with the "."
khalidaaa (TechnicalUser)
4 Jul 08 10:15
You might find this useful if your backed up files are using the absolute format and you want to restore to a different directory (pax command)!

khalidaaa (TechnicalUser)
4 Jul 08 10:18

Are you sure that this file (./oradata01/DBNAME/dbf/prodtai.dbf)
exists on the tape?

Try this to confirm:


tar -tvf /dev/rmt1 | grep oradata01/DBNAME/dbf/prodtai.dbf

TurtleOp (IS/IT--Management) (OP)
4 Jul 08 10:21
My backed up files are using relative path as well - I've just now double check it - But I will make a test anyway.
Thank you
TurtleOp (IS/IT--Management) (OP)
4 Jul 08 10:23
I will try the command immediately but yes I am sure at 100% at least according the inventory. I have also made a cupple of others try with different files :(
I am fighting since 3 days now ... sic!
khalidaaa (TechnicalUser)
4 Jul 08 10:25
You can as well try with restore command if tar doesn't work!


restore -x -v -q -f /dev/rmt1 ./oradata01/DBNAME/dbf/prodtai.dbf

Don't forget that the restore or tar command using relative path will restore your files in your current directory! You might already know this but i thought of saying it any way :)

TurtleOp (IS/IT--Management) (OP)
4 Jul 08 10:26
I try it already, but restore command don't run on tar backup. I received an error message on this way. the backup must be done using backup command.
khalidaaa (TechnicalUser)
4 Jul 08 10:27
3 days!!! I hope we solve this together :) If not then i would suggest you replace the tape and try the whole exercise again unfortunately!

khalidaaa (TechnicalUser)
4 Jul 08 10:28
opps, sorry, my bad this time! so back to tar i guess!

TurtleOp (IS/IT--Management) (OP)
4 Jul 08 10:32
You right! I already ask the customer to insert a NEW tape in the prod server. But I need to wait monday that they physically move the tape inside the standby server.
I am working remotely, my goals is to test some old procedure to restore an Oracle 8i standby database. Conclusion: Its always good to test our backup...
By the way, I ask them, it seems the tape are 6 months old but I d onot know at which frequence they are used.
Kindest Regards,
khalidaaa (TechnicalUser)
4 Jul 08 10:39
Who knows! Tapes can go bad at any time!

I had once a problem with a new tape of a month old! later on i discovered that the operator forgot it in his car for a week!

Sometimes, it is not from the tape itself but the time the backup was taken! like if you go again and try to backup and then restore from the same tape it would work!

TurtleOp (IS/IT--Management) (OP)
4 Jul 08 10:43
:):):) That's a funny one! :)

On this good one, I will go take some fresh air ;) I need to change my mind a little bit, ideas will maybe come.

Thank you for your help and very much appreciated support Khalidaaa!
khalidaaa (TechnicalUser)
4 Jul 08 11:28
I hope you solve this and update us with the solution TurtleOp.

KenCunningham (TechnicalUser)
6 Jul 08 11:55
Have you consideres dd to test the tape?

I want to be good, is that not enough?

TurtleOp (IS/IT--Management) (OP)
7 Jul 08 2:42
Hi Ken!
Not yet, I will give a try.
Thank you,
p5wizard (IS/IT--Management)
7 Jul 08 4:00
My guess is, the dbf file you want to restore isn't named
like you see in the tar -tv listing but rather
 "./oradata01/DBNAME/dbf/prodtai.dbf "
one or more spaces at the end of the file name

To find out, run the tar -tv again but redirect the output to a file. Then vi that file and check the name of the file you want: find the file (type /prodtai.dbf), then go to the end of the line with $ and see where you're at.



khalidaaa (TechnicalUser)
7 Jul 08 4:46
Nice reasoning p5wizard :)
TurtleOp (IS/IT--Management) (OP)
7 Jul 08 6:05
Hi P5wizard! Hello Khalidaaa!
NO, I didn't put any space char at the end. I will check.
But I have another stupid problem now: the tape is not inside the tape reader and my contact is out of the office. I am working remotely for a customer.
Pffff... :(
khalidaaa (TechnicalUser)
7 Jul 08 7:06
TurtleOp! I'm afraid I can't help you with this :) Its just too far :)

psi07004 (IS/IT--Management)
7 Jul 08 7:57
Given what is already written, I assume the following. You have verified that data was written on the tape since you indicate you have indexed it (tar -tvf) successfully. You indicate "nothing" (no errors etc) was displayed when the tar -xvf command you issued was completed. Given that, the following are the possibilities.

 1. You don't indicate the type of tape drive (8mm ?) but in some cases if the block size has been changed from the time the tape was made to the restore, it won't read the tape, but should return an error in this case. This should not be your problem.
 2. If the tape was made with the block size set to variable (0), then you will not be able to read it back with the tar command. This should also not be your problem.
 3. If their is no error return when you attempt to restore a file, you typically have the path or name incorrect. By default, this must be your problem.

I suggest you try the following. If you saved a copy of the tape index (tar -tvf /dev/rmt1 > index.out). Then use vi to find the file in the index. Cut and paste the name into the tar -xvf command, and try it again. Or, if you have room then restore the entire tape somewhere else on the system, and then see if the file is there.

TurtleOp (IS/IT--Management) (OP)
7 Jul 08 8:02
I will give a try ASAP and I come back to you.
Thank you very much,
TurtleOp (IS/IT--Management) (OP)
8 Jul 08 8:02
Hi everybody!
With the new tape, I already succeed to restore one datafile using the following commands:
tar xvf /dev/rmt1 './oradata/DBNAME/dbf/prodtcl01.dbf'
and changing the destination:
tar xvf /dev/rmt1 '../oradata/DBNAME/dbf/prodtcl01.dbf'
But now, I would like to restore from a restore.list liewise:
tar xvf /dev/rmt1 'cat /tmp/resore.list' I am testing...

Thank you to all of us for your support!
khalidaaa (TechnicalUser)
8 Jul 08 8:31
So it was a tape problem as usual :)

Good Luck


Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close