dd(1)dd(1)Namedd - copy and convert data
Syntaxdd [option = value...]
Description
The command copies an input file to an output file with any requested
conversions. The command is especially suited to I/O on the raw physi‐
cal devices because it allows reading and writing in arbitrary record
sizes.
After completion, reports the number of whole and partial input and
output blocks.
The utility supports EOT handling which allows the use of multiple
media. When writing, the utility prompts for the next volume when it
encounters the end of the current volume. When reading multivolume ar‐
chives, the utility requires that the user specify the number of vol‐
umes in the tape set.
This utility supports the TA90 style sequential stacker loader device.
The device ejects a cartridge when it is taken off line. This utility
performs the device ejection on behalf of the user when it encounters a
multivolume boundary during write or read operations involving tape.
The device then automatically loads the next available tape (if there
is one). The utility then attempts to access this tape before prompt‐
ing the user for a manual reload operation.
Options
Where sizes (n) are given for an option, the number may end with k for
kilobytes (1024 bytes), b for blocks (512 bytes), or w for words (2
bytes). Also, two numbers may be separated by the character x to indi‐
cate a product.
mv=n The number of tapes in a multivolume tape set.
if=name Input file name. The standard input is the
default.
of=name Output file name. The standard output is the
default.
ibs=n Input block size, n bytes. The default is 512
bytes. Some devices do not support greater than
65,535 bytes.
obs=n Output block size, n bytes. The default is 512
bytes. Some devices do not support greater than
65,535 bytes.
bs=n Set both input and output block size to n bytes,
superseding ibs and obs. Also, if bs is specified,
the copy is more efficient, since no blocking con‐
version is necessary.
cbs=n Conversion buffer size, n bytes. Use only if
ascii, unblock, ebcdic, ibm, or block conversion is
specified. For ascii and unblock, n characters are
placed into the conversion buffer, any specified
character mapping is done, trailing blanks are
trimmed and new line added before sending the line
to the output. For ebcdic, ibm, or block, charac‐
ters are read into the conversion buffer, and
blanks added to make an output record of size n
bytes.
skip=n Skip n input records before starting to copy.
files=n Copy n input files before terminating. This option
is useful only when the input is a magnetic tape or
similar device.
seek=n Seek n records from beginning of output file before
copying.
rbuf=n Use n buffers for reading from those raw devices
that support n-buffered I/O. (See Reference Pages
Section 4: Special Files to check whether a spe‐
cific device supports n-buffered I/O.) All n reads
are started and each read must complete before the
data can be used. This allows an n-buffered read-
ahead on supported raw devices.
A default of eight read buffers are used if the
read device supports n-buffered I/O and the write
device does not.
The rbuf option cannot be used with the wbuf
option.
wbuf=n Use n buffers for writing from those raw devices
that support n-buffered I/O. (See Reference Pages
Section 4: Special Files to check whether a spe‐
cific device supports n-buffered I/O.) Each write
is started but not known to be complete until all n
buffers have been used. (This allows an n-buffered
write-behind on supported raw devices).
A default of eight write buffers are used if the
write device supports n-buffered I/O.
The wbuf option cannot be used with the rbuf
option.
count=n Copy only n input records.
conv=ascii Convert EBCDIC to ASCII.
conv=ebcdic Convert ASCII to EBCDIC.
conv=ibm Slightly different map of ASCII to EBCDIC (see
Restrictions).
conv=block Convert variable length records to fixed length.
conv=unblock Convert fixed length records to variable length.
conv=lcase Map alphabetics to lowercase.
conv=ucase Map alphabetics to uppercase.
conv=loader Permits the program to treat the tape drive as a
sequential loader device even though it is not rep‐
resented as such in the system driver tables.
conv=swab Swap every pair of bytes.
conv=noerror Do not stop processing on an error.
conv=sync Pad every input record to ibs.
conv=nomulti Disable multiple tape volumes.
conv=sparse Create a sparse output file.
conv=... , ... Include several arguments for the conv option, sep‐
arated by commas (see example below).
Restrictions
The ASCII/EBCDIC conversion tables are taken from the 256-character
standard in the Communications of the ACM, November, 1968.
The ibm conversion corresponds to certain IBM print train conventions.
One must specify ``conv=noerror,sync'' when copying raw disks with bad
sectors to ensure that stays synchronized.
Do not specify a block size greater than 65535 bytes when performing
device I/O with the TK50 device. This device gives an I/O error when a
size greater than 65535 is given. If you attempt to give a block size
larger than 65535 on other devices and the device returns an I/O error,
try using the maximum size of 65535 bytes.
Also, the buffering scheme employed by the VAX and device drivers lim‐
its the block size to 16 Kbytes.
Furthermore, when writing to tapes, do not use an odd block size value
when specifying the blocking factor. This can result in characters
being dropped on every second block written to the tape.
We recommend that users label their tapes to include the values speci‐
fied in the obs or bs options of the command. This ensures the ability
to correctly specify the tape blocksize in the ibs or bs options used
to read the tape at a later date. The command does not attempt to
autosize the tape. Thus, if the user accidentally uses a smaller
blocksize when reading the tape, the command would appear to succeed
(reporting no errors), but the effect would be to truncate the tape
records on output.
Using a blocking factor other than the default may lead to higher per‐
formance. However, you must select a value that is compatible with the
hardware limitations of the source and destination machines.
Examples
The following example shows how to read an EBCDIC tape blocked ten
80-byte EBCDIC card images per record into the ASCII file x:
dd if=/dev/rmt0h of=x ibs=800 cbs=80 conv=ascii,lcase
Note the use of raw magtape. As noted in the Description, the command
is especially suited to I/O on the raw physical devices because it
allows reading and writing in arbitrary record sizes.
Diagnostics
f+p records in(out): numbers of full and partial records read(written)See Alsocp(1), tr(1), nbuf(4)dd(1)