Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!asuvax!noao!ncar!gatech!purdue!haven!adm!news From: mike@BRL.MIL ( Mike Muuss) Newsgroups: comp.unix.wizards Subject: Re: UNIX tape duplicator request Message-ID: <26385@adm.brl.mil> Date: 28 Mar 91 02:35:28 GMT Sender: news@adm.brl.mil Lines: 41 Your "neat trick" is a rather dangerous piece of advice, because it ignores the issue of tape record lengths. The copy() subroutine in /bin/cp for BSD UNIX uses a buffer of size: /usr/include/sys/param.h:#define MAXBSIZE 8192 in a loop of the general form: for (;;) { n = read(fold, buf, sizeof buf); if (write(fnew, buf, n) != n) { Perror(to); } } If you tape has records of 8k or less, and only one "file" (i.e., nothing following the first EOF marker), then using "cp" will work. If you know the record length of the tape, you might consider using DD, e.g.: dd if=/dev/raw_input of=/dev/raw_output bs=10k Since TAR tapes are usually written with 10k records, this DD will work, and your example with CP will produce a defective copy (with most tape drives/drivers). If you don't know much about the format of the tape, a still better command to use is TCOPY (/usr/ucb/tcopy), which will copy tapes that have varying record lengths, multiple "files" before tape-EOF (double tape- mark). It can also be used to "survey" a tape; it produces a report like this: tcopy /etc/passwd file 1: record 1: size 14608 file 1: eof after 1 records: 14608 bytes eot total length: 14608 bytes Best, -Mike