My Exabyte has a personality! It hates cp! HELP!!

Brandon S. Allbery KB8JRR/AA allbery at NCoast.ORG
Fri May 3 11:33:58 AEST 1991


As quoted from <1991May2.044713.12583 at coplex.uucp> by dean at coplex.uucp (Dean Brooks):
+---------------
|    We just recently acquired an Exabyte 2.3 gig tape drive for our
| Motorola SYS V.3.2 (V/88) 8864 system, and I have noticed something
| unusual.
| 
| $ cp /tmp/BIGFILE /dev/exabyte
| $ cp /dev/exabyte /tmp/newfile
| 
|    The two files will have different lengths, varying anywhere from
| 1,000 bytes difference to 38,400 bytes difference.  *However*, if I
| use "cpio" to backup the file and then restore it, it works perfectly.
+---------------

Character special mass storage devices, like tapes and disks, generally
require the program to do block-mode access itself.  The difference in sizes
probably depends on how large the first write to the tape is.

Instead of using cp or cat, try dd:

	dd if=/tmp/BIGFILE of=/dev/exabyte bs=20b

The restored file will almost certainly be larger, because it will be padded
to a whole block size (10K in the example above).

(Why do tapes and disks require this in character mode when block special
devices do it for you?  Efficiency:  the block special device has to go
through the Unix buffer pool, the character special device can write directly
from your buffer or even (if the device is smart enough) memory map your
buffer onto the device's own buffer.)

++Brandon
-- 
Me: Brandon S. Allbery			  Ham: KB8JRR/AA  10m,6m,2m,220,440,1.2
Internet: allbery at NCoast.ORG		       (restricted HF at present)
Delphi: ALLBERY				 AMPR: kb8jrr.AmPR.ORG [44.70.4.88]
uunet!usenet.ins.cwru.edu!ncoast!allbery       KB8JRR @ WA8BXN.OH



More information about the Comp.unix.wizards mailing list