挂载上驱动盘,从终端进入此盘目录下。然后使用 DD 命令,首先写入固定大小块的一个文件,接着读取这个文件。
DD 命令通用语法格式如下:
dd if=path/to/input_file of=/path/to/output_file bs=block_size count=number_of_blocks
当写入到驱动盘的时候,我们简单的从无穷无用字节的源 /dev/zero 读取,当从驱动盘读取的时候,我们读取的是刚才的文件,并把输出结果发送到无用的 /dev/null。在整个操作过程中, DD 命令会跟踪数据传输的速度并且报告出结果。
1、写入速度测试:
root@windows:/data# dd if=/dev/zero of=/data/largefile bs=64k count=24000
24000+0 records in
24000+0 records out
1572864000 bytes (1.6 GB) copied, 61.7703 s, 25.5 MB/s
2、读取速度测试:
root@windows:/data# dd if=./largefile of=/dev/null bs=4k
384000+0 records in
384000+0 records out
1572864000 bytes (1.6 GB) copied, 50.9135 s, 30.9 MB/s
root@windows:/data#
注意:本文归作者所有,未经作者允许,不得转载