Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the dd command to test the read and write speed of Linux disks

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to use dd command to test the read and write speed of Linux disk", in daily operation, I believe many people have doubts on how to use dd command to test the read and write speed of Linux disk, Xiaobian consulted all kinds of information, sorted out simple and easy to use operation method, hope to answer "how to use dd command to test the read and write speed of Linux disk" doubts helpful! Next, please follow the small series to learn together!

In order to test the read and write speed of Linux disk, you can use dd command, dd command is a very useful command, can be used for file copy, the following small series will give you an introduction to how to use dd command to test the read and write speed of Linux disk.

First, get familiar with two special equipment:

(1)/dev/null: Recycle bin, bottomless pit.

(2)/dev/zero: generates characters.

2. Test disk write ability

The code is as follows:

time dd if=/dev/zero of=/testw.dbf bs=4k count=100000

Because/dev//zero is a pseudo-device, it only generates empty character streams and does not generate IO for it, so IO is concentrated in the of file, which is only used for writing, so this command is equivalent to testing the disk's write ability. Adding oflag=direct at the end of the command skips the memory cache, adding oflag=sync skips the hdd cache.

3. Test disk reading ability

The code is as follows:

time dd if=/dev/sdb of=/dev/null bs=4k

Because/dev/sdb is a physical partition, reads to it will generate IO,/dev/null is a pseudo-device, equivalent to a black hole, of to this device will not generate IO, so the IO of this command only occurs on/dev/sdb, which is equivalent to testing the read ability of the disk. Ctrl+C stops the test.

4. Test simultaneous reading and writing ability

The code is as follows:

time dd if=/dev/sdb of=/testrw.dbf bs=4k

Under this command, one is a physical partition and one is an actual file. Reading and writing to them will generate IO (read to/dev/sdb and write to/testrw.dbf). Assuming they are all on a disk, this command is equivalent to testing the simultaneous read and write ability of the disk.

At this point, the study on "how to use dd command to test the read and write speed of Linux disk" is over, hoping to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report