建议先从了解 iostat命令开始: Linux iostat命令详解
[root@shell jao]
[ ! -x /usr/bin/iostat ] && echo "iostat:command not found"&& exit 1
io(){
Device_name=sd
Device_length=`iostat -d -x | egrep "^$Device_name[[:alpha:]]|^dm" |wc -l`
iostat -x 1 3 | egrep "^sd[[:alpha:]]|^dm" |tail -n +$((Device_length+1)) | awk '{io_long[$1]+=$9}END{for (i in io_long)print io_long[i],i}'
echo "-----"
}
for ((i=1;i<6;i++));do
io
done
测试: 温馨提示:dd命令很暴力的 生产环境可不能这么玩 !!!!
mount /dev/sdc4 /mnt/t1/
cd /mnt/t1/
dd if=/dev/zero of=t1 bs=100M count=10
|