How To Install hd-idle on CentOS 7

In this tutorial we learn how to install hd-idle on CentOS 7. hd-idle is Spin down idle [USB] hard disks

Introduction

In this tutorial we learn how to install hd-idle on CentOS 7.

What is hd-idle

hd-idle is a utility program for spinning-down external disks after a period of idle time. Since most external IDE disk enclosures don’t support setting the IDE idle timer, a program like hd-idle is required to spin down idle disks automatically. A word of caution Laptop disks are more robust in this respect than desktop disks but if you set your disks to spin down after a few seconds you may damage the disk over time due to the stress the spin-up causes on the spindle motor and bearings. It seems that manufacturers recommend a minimum idle time of 3-5 minutes, the default in hd-idle is 10 minutes. One more word of caution accessible via the SCSI layer (USB, IEEE1394, …) but it will not work with real SCSI disks because they don’t spin up automatically. Thus it’s not called scsi-idle and I don’t recommend using it on a real SCSI system unless you have a kernel patch that automatically starts the SCSI disks after receiving a sense buffer indicating the disk has been stopped. Without such a patch, real SCSI disks won’t start again and you can as well pull the plug.

We can use yum or dnf to install hd-idle on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install hd-idle.

Install hd-idle on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install hd-idle using yum by running the following command:

sudo yum -y install hd-idle

Install hd-idle on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install hd-idle using dnf by running the following command:

sudo dnf -y install hd-idle

How To Uninstall hd-idle on CentOS 7

To uninstall only the hd-idle package we can use the following command:

sudo dnf remove hd-idle

References

Summary

In this tutorial we learn how to install hd-idle on CentOS 7 using yum and dnf.