If you want to ensure that your computer performs optimally, it is crucial that your HDD / SSD performs well. Though laptops and desktops are very resilient, you should keep checking the health of the components to ensure the longevity. A data storage device is a core-component of any computer. The two main types are known as HDD aka Hard Disk Drive and SSD aka Solid-State Drive. The main differences between these two boils down to the price and the IO speeds.

Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform related Linux system performance queries.

In this context, we shall look into how you can check the health of your HDD/SSD in Ubuntu 20.04.

Different ways to check your HDD / SSD Health in Ubuntu ?

HDD / SSD Health checks can be performed via the GUI solution (GNOME Disks) as well as through a command line tool.

1. Checking HDD / SSD Health via the interface

Here, you can perform the tests without much knowledge of terminal commands.

i. You can start by opening up the "Disks" Application.

ii. You can either start by pressing the "window" key or by clicking on "Activities" in the upper left corner of the screen.

iii. When the text box for search pops up, type "Disks", now click on the icon and launch the application.

iv. Once the application opens up, it will list the data storage devices in your computer.

v. Then, Select the HDD/SSD you want to test. Now:

  • Open the options menu, it's next to the minimize button.
  • Select "SMART Data and Tests"

In the window that opens up, you’ll be able to see the status of your data storage device.

If there are multiple storage devices, you can go back to the previous window and select the other device to test it.

2. Checking HDD / SSD Health via the terminal

Via the terminal, you'll need to start by installing the SmartCtl package. In your terminal, type the following:

$ sudo apt-get install smartmontools -y

Once done, you'll need to start the service through the following command:

$ systemctl start smartd

Since you need the service running, you need to check the status of the service before running any tests. Type this command to check the status:

$ systemctl status smartd

How to test the health of your HDD/SSD ?

Once the service has been started, get the information of your hard drive through the following command:

$ sudo smartctrl -i /dev/sda

Now you can launch a short test, using the following command:

$ sudo smartctl -t short -a /dev/sda

Through this short test, you'll test the electrical and mechanical properties along with read/verify.

Also, you can run a long test, using the following command:

$ sudo smartctl -t long -a /dev/sda

Through this long test, you'll get everything included in the short test along with much more.

If you want to inspect the overall health of your data storage device, type and run the following:

$sudo smartctl -d ata -H /dev/sda

You'll get the following short output, and rather than stats, you'll see if the test passed or failed.

If you want to explore all the possible options you can use with the smartctl command, you can pull it up by using the following:

$smartctl --help

You'll get all the arguments and parameters you can mix and match to customize the tests as extensive and comprehensive as possible.

[ Need to optimize your Linux system Hard Disk Drives ? We can help you. ]


More Linux Tutorials

We create Linux HowTos and Tutorials for Sys Admins. Visit us on IbmiMedia.com

Also for Tech related tips, Visit forum.outsourcepath.com or General Technical tips on www.outsourcepath.com