hdparm: HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device


I just wanted to benchmark the read speed of the hard drives in my server using hdparm, but got the following warning message:

HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate ioctl for device

I have fixed this by updating hdparm to its newest version:

Download, untar and install hdparm:

# wget “http://downloads.sourceforge.net/project/hdparm/hdparm/hdparm-9.37.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fhdparm%2F&ts=1318527426&use_mirror=sunet” -O hdparm.tgz
# tar zxvf hdparm.tgz
# cd hdparm-9.37/
# make
# make install
# hdparm -V
hdparm v9.37

Re-run hdparm and you will see that the warning message is not there anymore.