1.測/目錄所在磁盤的純寫速度:
time dd if=/dev/zero bs=1024 count=1000000 of=/1Gb.file
2.測/目錄所在磁盤的純讀速度:
time dd if=/1Gb.file bs=64k |dd of=/dev/null
3.測讀寫速度:
time dd if=/1Gb.file of=/data0/2.Gb.file bs=64k
理論上復制量越大測試越准確。
命令解釋:
time有計時作用,dd用於復制,從if讀出,寫到of。
if=/dev/zero不產生IO,因此可以用來測試純寫速度。
同理of=/dev/null不產生IO,可以用來測試純讀速度。
bs是每次讀或寫的大小,即一個塊的大小,count是讀寫塊的數量。