1752713 Members
5656 Online
108789 Solutions
New Discussion юеВ

Unix Commands

 
SOLVED
Go to solution
Brian Butler_3
Occasional Contributor

Unix Commands

Is it possible to copy data on a tape from 1 dat drive to another dat drive in Unix? If so, do you know the commands?
What about copying from the dat tape across the network (access the dat drive from a remote machine)?
What about only using a single dat drive to copy off one tape and copy back to another?

The situation is we have backups on old dat tapes that needs to be moved to new dat tapes to maintain data integrity.

Thanks,
7 REPLIES 7
curt larson_1
Honored Contributor

Re: Unix Commands

that would depend on what utilities were used to create the tapes in the first place.

do you know how the tapes were written?
Geoff Wild
Honored Contributor

Re: Unix Commands

Check out dd

"dd - convert, reblock, translate, and copy a (tape) file"

Across the network - you would have to create a pipe...

To use the same drive - dd to a filesystem, then dd it back.

If you have high end backup software (like Netbackup), then you could use utilities in it to do this - like tape duplication...

Rgds...Geoff




Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Helen French
Honored Contributor

Re: Unix Commands

A direct copy of tape will depend up on the software/command you used to create the original tape. 'dd' is very useful in most cases:

# dd if=/dev/rmt/0mn of=/dev/rmt/1mn bs=10240
Life is a promise, fulfill it!
Elmar P. Kolkman
Honored Contributor

Re: Unix Commands

One minor problem: not all tapes are the same size... This is one of the problems with cloning in DataProtector BTW. I can't copy a tape containing 20Gb to a tape that is 1 inch shorter and thus can contain some MB's less... The same problem will occur if you try to do 'dd'.
But if the tape is not full, dd is a simple solution, as long as you know the blocksize and there is only one file on the tape (not something to forget either).

dd if= of= bs=

The info generated by this command will display the number of blocks read and the number of blocks written.
Every problem has at least one solution. Only some solutions are harder to find.
A. Clay Stephenson
Acclaimed Contributor

Re: Unix Commands

Note: If the original backup was fbackup, Omniback, (rather than more vanilla utilities like tar and cpio --- dd cannot be used. fbackup, OB2, et al use a much more complicated variable blocksize scheme.
If it ain't broke, I can fix that.
Laurent Menase
Honored Contributor
Solution

Re: Unix Commands

Hi,

As written before, you may have variable record size.
But you may have multiple files too.

To find the block size of a file on a tape:
dd ibs=1024k obs=1 count=1 if=/dev/rmt/0mn of=/dev/null
0+1 records in
2048+0 records out
^^^^ it is the block size for that tape.

If you have multiple files ( for instance an ignite tape)
mt -t 0mn rew
mt -t 1mn rew
dd if=/dev/rmt/0mn bs=2k of=/dev/rmt/1mn
mt -t 0mn rew
mt -t 1mn rew
mt -t 0mn fsf
mt -t 1mn fsf
dd if=/dev/rmt/0mn bs=10k of=/dev/rmt/1mn



James Lynch
Valued Contributor

Re: Unix Commands

Everybody has throroughly cover the dd aspect on a local system. To answer your question about accessing a tape drive on a remote system. Yes that is possible. Use the remsh command to run the dd on the remote system and then pipe the output to a dd on the local system.

to copy from a tape on the remote to tape on the local:

remsh remote-system dd if=/dev/rmt/0m bs=64k | dd of=/dev/rmt/0m bs=64k

To copy from the local tape to a remote tape:
dd if=/dev/rmt/0m bs=64k | remsh remote-system dd of=/dev/rmt/0m

JL
Wild turkey surprise? I love wild turkey surprise!