System Administration Guide: Basic Administration

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 standard input to standard output.


Note –

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


You can specify a device name in place of standard input or standard output, or both. In this example, the 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 standard input and standard output with this syntax:


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

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


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