The operating system has the option of being able to check the hard drive and its current state, automatically notifying the user if the failure rate increases through the Smartmontools. This is a package of 2 programs: smartctl and smartd.
Smartctl allows control to self-monitor, analyze, report on ATA-3 and other hard drives and SSDs.
Here at LinuxAPT, we shall look into how to install smartctl on Ubuntu 20.04.
1. Perform System Update
To begin, Update the system's packages by running the below command:
$ sudo apt update
2. Install smartmontools
Now, install the smartmontools package with the below command:
$ sudo apt install smartmontools
3. Check System Drive type
Here, check if your drive is SMART type with the below command:
$ sudo smartctl -i /dev/sda
4. Enable smartctl to auto-launch
Now, enable smartctl to auto-launch with the below command:
$ sudo smartctl -s on /dev/sda
To uninstall only the smartmontools package we can use the following command:
$ sudo apt-get remove smartmontools
We can use the following command to remove smartmontools configurations, data and all of its dependencies, we can use the following command:
$ sudo apt-get -y autoremove --purge smartmontools
This article covers the complete steps to install smartctl on Ubuntu 20.04. In fact, the smartmontools package contains two utility programs (smartctl and smartd) to control and monitor storage systems using the Self-Monitoring, Analysis and Reporting Technology System (S.M.A.R.T.) built into most modern ATA and SCSI hard disks. It is derived from the smartsuite package, and includes support for ATA/ATAPI-5 disks. It should run on any modern Linux system.
How to Install smartmontools Using apt-get on Ubuntu / Debian system ?
1. Update apt database with apt-get using the following command:
$ sudo apt-get update
2. After updating apt database, We can install smartmontools using apt-get by running the following command:
$ sudo apt-get -y install smartmontools