Operating System - HP-UX
1837008 Members
1979 Online
110111 Solutions
New Discussion

Copy a DAT to another DAT

 
Daniel Ubeda
Frequent Advisor

Copy a DAT to another DAT

Hi,

how can I copy an entire DAT to another DAT ??
like diskcopy in DOS .....
Daniel
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: Copy a DAT to another DAT

dd should do it:

dd if=/dev/rmt/0m of=/dev/rmt/1m bs=nnn

Pete

Pete
Dietmar Konermann
Honored Contributor

Re: Copy a DAT to another DAT

Hi!

You need to know what type of data is on that tape (i.e. block size, number of sections, etc.).

E.g. a tape with a single standard tar archive section on it can be copied using:

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

I don't know of any tool that does some kind of low level copy, regardsless what format is on the medium.

Regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Yogeeraj_1
Honored Contributor

Re: Copy a DAT to another DAT

hi,

dd should work!

Hope that you have 2 DAT drives for this operation ;)

Best Regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
H.Merijn Brand (procura
Honored Contributor

Re: Copy a DAT to another DAT

To check the blocksize of the source tape

# dd if=/dev/rmt/0m ibs=102400 of=xx count=1
# wc -c xx (or ls -l xx)
1024 xx

1024 above is just an example to use below

Above answers are ok. Having only one tape drive - and enough disk space

# dd if=/dev/rmt/0m ibs=1024 of=xx
# mt offl
- insert target tape -
# dd if=xx of=/dev/rmt/0m bs=1024
Enjoy, Have FUN! H.Merijn
John Palmer
Honored Contributor

Re: Copy a DAT to another DAT

Hi,

As stated dd will do it but you must ensure that the blocksize (bs=) is at least as big as the largest blocksize on the tape. If you specify a blocksize that is too small then dd will write truncated blocks and your copy tape will be corrupt. dd reports the number of complete and partial blocks read and written at end of run, see man dd and look for DIAGNOSTICS. You want to ensure that there are 0 partial blocks read.

If there is more than one file on the tape then you'll have to repeat the dd command until all files have been copied.

The following script fragment will cater for multiple files:-

while (( ${?} == 0 ));
do
dd if=/dev/rmt?? of=/dev/rmt?? bs=256k
done

dd will fail when it reaches EOF on the input tape and the loop will exit.

Regards,
John
Frank Slootweg
Honored Contributor

Re: Copy a DAT to another DAT

As others have mentioned, in *which* format is the tape written, i.e. which utility wrote the tape?

Once we know that, we can give more specific answers, because there is no generic answer.
harry d brown jr
Honored Contributor