TOOL » LINUX » PACKAGE

Dd

Usage

shell
dd OPTIONS
OptionDescription
ifInput file.
ofOutput file.
bsRead and write up to SIZE at a time (default 512 bytes).
countCopy only N input blocks.
oflagPerform the commands in the comma separated list after each block is written.
convPerform the commands in the comma separated list once after all data has been written.
statusInformation to print to stderr. none: only errors; noxfer: no final transfer statistics; progress: periodic transfer statistics.

Use conv=fdatasync to be sure all data was written to the device.

Example

Write ISO into a drive (sudo needed):

shell
dd if=linux.iso of=/dev/sda bs=4M conv=fdatasync

Benchmark write speed of a disk by writing a 2GiB file (for read speed use hdparm):

shell
dd if=/dev/zero of=ddfile bs=1M count=2k conv=fdatasync; rm ddfile

Copy a file into a hard link without breaking the hard link:

shell
dd if=somefile of=hardlink bs=4M conv=notrunc