System Administration Guide, Volume I

Making a Literal File System Copy

The dd command makes a literal (block-level) copy of a complete UFS file system to another file system or to a tape. By default, the dd command copies its standard input to its standard output.


Note -

Do not use the dd command with variable-length tape drives without specifying an appropriate block size.


You can specify a device name in place of the standard input or the standard output or both. In this example, contents of the diskette are copied to a file in the /tmp directory:


$ dd < /floppy/floppy0 > /tmp/output.file
2400+0 records in
2400+0 records out

The dd command reports on the number of blocks it reads and writes. The number after the + is a count of the partial blocks that were copied. The default block size is 512 bytes.

The dd command syntax is different from most other commands. Options are specified as keyword=value pairs, where keyword is the option you want to set and value is the argument for that option. For example, you can replace the standard input and output with this syntax:


$ dd if=input-file of=output-file

For example, to use the keyword=value pairs instead of the redirect symbols in the previous example, you would type:


$ dd if=/floppy/floppy0 of=/tmp/output.file