Linux 中用 dd 命令来测试硬盘读写速度 | 一见知得 | Mr J Blog

Linux 中用 dd 命令来测试硬盘读写速度

Mr J 2663 0

写入速度

$ dd if=/dev/zero of=./largefile bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied,4.82364 s,223 MB/s

读取速度

现在读回这个文件。但是,得首先清除内存的缓存,以确保这个文件确实是从驱动盘读取的。

运行下面的命令来清除内存缓存

$ sudo sh -c "sync && echo 3 > /proc/sys/vm/drop_caches"

然后

$ dd if=./largefile of=/dev/null bs=4k
165118+0 records in
165118+0 records out
676323328 bytes (676 MB) copied,3.0114 s,225 MB/s
发表评论
表情 图片 链接 代码

分享
微信
微博
QQ