Use dd to benchmark drives
I'm trying to test the durability of solid state drives. My goal is to see how many read/write cycles a drive can support and how the performance changes with each cycle. I am using the dd command to first zero-out the drive and then fill it with random data. So far I have:
I want to changes this to do two things:
#Arg 1: Drive directory
#Arg 2: Number of desired cycles
for (( n=1; n<=$2; n++))
echo "Iteration $n"
dd if=/dev/zero of=$1 bs=1M conv=notrunc
dd if=/dev/urandom of=$1 bs=1M conv=notrunc
1. Instead of writing random data in the second step, I want to write all 1's to the drive. This way, every bit is switched from 0 to 1 each time i execute these commands.
2. Save the outputs to a text file so that I can see the performance changes over time.
I have been using
http: //ww w.linuxquestions.org/questions/linux-newbie-8/learn-the-dd-command-362506/
as a reference.
I would appreciate any help on this. Thanks.