Linux Hard Disk Speed Tests

by lifeLinux on May 8, 2011

While having a large hard drive is good for storing lots of data, it is also important for your computer to have a fast hard drive. Faster hard drives help your computer run more smoothly. You can use the hdparm tool or dd command to determine your disk speeds from the Linux command line.

List Hard Drives

Open a terminal or go to a command line on your Linux system. As root, run the command:

[root@server2 ~]# fdisk -l

Sample outputs:

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14         274     2096482+  83  Linux
/dev/sda3             275         535     2096482+  82  Linux swap / Solaris
/dev/sda4             536       30400   239890612+   5  Extended
/dev/sda5             536       30400   239890581   83  Linux

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          13      104391   83  Linux
/dev/sdb2              14         274     2096482+  83  Linux
/dev/sdb3             275         535     2096482+  82  Linux swap / Solaris
/dev/sdb4             536       30400   239890612+   5  Extended
/dev/sdb5             536       30400   239890581   83  Linux

hdparm command

You can use the hdparm command to check hard disk speed. It provides a command line interface to various hard disk ioctls supported by the stock Linux ATA/IDE/SATA device driver subsystem. Login as the root and enter the following command:

[root@server2 ~]# hdparm -tT /dev/sda

Sample outputs:

/dev/sda:
 Timing cached reads:   29084 MB in  2.00 seconds = 14574.71 MB/sec
 Timing buffered disk reads:  308 MB in  3.01 seconds = 102.36 MB/sec

Note:
-t :perform device read timings
-T :perform cache read timings
/dev/sda : Hard disk device file

dd Command

You can use the dd command as follows to get speed info too:

[root@server2 ~]# dd if=/dev/zero of=/tmp/test.img bs=8k count=256k
[root@server2 ~]# rm /tmp/test.img

Sample outputs:

dd: writing `/tmp/test.img': No space left on device
210779+0 records in
210778+0 records out
1726697472 bytes (1.7 GB) copied, 22.3398 seconds, 77.3 MB/s

Related Posts:

Previous post:

Next post: