1、循环100次fio指令,写磁盘压力测试,测试快速写文件的速度
while true
do
for i in {1...1170};do
echo "===================> i < = = = = = = = = = = = = = = = = = = " f i o − − n a m e = r w t e s t i <==================" fio --name=rw_test i<=================="fio−−name=rwtesti --iodepth=32 --rw=write -bs=512Ki --direct=1 --size=100Mi --numjobs=1 --runtime=240 --group_reporting --ioengine=libaio
sleep 0.8
if [ ( ( (( ((i % 100)) == 0 ];then
df -h
fi
done
done
2、或第二种写法
#!bin/bash
cnt=1
while [ $cnt -lt 50 ]
do
echo "dd cnt $cnt" > /dev/console
dd if=/dev/zero of=/mnt/data/test_${cnt}.txt bs=1024 count=102400
let cnt++
sleep 1
done