Bug 15048

Summary: tcopy reports incorrect values
Product: Base System Reporter: jegjr <jegjr>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description jegjr 1999-11-22 17:10:00 UTC
Whenever I perform a dump, and then try to use tcopy to verify, tcopy
always adds a 0 to 1K (1024 -> 10240) and truncates the last digit
from the number of records.  I have provided a copy of a dump output and
tcopy output below.  

OBTW: From dmesg:

ahc0: <Adaptec 2940 Ultra SCSI adapter> rev 0x00 int a irq 9 on pci0.10.0
ahc0: aic7880 Wide Channel A, SCSI Id=7, 16/255 SCBs

and

sa0 at ahc0 bus 0 target 4 lun 0
sa0: <Seagate STT8000N 3.22> Removable Sequential Access SCSI-2 device
sa0: 10.000MB/s transfers (10.000MHz, offset 15)

******************************************************************* 

This is the output from dump:

# dump -0 -B 4000000 -f /dev/nrsa0 /
  DUMP: Date of this level 0 dump: Mon Nov 22 11:46:10 1999
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rwd2s1a (/) to /dev/nrsa0
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 30996 tape blocks on 0.01 tape(s).
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
  DUMP: DUMP: 31144 tape blocks on 1 volumes(s)
  DUMP: finished in 63 seconds, throughput 494 KBytes/sec
  DUMP: Closing /dev/nrsa0
  DUMP: DUMP IS DONE

Dump reports 31144 tape blocks

The output from tcopy: 

# tcopy
file 0: block size 10240: 3114 records
file 0: eof after 3114 records: 31887360 bytes

tcopy adds a 0 to block size and truncates 31144 to 3114

How-To-Repeat: Do a dump, then use tcopy to verify.
Comment 1 Poul-Henning Kamp freebsd_committer freebsd_triage 1999-12-22 16:36:04 UTC
State Changed
From-To: open->closed

Since 9-track tapes dump has used a 10k blocksize as default.  I'm not sure 
why it reports in 1k blocks, but know that changing the output format af 
dump affects many backup tools like amanda so inertia is very significant. 
Anyway, try to specify -b 1 to dump if you really want 1K block size.