1833780 Members
2563 Online
110063 Solutions
New Discussion

Tape to Tape backups

 
James Brelsford
Advisor

Tape to Tape backups

Hello everyone,
I have an urgent need to do tape to tape backups. I cannot load the tape onto a disc drive to make a copy of it. I've tried to dd a test tar file and only managed to get one (1) file inside the tar on the new tape. I'm using HP9000 C360 running HP UX with two surestore 24e tape drives. So the question is does anyone know how to do the tape to tape copy or know of a HP or third party utility to do this.
6 REPLIES 6
Andreas Voss
Honored Contributor

Re: Tape to Tape backups

Hi,

dd is a good choice for dubbling tapes.

What about:

dd if=/dev/rmt/#m of=/dev/rmt/#m bs=10k

where # are the instance numbers of your drives.

Regards
Santosh Nair_1
Honored Contributor

Re: Tape to Tape backups

Andreas,

How were you able to determine the block size to use. Usually I have problems with this...although I've had a good amount of success with using bs=18k.

-Santosh
Life is what's happening while you're busy making other plans
Volker Borowski
Honored Contributor

Re: Tape to Tape backups

James,

you need to be sure about the blocksizes and about the number of filesets on the tape.

If the backup was created with "tar -cvf /dev/rmt/0m", your blocksize will be 5120 bytes for example. If there where several runs to the norewind device, several dd's might be needed, because dd stops at the EOF-marker of the first fileset.

Hope this helps
Volker
A. Clay Stephenson
Acclaimed Contributor

Re: Tape to Tape backups

Hi James,

Your fundamental problem is determining the block size of the source tape. I would do it like this (and assuming this is tar format rather):

dd if=/dev/rmt/2m (or whatever) ibs=10k obs=512 | tar vtf -

This will produce a listing to stdout. When you get the input blocksize correct, you will see no errors. If 10k doesn't work, try 5k; eventually you will get there.

Once that is done, you simply use dd and set bs equal to the ibs determined by the method above.

I suggest that if you do have multiple tar archives on the source tape that you use the Berkeley style norewind devices (e.g. /dev/rmt/2mnb).

Regards, Clay
If it ain't broke, I can fix that.
Brendon Shiels
New Member

Re: Tape to Tape backups

I think the issue here is that the tape contains multiple filemarks - dd will only copy a single filemark - however a quick script will automate using the no rewind tape devices.
We did something like this on an RS/6000(untested on HP9000)
#!/usr/bin/ksh
var1=0
while true
do
dd if=/dev/rmt/0mn of=/dev/rmt/1mn bs=10k
if [[$? -eq 0]]
then
print "File copied" $var1
((var1=var1+1))
else
print "Finished"
exit
fi
done
Dragan Krnic
Frequent Advisor

Re: Tape to Tape backups

Serious tape2tape via dd is a bad idea. dd doesn't care much about buffering so the overall speed is is bound to be extremely low as I verified by tests. It also reduces the tape capacity dramatically and is bound to wear off the mechanics in no time at all.

After a public domain package "buffer" failed to meet my requirements, I wrote a C program which creates a massive FIFO (many hundreds of MB) in shared memory which is being filled by one process and emptied by another. The two processes sync themselves with hi and lo watermarks and wake each other up to fill or empty respectively. It assumes equal block sizes on input and output, therefore it is invoked with

a.out indev outdev [ kblocksz [ mbuffersz]]

I observed a practically streaming behaviour copying between like drives. Sounds interesting?

By the way, to arrive at the tape block size I use

dd if=$TAPE bs=1024k count=1 | wc

should my "info" extension to "mt" command not work for any reason.