Bug 39439 - tcopy(1) will not duplicate tapes with block size larger than 64kbytes
Summary: tcopy(1) will not duplicate tapes with block size larger than 64kbytes
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 4.5-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-17 21:30 UTC by Bryan Kropp
Modified: 2017-12-31 22:29 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan Kropp 2002-06-17 21:30:03 UTC
The tcopy program will not duplicate tapes with block sizes larger than 64kbytes.  This is simple to change, as the buffer allocated for tape block copying can be changed (one line in source code for tcopy).  In the past, 64k was a pretty large block size, but many modern tape drives from my company and others now recommend block sizes of 128k to 256k for maximum performance, so many tapes are written in these block sizes.

Fix: 

A good short term fix is simply to modify one line in tcopy.c

Change:  #define MAXREC  (64 * 1024)
To:      #define MAXREC  (256 * 1024)

This will allow larger tape block sizes to be written.  I have tried this with various STK tape drives with success after changing just this line and recompiling.
How-To-Repeat: Simply create a tape on any tape drive with block sizes above 64k.

dd if=/dev/zero of=/dev/sa0 bs=256k

Then rewind and tcopy the tape.  Tape must be copied to another tape for the problem to show up, just tcopy /dev/sa0 will read the tape and see the blocksizes just fine.  It's when you tcopy /dev/sa0 /dev/sa1 that things fail.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2012-06-12 04:29:50 UTC
Responsible Changed
From-To: freebsd-bugs->eadler

I'll take it.
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2012-09-02 18:05:21 UTC
Responsible Changed
From-To: eadler->freebsd-bugs

I won't be looking at this PR for a while and I need to clear some out 
of my queue
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:19 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped