From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079036515579.tru64-unix-managers.marc@archive.invalid> From: "A. Mahendra Rajah, Systems Manager" Date: Tue, 09 Feb 1999 15:47:16 +0000 To: tru64-unix-managers Subject: SUMMARY: How to duplicate a tape? X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079036515579 I was trying to duplicate the contents of a DLT tape to another using two tape drives and the `dd' command which would copy the first file OK, but wouldn't correctly copy the rest. The command I used was: dd if=/dev/nrmt1h of=/dev/nrmt0h skip=1 files=10 bs=61440 conv=notrunc Thanks to the following for replying to my query: alan@nabeth.cxo.dec.com Kevin Reardon John Francini "Dr. Tom Blinn, 603-884-0646" Ian Goodacre Lars Bro "Thomas.Meyer" tsh@mrc-lmb.cam.ac.uk (T. S. Horsnell) "C.J.Bol" Mervyn Weis They suggested two options: (1) Use `dd' repeatedly for EACH file on the master tape, or (2) Use `tcopy'. I used `tcopy' since it was the easiest. The original replies are attached. -------------------------------------------------------------------------- From: alan@nabeth.cxo.dec.com Why are you using the skip=? That causes it to skip records, which is either applied to the first file of the tape or every file of the tape (I don't know which). If every file that easily explains why you have the problem; you haven't copied all the data. If it only applies to the pseudo-label, then I'm not sure what would happen. One thing you could do is pick a small vdump from the set, pull it off both tapes to disk and see how they differ. -------------------------------------------------------------------------- From: Kevin Reardon Mahendra, Have you tried using the command tcopy? As in "tcopy /dev/nrmt1h /dev/nrmt0h". See "man tcopy" for more information. hope it helps, kevin reardon -------------------------------------------------------------------------- From: John Francini A couple of things here... "skip=1" says to skip one record, not one file, at least according to the dd man page. I think you may have to actually make a script that skips a file (using mt rather than dd to do the skip), then loops 10 times doing: dd to read a file and write it to the second tape mt eof (to write an end-of-file mark, since I think dd is too dumb to do so) At the end of the whole set of 10, use mt eof a second time to write a logical EOT (two or more tape marks in a row). Of course, all this is done with the norewind device names. If someone else comes up with a more elegant solution, I'd be pleased to be corrected! Thanks, John -- John Francini, francini@progress.com -------------------------------------------------------------------------- From: "Dr. Tom Blinn, 603-884-0646" You seem to be assuming that when you use "dd" with the "files=" option, it copies each input file to a separate output file. I suspect it appends all of the input files into a single output file. I believe you need to use a separate "skip=" for each input file, and copy one input file at a time to the output. You could probably write your own program that would do this more efficiently. Or just start by using "mt" to skip over the first file, then run "dd" once for each file to be copied, but don't ask it to copy multiple files, and don't tell it to skip anything. If you have the /dev/nrmt on the input and output, it should just copy one file from the input to one file in the output, and never reposition the tape in between the steps. Tom Dr. Thomas P. Blinn + UNIX Software Group + Compaq Computer Corporation 110 Spit Brook Road, MS ZKO3-2/U20 Nashua, New Hampshire 03062-2698 Technology Partnership Engineering Phone: (603) 884-0646 Internet: tpb@zk3.dec.com Digital's Easynet: alpha::tpb ACM Member: tpblinn@acm.org PC@Home: tom@felines.mv.net Opinions expressed herein are my own, and do not necessarily represent those of my employer or anyone else, living or dead, real or imagined. -------------------------------------------------------------------------- From: Ian Goodacre Not sure about the skip and files arguments. You might try: mt -f /dev/nrmt1h rewind mt -f /dev/nrmt1h fsf 1 dd if=3D/dev/nrmt1h of=3D/dev/nrmt0h bs=3D61440 dd if=3D/dev/nrmt1h of=3D/dev/nrmt0h bs=3D61440 dd if=3D/dev/nrmt1h of=3D/dev/nrmt0h bs=3D61440 ... Perhaps a bit crude, but it might work. Ian Goodacre Computer and Telecommunication Services (CTS) Management Board Secretariat 155 University Avenue, 8th floor Toronto, Ontario, M5H 3B7 Tel: 416-327-1092 Fax: 416-327-3281 -------------------------------------------------------------------------- From: Lars Bro Well, it simply must work.... You will need to run dd repeatedly once for each file, DEV_1=/dev/nrmt1h DEV_2=/dev/nrmt2h while dd if=DEV_1 of=DEV_2 do true done What puzzles me is that you manually write and end-of-file marker at end of the first tar(a marker comes when 1st tar closes). I never did that, maybe you got this: dummy_tar EOF EOF 1st vdump EOF 2nd vdump ^ | | And this is what you try to read with mt fsf 1 -------* yours, Lars Bro Lars Bro lbr@dksin.dk ABB Daimler-Benz Transportation Signal A/S +45 36 39 01 77 -------------------------------------------------------------------------- From: "Thomas.Meyer" Dear Mr. Rajah, you might try the "tcopy" command (see man-page). It does a complete copy from one tape to another. Regards, Thomas Meyer, EDV-Systemadministrator email: Thomas.Meyer@dla-marbach.de smail: Deutsches Literaturarchiv Marbach Schillerhoehe 8-10 D-71672 Marbach Telefon: +49-7144-848-141 Fax: ...-387 WWW: http://www.dla-marbach.de -------------------------------------------------------------------------- From: tsh@mrc-lmb.cam.ac.uk (T. S. Horsnell) Tried tcopy? Cheers, Terry. Terry Horsnell (tsh@mrc-lmb.cam.ac.uk) Computer Manager Medical Research Council Lab of Molecular Biology Hills Road CAMBRIDGE CB2 2QH U.K. -------------------------------------------------------------------------- From: "C.J.Bol" mahendra, there is a 'tcopy'-program in Digital Unix. Regards, Kees Bol -------------------------------------------------------------------------- From: Mervyn Weis Hello Mahendra, I don't know if this will help, but have a look at the tcopy utility (# man tcopy). You might have to do some tape manipulation with the mt command for multiple vdump images as the tcopy utility "assumes that there are two tape marks at the end of the source tape when copying or reading". Nonetheless, it might be worth a try. Hope this helps. Good Luck and Regards, Merv Weis e-mail: Mervyn.Weis@compaq.com --------------------------------------------------------------------------