How to test the disk read/write speed in linux using the dd command

Source: Internet
Author: User
This article describes how to use the dd command to test the disk read/write speed in linux. For more information, see

1. familiarize yourself with two special devices:
(1)/dev/null: Recycle Bin and bottomless pit.
(2)/dev/zero: generate characters.

2. test the disk write capability

Copy codeThe code is as follows:
Time dd if =/dev/zero of =/testw. dbf bs = 4 k count = 100000

Because/dev // zero is a pseudo device, it only produces a null compaction stream and does not generate IO for it. Therefore, IO is concentrated in the of file, and the of file is only used for writing, therefore, this command is equivalent to testing the disk write capability. Adding oflag = direct at the end of the command will skip the memory cache, and adding oflag = sync will skip the hdd cache.

3. test the disk read capability

Copy codeThe code is as follows:
Time dd if =/dev/sdb of =/dev/null bs = 4 k

Because/dev/sdb is a physical partition, reading it will generate IO,/dev/null is a pseudo device, which is equivalent to a black hole, of this device will not generate IO, so, the IO of this command only occurs on/dev/sdb, which is equivalent to testing the disk's read capability. (Ctrl + c terminate the test)


4. test the simultaneous read/write capability

Copy codeThe code is as follows:
Time dd if =/dev/sdb of =/testrw. dbf bs = 4 k

In this command, one is a physical partition, and the other is an actual file. IO will be generated for reading and writing them (for/dev/sdb, read, for/testrw. dbf is write). if they are all in one disk, this command is equivalent to testing the disk's simultaneous read/write capability.

Related Article

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.