DD is a very useful command under Linux/unix, which is used to test the sequential read-write capability of a hard disk by copying a file with a specified size and making the specified conversion at the same time as the copy. Can write files, can write bare devices.
DD syntax
Function Description: Read, transform and output data.
Syntax: dd [bs=< bytes >][cbs=< bytes >][conv=< keywords >][count=< blocks >][ibs=< bytes >][if=< file >][ obs=< bytes >][of=< Files >][seek=< blocks >][skip=< number of blocks >][--help][--version]
Supplemental NOTE: DD can read data from standard input or file, convert data in specified format, and then output to file, device or standard output.
Parameters
bs=< bytes > Sets the IBS (input) and the OBS (output) to the specified number of bytes.
cbs=< bytes > conversions, only the specified number of bytes is converted at a time.
conv=< keywords > Specify how files are converted.
count=< block Count > read only the specified number of blocks.
The number of bytes ibs=< > bytes per read.
if=< file > read from file.
Number of bytes obs=< > bytes per output.
of=< file > output to file.
seek=< block count > First output, skip the specified number of blocks.
Number of skip=< blocks > skips the specified number of blocks at the start of a read.
--help Help.
--version Displays version information.
DD Common Parameter detailed explanation
If=xxx reads from XXX, such as If=/dev/zero, which provides an exhaustive 0 of the device (does not generate read disk IO)
Of=xxx write to XXX, you can write files, you can write bare equipment. such as Of=/dev/null, "black hole", it is equivalent to a write-only file. All content written to it is lost forever. (Does not generate write-disk IO)
bs=8k the size of each read or write, that is, the size of a block.
Total number of count=xxx read and write blocks.
HDD IO Performance test
DD If=/dev/zero of=test bs=64k count=4k
DD If=/dev/zero of=test bs=1m count=256
It's usually quick.
Try again without writing to the cache, write the hard drive directly
DD If=/dev/zero of=test bs=64k count=4k Oflag=dsync
It's usually a cup. Test results, if more than 10M, the normal station will have no effect. More than 50M, is very to the state of power.
This test hard disk IO performance, the hard disk damage is very large, do not recommend multiple or long time to try!