How to test Linux disk read and write speed using the DD command

Source: Internet
Author: User

1, first familiar with two special equipment:
(1)/dev/null: Recycle Bin, bottomless pit.
(2)/dev/zero: produces characters.

2. Test disk write capability

Copy the Code code as follows:
Time DD If=/dev/zero of=/testw.dbf bs=4k count=100000


Because/dev//zero is a pseudo-device, it produces only a stream of empty characters, it does not produce Io, so the IO is concentrated in the of file, the of file is used only for writing, so this command is equivalent to the write capability of the test disk. Adding Oflag=direct at the end of the command skips the memory cache, and adding Oflag=sync skips the HDD cache.

3. Test disk reading Ability

Copy the Code code as follows:
Time DD If=/dev/sdb Of=/dev/null bs=4k


Because/dev/sdb is a physical partition, reading it will produce io,/dev/null is a pseudo device, equivalent to a black hole, of which the device does not produce IO, so the IO of this command only occurs on the/DEV/SDB and is equivalent to the read capability of the test disk. (CTRL + c termination test)


4, test and read and write ability

Copy the Code code as follows:
Time DD If=/dev/sdb of=/testrw.dbf bs=4k


Under this command, one is a physical partition, one is the actual file, and the read/write will produce IO (read to/dev/sdb, write to/TESTRW.DBF), assuming they are all on a disk, this command is equivalent to testing the disk while reading and writing ability.

How to test Linux disk read and write speed using the DD command

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.