1823275 Members
3218 Online
109648 Solutions
New Discussion юеВ

tape drives

 
lisa yates_1
Occasional Contributor

tape drives

I apologize if I am not in the correct forum, but please help me!!!!

How do you position the tape at the end of data? I've done "mt -f /dev/rmt/0mn rew" and that seems to work. And then I did "mt -f /dev/rmt/Omn eod" but, I'm not positve that it worked. How do I know for sure?
5 REPLIES 5
Jeff Schussele
Honored Contributor

Re: tape drives

Hi Lisa,

mt eod

for the default device, /dev/rmt/0mn, is the correct command for QIC & DDS tape drives.
I haven't tested this but you might try to move a filespace forward
mt fsf 1
You *should* get an error as there should be nothing forward.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Denver Osborn
Honored Contributor

Re: tape drives

I agree with Jeff...

You could also use fsf to position the tape past the 1st archive.

mt -f /dev/rmt/0mn fsf 1

What's on your tape and what goal do you need to accomplish?

-denver
Shannon Petry
Honored Contributor

Re: tape drives

If you read the man pages for the MT command, you will find that the "rew" option is the rewind command, and not the end of data command. Since you are specifying a no rewind device, this takes you to a previous volume, not the end of data.

The eod command will set the tape to the end of data mark.

Now, it is critical to gain some understanding that with a no rewind device, some of the commands from mt pertain only to the current volume.

I.E.

tar cvf /dev/rmt/0mn /etc
#made volume 1
tar cvf /dev/rmt/0mn /usr
#made volume 2
tar cvf /dev/rmt/0mn /opt
#made volume 3

mt -t /dev/rmt/0mn rew
#rewinds full tape
mt -t /dev/rmt/omn eod
# positions tape at beginning of volume 2

Since there is no way to track the absolute end of tape (in Solaris there is an eom arg for mt which will go to the end of media mark), you must know how many volumes are on the tape to be effective, or use a loop on the no rewind device with the eod command to find the end of tape.

Regards,
Shannon
Microsoft. When do you want a virus today?
lisa yates_1
Occasional Contributor

Re: tape drives

Well, I tried this and I hope it works!

What I'm trying to do is write more files onto the tape at the end of the current data.

Thanks for your help, gentlemen.

Lisa
Bill Hassell
Honored Contributor

Re: tape drives

If you are using VERY old 1/2" reel-to-reel tape drives, then it is certainly possible to run off the end of the reel looking for end-of-data. By convention, EOD is defined as two adjacent tape marks (end of file markers).

But for modern DDS and DLT drives, the firmware makes it impossible despool the tape by running off the end of the reel. So the EOD command is the correct method to reach the end of the data. DDS and DLT drives write a special code that cannot be bypassed once a tape is finished writing and closed by HP-UX.

To verify that mt eod works, write a series of short files on the tape (content and length unimportant) then write a unique file that you'll recognize (ASCII would be useful). Rewind the tape and reposition to EOD. Then use mt bsr 10 to backup 10 records and cat the tape. You should see the end of the last file.

BTW: Appending data to the end of other files is pretty risky. Many sysadmins are sorry that they lost or overlaid valuable backups while trying to save a little money on tapes.


Bill Hassell, sysadmin