Linux DD command to test disk read/write performance

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.