1826190 Members
2475 Online
109691 Solutions
New Discussion

Re: Tape-to-Tape Copy

 
SOLVED
Go to solution
Tim Stallman
Advisor

Tape-to-Tape Copy

Hi,
I'm trying to do a tape to tape copy of an archive that was created on an NT box. I tried dd and it seems to only get me the header files created by the NT dump and not the actual data. All i want to do is make an exact copy of the date from tape 1 to tape 2 irrespective of what is on the tape and how it was originally created. Any help is greatly apprciated.

Regards,
Tim
7 REPLIES 7
John Palmer
Honored Contributor

Re: Tape-to-Tape Copy

Sounds like it's a tape with several logical files on it.

You'll have to keep running dd (using both input and output no-rewind devices) until you get an error indicating that you've reached the end of the input tape.

Also ensure that you're specifying a big enough block size (bs=nnnnn) to dd, otherwise you'll lose data. If you don't know the tape blocksize err on the side of caution.

Regards,
John
david gao
Advisor

Re: Tape-to-Tape Copy

Did u try to use dd with non-rewindable device file to copy into file? If it works, then copy it to a new copy. Then figure it out again what's wrong with tape-2-tape.
Jean-Louis Phelix
Honored Contributor

Re: Tape-to-Tape Copy

hi,

use a mix of what John and David wrote :

- keep running dd using a no-rewind device until you get a end of tape message,
- for each file, dd will give you a message :
X+Y records. A good blocksize would give X+0 records because X is the number of entire blocks and Y the number of partial blocks

Regards
It works for me (© Bill McNAMARA ...)
H.Merijn Brand (procura
Honored Contributor

Re: Tape-to-Tape Copy

Fully automated: Please note the extreme large input block size. You need this for machines that produce tapes with variable block sizes (like NT, OS/400, and AIX)

#!/usr/bin/perl

system "/usr/bin/mt -f /dev/rmt/0m rewind";
$s = "000";
while (1) {
print STDERR "Reading LV $s into Tp$s ...\n";
$f = "Tp".$s++;
system "dd if=/dev/rmt/0m ibs=102400 of=$f";
-s $f or last;
}
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor
Solution

Re: Tape-to-Tape Copy

Errrr, typo

#!/usr/bin/perl
$tp = "/dev/rmt/0m";
system "/usr/bin/mt -f $tp rewind";
$s = "000";
while (1) {
print STDERR "Reading LV $s into Tp$s ...\n";
$f = "Tp".$s++;
system "dd if=${tp}n ibs=102400 of=$f";
-s $f or last;
}
system "/usr/bin/mt -f $tp rewind";
Enjoy, Have FUN! H.Merijn
Tim Stallman
Advisor

Re: Tape-to-Tape Copy

Procura,
I've been using dd manually to get this tape to copy. Each time it stops it gives a message like

23241 + 0 in
23241 + 0 out

It's not picking up any partial blocks. Do I need to still use the large block size? Also is there any documentation/resources I can reference?

thx,
Tim
H.Merijn Brand (procura
Honored Contributor

Re: Tape-to-Tape Copy

for copying tapes with unknown block size, I do personally not trust the

n + 0 blocks

I'd rather see

0 + n blocks, so I'm sure it got all data

I should say that the correct block size is probably the fastest, but asking for too much does hurt less than asking for too little. If your system allows you to ask a 1Meg buffer, do use it for unknown tapes.

The best documentation for tapes on different systems is called experience. Together with defensive handling (not using OS specific backup/restore software) system interchange is best guaranteed. If you stay on HP-UX, backup/restore is probably the fastest way to deal with your data to/from tape. If other (OS) systems come in play, you are bound to tar and cpio (preferably from GNU)



pts
Enjoy, Have FUN! H.Merijn