SMART: Difference between revisions

From Leo's Notes
This page was last edited on 2 December 2020, at 03:46.
m Added categories
Line 1: Line 1:
SMART (Self-Monitoring, Analysis and Reporting Technology) is a monitoring system included in all computer hard drives and solid state drives.
SMART (Self-Monitoring, Analysis and Reporting Technology) is a monitoring system included in all computer hard drives and solid state drives.


== Usage ==
==Usage==
On Linux, install the {{code|smartmon-tools}} package. Use the {{code|smartctl}} utility.
On Linux, install the {{code|smartmon-tools}} package. Use the {{code|smartctl}} utility.


=== Show Disk Information ===
===Show Disk Information===
To show all capabilities, monitored attributes, errors, etc. of a particular disk, run:
To show all capabilities, monitored attributes, errors, etc. of a particular disk, run:
{{highlight|lang=terminal|code=
{{highlight|lang=terminal|code=
Line 10: Line 10:
}}
}}


=== Run Self-Test ===
===Run Self-Test===
Use the {{code|--test=[offline|short|long]}} option to begin a self-test on the device. To abort a test, use the {{code|-X}} or {{code|--abort}} option.
Use the {{code|--test=[offline|short|long]}} option to begin a self-test on the device. To abort a test, use the {{code|-X}} or {{code|--abort}} option.


== Troubleshooting ==
==Troubleshooting==
=== USB Support ===
===USB Support===
When working with hard drives connected via USB, you need to disable USB Attached SCSI (UAS).  Otherwise, {{code|smartctl}} will report:
When working with hard drives connected via USB, you need to disable USB Attached SCSI (UAS).  Otherwise, {{code|smartctl}} will report:
{{highlight|lang=terminal|code=
{{highlight|lang=terminal|code=
Line 24: Line 24:
}}
}}


To disable UAS for a specific USB device, find the USB device associated with the drive. Check {{code|dmesg}} or run {{code|lsusb}}. Unload the {{code|usb-storage}} kernel module and re-load it with a quirk parameter specifying which device to not enable UAS on.
Use one of three methods described in the [[Disable UAS]] page. Once UAS is disabled, {{code|1=smartctl}} should be able to report the SMART parameters. For some devices, you may need to also pass in a <code>-d</code> option to <code>smartctl</code>. Check the supported devices page. https://www.smartmontools.org/wiki/Supported_USB-Devices for more information.
 
{{highlight|lang=terminal|code=
# lsusb
Bus 002 Device 005: ID 0bc2:3343 Seagate RSS LLC
 
# rmmod usb-storage
# modprobe usb-storage quirks=0bc2:3343:u
}}
 
Re-attach the USB device again. This time, {{code|dmesg}} should say that a quirk was detected for this device:
 
{{highlight|lang=text|code=
[947347.271519] usb 2-3.2: New USB device found, idVendor=0bc2, idProduct=3343, bcdDevice= 1.00
[947955.635329] usb-storage 2-3.2:1.0: Quirks match for vid 0bc2 pid 3343: 800000
}}
 
Re-run {{code|smartctl}}. It should be able to see the SMART parameters. For some devices, you may need to also pass in a -d option. Check the supported devices page. https://www.smartmontools.org/wiki/Supported_USB-Devices for more information.
 
To make this kernel module option persistent, create a file in {{code|/etc/modprobe.d}} with {{code|1=options usb-storage quirks=VendorId:ProductId:u}}.


See also: https://askubuntu.com/questions/637450/cannot-perform-smart-data-and-self-test-on-external-hard-drive
See also: https://askubuntu.com/questions/637450/cannot-perform-smart-data-and-self-test-on-external-hard-drive
==Attributes==
Some attributes of note.


== Attributes ==
;Reallocated_Sector_Ct
Some attributes of note.
:Disks automatically remap bad sectors to a pool of reserved sectors. This attribute is the number of sectors that have been reallocated.
;Current_Pending_Sector
:The number of sectors that the disk had issues reading. The sector will be reallocated when either: 1. the sector can be read properly or 2. the sector is written over.


; Reallocated_Sector_Ct
==See Also==
: Disks automatically remap bad sectors to a pool of reserved sectors. This attribute is the number of sectors that have been reallocated.
; Current_Pending_Sector
: The number of sectors that the disk had issues reading. The sector will be reallocated when either: 1. the sector can be read properly or 2. the sector is written over.


== See Also ==
*http://www.t13.org/Documents/UploadedDocuments/docs2008/D1699r6a-ATA8-ACS.pdf
* http://www.t13.org/Documents/UploadedDocuments/docs2008/D1699r6a-ATA8-ACS.pdf


{{Navbox Linux}}[[Category:Linux]]
{{Navbox Linux}}
[[Category:Linux]]
[[Category:LinuxUtilities]]
[[Category:LinuxUtilities]]

Revision as of 03:46, 2 December 2020

SMART (Self-Monitoring, Analysis and Reporting Technology) is a monitoring system included in all computer hard drives and solid state drives.

Usage

On Linux, install the smartmon-tools package. Use the smartctl utility.

Show Disk Information

To show all capabilities, monitored attributes, errors, etc. of a particular disk, run:

# smartctl -a /dev/sda

Run Self-Test

Use the short option to begin a self-test on the device. To abort a test, use the -X or --abort option.

Troubleshooting

USB Support

When working with hard drives connected via USB, you need to disable USB Attached SCSI (UAS). Otherwise, smartctl will report:

# smartctl -a /dev/sdb
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.6.14-300.fc32.x86_64] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

Read Device Identity failed: scsi error unsupported field in scsi command

Use one of three methods described in the Disable UAS page. Once UAS is disabled, smartctl should be able to report the SMART parameters. For some devices, you may need to also pass in a -d option to smartctl. Check the supported devices page. https://www.smartmontools.org/wiki/Supported_USB-Devices for more information.

See also: https://askubuntu.com/questions/637450/cannot-perform-smart-data-and-self-test-on-external-hard-drive

Attributes

Some attributes of note.

Reallocated_Sector_Ct
Disks automatically remap bad sectors to a pool of reserved sectors. This attribute is the number of sectors that have been reallocated.
Current_Pending_Sector
The number of sectors that the disk had issues reading. The sector will be reallocated when either: 1. the sector can be read properly or 2. the sector is written over.

See Also