Sometimes it is useful to get some more information about your hard drive than just the size remaining. For this purpose there is a Linux package called smartmontools available, which can be easily installed.
1 |
$ sudo apt-get install smartmontools |
Once available you can inspect different quantities and qualities of your drive by issuing smartctl commands. A good article is available over at TechRepublic.com written by Vincent Danen
The tools will be installed to /usr/sbin/smartctl. In case you are on a machine that does not have sbin in it’s path (I was working on a bananapi, which does not) you will have to precede the commands with the full path.
Some commands and their output are given below.
Get the basic information from your drive
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
$ sudo smartctl -i /dev/sda smartctl 6.4 2014-10-07 r4002 [armv7l-linux-3.4.112-bananian] (local build) Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Model Family: Western Digital Red (AF) Device Model: WDC WD20EFRX-68EUZN0 Serial Number: WD-WCC4M0AX088S LU WWN Device Id: 5 0014ee 2b66bd176 Firmware Version: 82.00A82 User Capacity: 2.000.398.934.016 bytes [2,00 TB] Sector Sizes: 512 bytes logical, 4096 bytes physical Rotation Rate: 5400 rpm Device is: In smartctl database [for details use: -P show] ATA Version is: ACS-2 (minor revision not indicated) SATA Version is: SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s) Local Time is: Sun Apr 16 17:57:13 2017 CEST SMART support is: Available - device has SMART capability. SMART support is: Enabled |
Starting a short test
1 |
$ sudo smartctl --test=short /dev/sda |
Viewing the test results
The test results will be at the end of the ouptut provided by smartctl -a. Test information starts with a hash.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
$ sudo smartctl -a /dev/sda SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Short offline Completed without error 00% 8034 - SMART Selective self-test log data structure revision number 1 SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS 1 0 0 Not_testing 2 0 0 Not_testing 3 0 0 Not_testing 4 0 0 Not_testing 5 0 0 Not_testing Selective self-test flags (0x0): After scanning selected spans, do NOT read-scan remainder of disk. If Selective self-test is pending on power-up, resume after 0 minute delay. |