Testing the Data Rate of a Hard Disk using dd – Here the Samsung SP2504C 250GB

If you want to see the read-speed diagram right away, click here.

When I replaced my Samsung SP2504C (250GB) by a larger (and faster one) I copied the full content of the old Samsung hard disk to the new hard disk. I used this opportunity to measure the read speed of the Samsung SP2504C (the newer one was able to write at a much higher speed so the Samsung was the limiting factor.

So I connected the faster hard disk drive (/dev/sdb/) and copied all data including all partitions and the partition table from the Samsung drive to it using dd:

sudo dd if=/dev/sda of=/dev/sdb bs=1M & ddpid=$! 
while [ "`ps -a | grep $ddpid`" ]
do
  sleep 10
  sudo kill -SIGUSR1 $ddpid
done

Basically the dd command is copying the content of /dev/sda byte-by-byte to /dev/sdb. While doing so, we send the signal USR1 to the dd process every 10 seconds and thus get transfer statistics from back from dd.
The output looked like this:

[1] 4196
575+0 records in
574+0 records out
601882624 bytes (602 MB) copied, 10.0515 s, 59.9 MB/s
1153+0 records in
1152+0 records out
1207959552 bytes (1.2 GB) copied, 20.0895 s, 60.1 MB/s
1724+0 records in
1723+0 records out

[...]

so I removed the very first line and saved the file as speed_proto_cropped.txt

601882624 bytes (602 MB) copied, 10.0515 s, 59.9 MB/s
1153+0 records in
1152+0 records out
1207959552 bytes (1.2 GB) copied, 20.0895 s, 60.1 MB/s
1724+0 records in
1723+0 records out

[...]

I then used this python script to extract the "derivative" of data: datarate (actually a difference quotient):

When running the Python script it I wrote the output to speed_proto_cropped_2.txt (see here). And then I plotted the data using R:

data <- read.table("speed_proto_cropped_2.txt")
plot(data,main="Data transmission rate (read): Samsung SP2504C 250GB", xlab="MiB from start of HDD",ylab="datarate [MiB/s]")

Or to produce an .eps file as output do:

data <- read.table("speed_proto_cropped_2.txt")
postscript("speed_proto.eps", horizontal=FALSE, onefile=FALSE, height=7, width=13, pointsize=10)
plot(data,main="Data transmission rate (read): Samsung SP2504C 250GB", xlab="MiB from start of HDD",ylab="datarate [MiB/s]")
dev.off()

... producing this graph:

The write speed depending on the position on the hard disk Samsung SP2504C

More Results from other Hard Disks

Test result of the dd speed of a Seagate Momentus 5400.7 640GB, SATA II (ST9640320AS) 2.5" hard disk:
dd speed / Seagate Momentus 5400.7 640GB, SATA II (ST9640320AS) 2.5"

References

Comments