TCOPY(1)
πΎ tcopy(1) β the tape girlie's field guide π
okay so bestie, you've found yourself in the General Commands Manual section, and the command is tcopy. She reads tapes, writes tapes, copies tapes and verifies tapes. That's the whole personality, and honestly? Iconic. β¨
πΈ NAME πΈ
tcopy β read, write, copy and verify tapes
π¦ SYNOPSIS π¦
tcopy [-crvx] [-l logfile] [-s maxblk] [src [dest]]
π DESCRIPTION π
The tcopy utility is designed to read, write and copy tapes. That's it, that's the job, and she does it well. π
The only assumption made about the tape layout is that there are two sequential EOF marks at the end. That's the one vibe check the tape has to pass. Everything else? We figure it out.
The src argument can be a tape device β and it defaults to /dev/sa0 β or it can be data in SIMH-TAP format. If src is -, then the standard input is read instead. Very "read from the void" of it. π
If the dest argument is also specified, a copy of src will be made onto dest. If dest is -, standard output will be written to. Slay.
If dest is a tape device, the file and record structure will be the same. No notes, it just matches. π
If dest is a filename ending in .000, the contents of each file on src will be written to sequentially numbered files .000, .001, .002 etc. Heads up though: information about record sizes will be lost. Gone. Not invited to the group chat. π
If the -r flag is specified, only the data will be written β information about file and record layout is lost.
Otherwise, the data, file and record structure of src will be written in SIMH-TAP format.
The tcopy utility will report information about the layout of src like this on standard output:
file 0: block size 80: 6 records
file 0: eof after 6 records: 480 bytes
file 1: block size 3072: records 0 to 262
file 1: block size 612: record 262
file 1: eof after 263 records: 805476 bytes
[β¦]
eot
total length: 972851280 bytes time: 41 s rate: 22934.8 kB/s
If dest is - or if -x is specified, this goes to standard error instead, and it can also be redirected with -l logfile β in which case the final total line will also be reported on standard error. Both places. She's thorough like that. π«Ά
If tcopy receives a SIGINFO signal, current counts are reported on standard error.
The following options are available:
β¨ OPTIONS β¨
-cβ Rewind both tapes, copy src to dest, rewind again and verify that the two tapes are now identical. The full circle moment. π-llogfile β Output all informational messages to logfile.-rβ Write only the contents of all data blocks to the output. The file and record structure of the input will be lost. Rip to the structure, but the data is thriving. π-smaxblk β Specify a maximum block size, maxblk. The default iskern.maxphys.-vβ Verify that src and dest are identical. Note that the tapes are not rewound prior to the comparison. Read that again, bestie. π-xβ Output all informational messages to the standard error instead of the standard output. This option is automatic if dest is given as-.
π EXIT STATUS π
Unfortunately all over the place, but zero always means succeess.
(yes, that's the spelling in the manual. we're keeping it. character. π)
not gonna lie, "all over the place" is the most chaotic exit status documentation ever and I respect it deeply. 0 = good vibes only. everything else = good luck bestie. π
π EXAMPLES π
Verify that the tape in /dev/sa0 can be read and see the layout of its content:
tcopy
Copy a tape using two tape drives:
tcopy /dev/sa0 /dev/sa1
Copy a tape using only a single tape drive, and verify the result:
tcopy /dev/sa0 /tmp/temp.tapfile
# change tape
tcopy -c /tmp/temp.tapfile /dev/sa0
Make a cryptographic hash of both the contents and the layout of the tape in /dev/sa1:
tcopy /dev/sa1 - | sha256
Copy a tape to a tape drive on another machine:
tcopy /dev/sa0 - | ssh otherhost tcopy - /dev/sa0
Extract the tape files into individual files:
tcopy /dev/sa0 /tmp/_.tape.000
Ignore all structure on the tape and feed all data to tar(1):
tcopy -l /dev/null -r /dev/sa0 - | tar tvf -
π SEE ALSO π
β STANDARDS β
The SIMH-TAP format is documented in the open-simh github repos:
https://github.com/open-simh/simh/blob/master/doc/simh_magtape.doc
π¦ HISTORY π¦
The tcopy command appeared in 4.3BSD. vintage queen behavior, no cap. π°οΈ
π BUGS π
Modern tape drives may return a SCSI "Incorrect Length Indicator (ILI)" for each read with a different block size that what is on the tape, and that slows tcopy down a lot. This can be disabled with the mt(1) command:
mt param sili -s 1
End of data (EOD) is determined by two sequential EOF marks with no data between them. There used to be old systems which typically wrote three EOF's between tape files. The tcopy utility will erroneously stop copying early in this case. π lowkey tragic.
With -c the tape drives are not rewound at the same time, but one after the other.
fr fr read the bugs section before you file a bug report, bestie. it's giving "it's not a bug it's a documented feature" energy. π
Debian Β· December 20, 2006 β that's the source, the version vibe and the date, all wrapped up with a bow π tysm for reading, now go copy some tapes πβ¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 1985, 1990, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms