1833789 Members
2592 Online
110063 Solutions
New Discussion

rewind tape

 
Cathy Arora
Frequent Advisor

rewind tape

Can someone tell me how to..
I would like to know where I am on the tape after backing up some files.
I backed up some files and now I would like to go back to couple of files and start copying from that perticular point.
I did mt -t /dev/rmt/0m fsf 27
but do not know if it really worked becuase I do not know how to check if I am at the right place to start copy again.
Thanks
raj
6 REPLIES 6
Rodney Hills
Honored Contributor

Re: rewind tape

The only way to know where you are on a tape is to rewind and fsf the number of files you want to bypass.

Be sure to use /dev/rmt/0mn as the tape device because "0m" means to rewind the tape device on file close, where "0mn" means no rewind.

HTH

-- Rod Hills
There be dragons...
Ian Dennison_1
Honored Contributor

Re: rewind tape

Have you thought about using "bsf" and "bsr" (Backspace files and backspace records)? As long as you know where you want to go relative to where you are, then its simple math.

Share and Enjoy! Ian
Building a dumber user
twang
Honored Contributor

Re: rewind tape

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

# mt -f /dev/rmt/0mn fsf 1
Cathy Arora
Frequent Advisor

Re: rewind tape

I was looking to accomplish after I have copied for examp aaa
bbb
ccc
and now I want to go back to bbb and start copying two new files xxx and yyy
so now when I do tat tvf /dev/rmt/0m
I should see
aaa
xxx
yyy

I am sorry my question was not clear
raj
twang
Honored Contributor

Re: rewind tape

You may do a test,
# tar cv aaa
# tar rv bbb
# tar rv ccc

then
# mt -f /dev/rmt/0mn rew
# mt -f /dev/rmt/0mn fsf 1
# tar rv xxx
# tar rv yyy

then verify the contents of the tar image with the tar command using the appropriate device file:
# tar tvf /dev/rmt/0m
Martin Robinson
Frequent Advisor

Re: rewind tape

Other replies about using mt fsf and mt bsf are relevant. But you say you are using tar. If you have used tar to write several files to a tape, then as far as the tape is concerned there is only one file.

You cannot go backwards and forwards within a tar file.

Using tar, you can append to an existing archive but you cannot erase or replace a file within a tar archive. Think of it as a write-only medium.

You can write several tar archives to tape. In this case each archive is a separate file, so you can use 'mt' to move the tape back and forth. But you cannot append to the first archive, as it will overwrite the second archive.
Hope this helps.