In this tutorial, we will show you how to install Smartctl on Ubuntu 22.04 LTS. For those of you who didn’t know, Smartctl is a command-line tool that allows users to monitor the health and performance of storage devices such as hard drives, solid-state drives, and USB drives. The tool was developed to work with Self-Monitoring, Analysis, and Reporting Technology (SMART) devices, which are built into many storage devices. Smartctl is available for Linux, Windows, and macOS operating systems. It can be installed on Linux systems through the package manager of various distributions such as Debian-based, Ubuntu, and Fedora.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the Smartctl monitoring tool on Ubuntu 22.04 (Jammy Jellyfish). You can follow the same instructions for Ubuntu 22.04 and any other Debian-based distribution like Linux Mint, Elementary OS, Pop!_OS, and more as well.
Prerequisites
- A server running one of the following operating systems: Ubuntu 22.04, 20.04, and any other Debian-based distribution like Linux Mint.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for Smartctl.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Smartctl on Ubuntu 22.04 LTS Jammy Jellyfish
Step 1. First, make sure that all your system packages are up-to-date by running the following apt
commands in the terminal.
sudo apt update sudo apt upgrade sudo apt install wget apt-transport-https gnupg2 software-properties-common
Step 2. Installing Smartctl on Ubuntu 22.04.
By default, the Smartctl is available on Ubuntu 22.04 base repository. Now run the following command below to install the latest version of Smartctl to your Ubuntu system:
sudo apt install smartmontools
After the installation is complete, you can check if Smartctl is installed successfully or not. You can do this by running the following command in your terminal:
smartctl --version
Step 3. Using Smartctl.
Now that you have successfully installed Smartctl on your system, you can use it to monitor your hard drive’s health and other attributes.
- To check the basic information about a drive, use the following command:
sudo smartctl -i /dev/sda
This will display information about the drive, including the model name, serial number, firmware version, and more.
- To check the status of your hard drive, you can use the following command:
sudo smartctl -H /dev/sda
This command will display the overall health of your hard drive. If the output says “PASSED,” your hard drive is in good condition. If it says “FAILED,” you should immediately back up your data and replace your hard drive.
- To check the attributes of your hard drive, you can use the following command:
sudo smartctl -A /dev/sda
This command will display the list of all attributes of your hard drive, along with their current values and thresholds. You can use this information to monitor your hard drive’s performance and detect any issues before they become critical.
Congratulations! You have successfully installed Smartctl. Thanks for using this tutorial for installing the Smartctl on Ubuntu 22.04 LTS Jammy Jellyfish system. For additional help or useful information, we recommend you check the official Smartctl website.