2009-06-27

How to check hard disk transfer speed or timing

Storage are getting cheaper and cheaper. Almost a year ago, a 250 GB 2.5" portable hard disk would cost 120 bucks. But now, it only cost 100 bucks for a 500 GB hard disk. Size are getting bigger and bigger with the same monetary value but does the hard disk spins fast enough to fetch the big "gigabytes" in time? Of cause, given "enough" time, any rate of spin could fetch any size of data. Files are getting larger and larger, especially audio & video files. Fetching the files in an reasonable time is crucial.

Before we proceed to check out the command on how to check hard disk transfer speed or read timings, we will need to familiarize our self with hard disk naming convention. Here is a simple guide on how to identify hard disk naming convention in /dev (where device node are store) :

In Linux

hd = PATA / (E)IDE hard disk
sd = SATA / SCSI hard disk
a = First hard disk (primary master)
b = Second hard disk (primary slave)
c = Third Hard disk (secondary master)
d = Forth Hard disk (secondary slave)
1, 2, 3 ... = 1st partition, 2nd partition, 3rd partition and so on

Example 1 :

/dev/hdc2 = PATA or IDE (hd), third hard disk (c) & 2nd partition (2)

Example 2 :

/dev/sda4 = SATA (sd), first hard disk (a) & forth partition (4)


In FreeBSD

ad = PATA / (E)IDE hard disk
da = SATA / SCSI hard disk
0, 1, 2 ... = 1st hard disk (0), 2nd hard disk (1), 3rd hard disk (2) and so on ... (hard disk number starts at 0 as first hard disk)
s1, s2, s3 ... = slice1, slice2, slice3 and so on ... (slice number starts at 1 as first slice)

Example 1 :

/dev/ad0s4 = 1st PATA or IDE hard disk (ad0), 4th slice (s4)


Example 2 :

/dev/da3s1 = 3rd SATA or SCSI hard disk (da3), 1st slice (s1)


Do take note that even though we have brief through on hard disk partition and slice, we won't be using it as we are testing the hard disk as a whole (physical) and not partition or slice.

Next, how do we know the hard disk is spinning or transfer fast enough? Here is a way to check :

In Linux

To test the spin speed of device and read timings
hdparm -tT <hard disk node label>

e.g.

hdparm -tT /dev/sda, hdparm -tT /dev/hdb

To check the firmware info
hdparm -I <hard disk node label>

e.g.

hdparm -I /dev/sda, hdparm -I /dev/hdb

(or with "hdparm -I /dev/sda | grep SATA" for simpler output)


In FreeBSD

To test the spin speed of device and read timings
diskinfo -ct /dev/<hard disk node label>

e.g.

diskinfo -ct /dev/ad4, diskinfo -ct /dev/da0


To check the firmware info
atacontrol cap <hard disk lable without full path>

e.g.

atacontrol cap ad4, atacontrol cap da0

Adios !!!

No comments: