Operating System - HP-UX
1821063 Members
2588 Online
109631 Solutions
New Discussion юеВ

Use dd to make copy of tape ???

 
Stephen Young_1
Occasional Advisor

Use dd to make copy of tape ???

Hi,

I want to make a copy of a DLT tape using the dd comand.
I have two DLT drives located on separate machines.
Is it possible to do this and if so would anybody be kind enough to give me the command as I have limited knowledge of dd.
Also are there any drawbacks in using dd ?

Cheers

Steve
10 REPLIES 10
Bill McNAMARA_1
Honored Contributor

Re: Use dd to make copy of tape ???

You can't.

DD is disk dump, not tape dump.

You should consider tar.

If it's an ignite tape, you can mount the tape using the mt command and then copy it.

Here's a link example:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0xfa73abe92dabd5118ff10090279cd0f9,00.html
It works for me (tm)
Bill McNAMARA_1
Honored Contributor

Re: Use dd to make copy of tape ???

tar cvf - | dd of=/dev/rmt/XX bs=64k

Actually your answer may be in the man dd page.

I never know you could do that!

Later,
Bill
It works for me (tm)
Stephen Young_1
Occasional Advisor

Re: Use dd to make copy of tape ???

Would this work and how would I get this to work across the network to utilise two tape drives on different servers ?

dd if=/dev/rmt/XX of=/dev/rmt/XX bs=64k


Frank Slootweg
Honored Contributor

Re: Use dd to make copy of tape ???

As others have indicated, we first need to know the (logical) format of the tape, i.e. which utility/options/parameters were used to write the tape?
Stephen Young_1
Occasional Advisor

Re: Use dd to make copy of tape ???

The backups where taken using Omniback
Ver A.02.10 which does not support copying
harry d brown jr
Honored Contributor

Re: Use dd to make copy of tape ???

If it is a tar tape, using no special blocking (default is 20), then use this, as it has been tested and it works:

dd if=/dev/rmt/0m ibs=20b |remsh remotehost dd of=/dev/rmt/0m obs=20b

If cpio was used, using no special blocking, then use this, as it also has been tested:

dd if=/dev/rmt/0m ibs=1b |remsh remotehost dd of=/dev/rmt/0m obs=1b

if you used the "B" option for cpio, then change "ibs" and "obs" from "1b" to "10b".

live free or die
harry


Live Free or Die
A. Clay Stephenson
Acclaimed Contributor

Re: Use dd to make copy of tape ???

Hi Stephen:

You should be able to do this. You will need to
examine the Device Block Size under OmniBack for the DLT drive that created the medium. This is found under the 'Advanced Options' for that particular logical device. You also need to be aware that generally several sessions (and thus several files) are actually stored on the meduium. You will need to use the no-rewind and hopefully the Berkeley no-rewind device.

Here is the basic idea:
assume 64k blocksize
local devive is /dev/rmt/1mnb
remote host is 'bugs'
remote device is /dev/rmt/2mnb

dd if=/dev/rmt/1mnb bs=64k | remsh bugs bs=64k of=/dev/rmt/2mnb

Repeat this step until 0+0 blocks in is echo'ed to stderr. This will indicate the last session on the media. I don't have a 2.10 version to test this on so I might repeat the step untill 2 0+0 blocks in is echo'ed to stderr. It's possible that a zero-length file is used as a tape mark between sessions.

You really need to update to a later version of OB2 - at least 2.55 and 3.x would be much better.

Regards, Clay
If it ain't broke, I can fix that.
Frank Slootweg
Honored Contributor

Re: Use dd to make copy of tape ???

> The backups where taken using Omniback
> Ver A.02.10 which does not support copying

Maybe it does. See my response in the "Duplicate Omniback II Tapes" thread http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xe471fd3f91d3d5118ff40090279cd0f9,00.html
Stephen Young_1
Occasional Advisor

Re: Use dd to make copy of tape ???

Thanks for all the help everyone, I will asing points later.

One final question for Clay.

When you say "Repeat the step ...."
Do you mean put it into a loop.
If so would a

while true
do
...


work ?

Cheers

Steve
Frank Slootweg
Honored Contributor

Re: Use dd to make copy of tape ???

Clay,

It is nearly impossible to copy OmniBack tapes (or fbackup tapes for that matter) with dd(1). OmniBack tapes are full of Fast Search Marks (or similar DLT marks), which dd(1) knows nothing about. Theoretically a scripted series of dd(1) and mt(1) commands could perhaps do the trick, but that would not be simple.

Perhaps a (Third Party) general purpose (DLT) tape copy utility could be used, but 1) I have no pointers to such Third Party products, 2) they may not be needed (see my response in the other thread) and 3) as you and others mentioned, upgrading to a newer OmniBack version is probably much simpler.