How to Fix “-bash: hdparm: command not found” on Linux CentOS 6.3

hard diskQuestion:
When i try to run hdparm command to check to check the hard drive read and writing speed, the following error has been returned. Hdparm is a command line utility to measure sequential disk performance which is primarily used to tune and optimize disk parameters. Hdparm is free software under the BSD license.

[root@centos63 ~]# hdparm -t /dev/sda
-bash: hdparm: command not found

To Fix this, install hdparm command line utility on CentOS 6.3 using two method :

Method 1: Install hdparm using yum command :

[root@centos63 ~]# yum install hdparm -y

Example :

[root@centos63 ~]# yum install hdparm -y
Loaded plugins: fastestmirror, presto, priorities
Loading mirror speeds from cached hostfile
 * base: mirrors.sin3.sg.voxel.net
 * extras: mirrors.sin3.sg.voxel.net
 * updates: mirror.issp.co.th
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package hdparm.i686 0:9.16-3.4.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package               Arch                Version                        Repository           Size
====================================================================================================
Installing:
 hdparm                i686                9.16-3.4.el6                   base                 72 k

Transaction Summary
====================================================================================================
Install       1 Package(s)

Total download size: 72 k
Installed size: 134 k
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 72 k
hdparm-9.16-3.4.el6.i686.rpm                                                 |  72 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : hdparm-9.16-3.4.el6.i686                                                         1/1
  Verifying  : hdparm-9.16-3.4.el6.i686                                                         1/1

Installed:
  hdparm.i686 0:9.16-3.4.el6

Complete!

Method 2 : Install hdparm using RPM packages as per OS and bit :

For 32 Bit :

[root@centos63 ~]# rpm -Uvh http://mirrors.hostemo.com/CentOS/6.3/os/i386/Packages/hdparm-9.16-3.4.el6.i686.rpm

For 64 Bit :

[root@centos63 ~]# rpm -Uvh http://mirrors.hostemo.com/CentOS/6.3/os/x86_64/Packages/hdparm-9.16-3.4.el6.x86_64.rpm

Verify if the hdparm RPM is installed or not by using the following command :

[root@centos63 ~]# rpm -qa | grep hdparm
hdparm-9.16-3.4.el6.i686
As always if you need any help you can reach us on twitter @ehowstuff or drop us a comment below. Jumping through archives page to read more articles..