Introduction
In this tutorial we learn how to install hd-idle
on Ubuntu 22.04.
What is hd-idle
hd-idle is:
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: hard disks don’t like spinning up too often. 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: hd-idle will spin down any disk 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
It is not recommended to use 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.
There are three methods to install hd-idle
on Ubuntu 22.04. We can use apt-get
, apt
and aptitude
. In the following sections we will describe each method. You can choose one of them.
Install hd-idle Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install hd-idle
using apt-get
by running the following command:
sudo apt-get -y install hd-idle
Install hd-idle Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install hd-idle
using apt
by running the following command:
sudo apt -y install hd-idle
Install hd-idle Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude
using the following command.
sudo aptitude update
After updating apt database, We can install hd-idle
using aptitude
by running the following command:
sudo aptitude -y install hd-idle
How To Uninstall hd-idle on Ubuntu 22.04
To uninstall only the hd-idle
package we can use the following command:
sudo apt-get remove hd-idle
Uninstall hd-idle And Its Dependencies
To uninstall hd-idle
and its dependencies that are no longer needed by Ubuntu 22.04, we can use the command below:
sudo apt-get -y autoremove hd-idle
Remove hd-idle Configurations and Data
To remove hd-idle
configuration and data from Ubuntu 22.04 we can use the following command:
sudo apt-get -y purge hd-idle
Remove hd-idle configuration, data, and all of its dependencies
We can use the following command to remove hd-idle
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge hd-idle
References
Summary
In this tutorial we learn how to install hd-idle
package on Ubuntu 22.04 using different package management tools: apt
, apt-get
and aptitude
.