Re: Going back <n> records, using mt. (script included)
nimennor@ieaccess.net (Sergey Imennov) writes:
> Here's a basic layout of the program:
> 1. mt eof ( to 'append to a tape' )
> 2. Write "/"
> 3. Write 'dynamic' directories
> 4. go back 2 records ( I use mt bsf 2, but that
> doesn't work... )
> 5. Invoke BRU's integrity-checking for "/"
> 6. Invoke BRU's integrity-checking for 'dynamic' dirs.
>
> After step "2", should I write a file 'mark' with
> some mt option?
If you close the file in step 2 and reopen it in step 3 a filemark is
automatically written.
> What's the correct command for going back 2 'files'?
The problem is after closing the file a filemark is automatically
being written. If you issue a "mt bsf 1" command right now you will
be at the beginning of that filemark (at least with my tape).
~$ mt tell # Behind the filemark
At block 50.
~$ mt bsf 1
~$ mt tell # Before the filemark
At block 50.
A subsequent "mt fsf 1" will position right after that filemark". So
"mt bsf 3" followed by a "mt fsf 1" (to skip the filemark) should be
the correct command.
~$ mt fsf 1
~$ mt tell
At block 50.
I suggest testing the behaviour on your tape. I just used some "dd
if=/dev/zero of=/dev/tape bs=512 count=10" to write some blocks, using
"mt tell" you can check the current position. Unfortunatly, I don't
know a way to check if the tape is standing just left of the filemark
or right.
F = Filemark
After writing two files:
File 0 F F
|-------------|-------------|
^
mt bsf 2
File 0 F F
|-------------|-------------|
^
mt fsf 1
File 0 F F
|-------------|-------------|
^
If you forget the "mt fsf 1" the filemark is erased.
> Would it be better if I use SCSI-specific
> commands like fss, bss?
If you can get the filemark behave the way you like I wouldn't suggest
that.
> Any comments on the script itself? I used so
> many 'variables', because the script is easier
> adapted to other machines easier that way. Am I
> wrong?
If I have some spare time I will take a look at it.
Torsten
BTW: I used a DDS2 DAT drive (HP C1599) for testing. After reading
the manpage and comparing the test results I got the impression the
manpage must be wrong with regards to the bsf command.
--
Homepage: http://www.in-berlin.de/User/myrkr
Reply to: