#!/usr/bin/perl # # rawtest /dev/raw/rawX # # test hd performance of raw device. See raw(8) # # (c) Tomas Pospisek. Licensed under the GPL V2. # # How many blocks should be accessed my $BLOCKS=10000; help() if $ARGV[0] eq "--help"; my $rawdevice = $ARGV[0]; if(`stat --format="%t %T" $rawdevice 2>/dev/null` ne "a2 1\n") { print "Usage: rawtest /dev/raw/rawX\n"; print "Error: You need to supply a raw device as argument!\n"; print " Try \"rawtest --help\".\n"; exit 1; } print "Testing $rawdevice will DESTROY all data on that device?\n"; print "Press \"Enter\" if you want to proceed and \"CTRL-C\" to abort\n"; my $enter=; print "Read performace:\n"; print `time dd if=$rawdevice of=/dev/null count=$BLOCKS`."\n"; print "Write performace:\n"; print `time dd if=/dev/zero of=$rawdevice count=$BLOCKS`."\n"; print "\n"; exit 0; sub help() { print <