HDPARM saves hard drive life

Once there was a problem with the hard drive, during work it made quite loud clicks with a frequency of one or two clicks every 10-15 minutes. Sometimes there was one click in 30 minutes. At the same time, the system, rarely, but hung for 0.5-1 second.

Checked S.M.A.R.T. data. Its self-checking was good. All parameters were normal. But I noticed that the number of read/write head parking cycles was very high. And that number was increasing very quickly.

After a little googling, I found a description of the hdparm utility, which allows you to monitor and control the parameters of IDE devices. In other words, it allows you to configure the hard drive and any other IDE device.

Registered the execution of the following commands in autoload (/etc/rc.local):

hdparm -B 255 /dev/sda
hdparm -S 0 /dev/sda

The first command disables hard drive power management if a device supports it. Values from 1 to 127 enable head parking, values from 128 to 254 disable it. In this case, the lower the value is the more efficient power management, but the higher the value is the greater the I/O performance. The value 255, you guessed it, disables power management, but on the condition that a device supports it. The second command disables the hard drive hibernating.

After these manipulations, the clicks during work stopped, which is very pleasing. The heads are parked just before the power is turned off, which does not deteriorate the hard drive.

comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy