Smartmontools windows как пользоваться

Some Background …

All modern spinning hard disks and SSD drives contain S.M.A.R.T technology which enables the monitoring of various hard drive parameters, as a means of checking drive health and predicting failure.

Ordinarily, this information isn’t visible to most end users through the OS, you can however access the S.M.A.R.T metrics of your drive using a tool such as SmartMonTools.

SmartMonTools can be used to monitor hard drive health and also to run various built-in hard drive self-test operations…

Hard Drive Image

It’s not uncommon for drives to contain bad sectors over time. Drives will usually detect these hard-to-read sectors and remap the data to known good sectors, all in the background without the user even knowing…

However, sometimes the disk controller will not notice the fault and may need a gentle nudge to help it discover the problem. Running a drive self-test can sometimes resolve such issues. In this guide, I’ll explain how you can do it.

Installation on Windows

First, download and install SmartMonTools from https://www.smartmontools.org/

Open SMARTMONTOOLS > SMARTCTL (ADMIN CMD) from the Windows start menu to launch the console

Viewing Help

Run the below command to list all available commands

smartctl –help
Smartctl

Listing Devices

Run the below command to list available devices

smartctl --scan
Smartctl console

Viewing Disk Information

To view information about a specific disk

smartctl -x <DEVICE>
smartctl -x /dev/sda
Smartctl Console

To view the SMART metrics for a given device, run the below command

smartctl -a <DEVICE>
smartctl -a /dev/sda
Smartctl Console

Self Test

Numerous drive self-tests routines are available, including a ‘Short’ test and ‘Long’ test.

The ‘Short’ test usually takes around 2 minutes to perform a partial scan of the drive subsystems including a partial disk surface scan. On the other hand, the ‘Long’ test will scan each and every individual sector of the drive. This can sometimes resolve disk related performance issues by helping the drive to find hard-to-read sectors and remap them. Note: This scan can take over an hour to complete.

I’d recommend running the ‘Long’ test. There is no risk to losing your data by running this command, however, it may degrade system performance while the scan is being performed.

You can run the ‘Long’ drive self-test as follows:

smartctl -t long
smartctl -t long /dev/sda
Smartctl

You can view the test results by running the following command:

smartctl -a <DEVICE>
smartctl -a /dev/sda
Smartmontools

Graphical User Interface

If you’d prefer a graphical user interface rather than using a command line then check out GSmartControl which provides an easy to use interface for the SmartMonTools command line utility.

You can find it here https://gsmartcontrol.sourceforge.io

GSmartControl Screenshot

GSmartControl Screenshot

Final Thoughts

I hope you’ve found this quick guide to be useful.

If you have any tips please feel free to share in the comments below.

  • About
  • Latest Posts

G’day, I’m a technical solutions consultant based in Perth, Australia that specialises in the Microsoft technology stack, including .NET, Dynamics 365, Azure and general web development etc.

This blog is my place to share my thoughts, helpful solutions and just random nerdy stuff.

Время на прочтение1 мин

Количество просмотров24K

Современный жесткий диск не то место где стоит хранить информацию ©

SmatrmonTools + HDDGuardian почти щастье для мониторинга смарт-состояния винтов на клиентской венде.

code.google.com/p/hddguardian
sourceforge.net/apps/trac/smartmontools/wiki

Нашлось как в линуксах, для серверной части и для рабочих станций, с сервисом, с алертами на почту и прочими ништяками, типа групповой установки через GPO.

Сборка smartmontools for windows сервисом для сервера с алертами на почту «икаропки»: www.netpower.fr/smartmontools

Успехов.

Всего голосов 18: ↑4 и ↓14

-10

Комментарии0

Roman Y. Bogdanov @brj

Пользователь

Category:

  • Компьютеры
  • Cancel

Я с удовольствием обнаружил, что в новой версии smartmontools встроена возможность выводить сообщение об ошибке диска на экран. Попробовал — работает. Делюсь.

    Программы, используемые для мониторинга HDD в Windows:

  • smartmontools — Пакет программ для просмотра и отслеживания изменений в SMART современных винчестеров. Нужно брать версию не ниже 6.1 (последний релиз на настоящий момент)
  • GSmartControl — Графический интерфейс к smartctl

Настройка уведомлений об ошибках жёстких дисков в сообщениях на экране.

  1. Установите пакет smartmontools
  2. Откройте в “Блокноте” или другом редакторе файл smartd.conf, расположенный в каталоге установленного smartmontools в подкаталоге bin, можно просто выполнить команду
    notepad «%ProgramFiles%\smartmontools\bin\smartd.conf”
  3. Отредактируйте в файле smartd.conf строку «DEVICESCAN»: замените строку
    DEVICESCAN
    на
    DEVICESCAN -m console
  4. Сохраните файл smartd.conf и закройте “Блокнот”
  5. Выполните команду
    «%ProgramFiles%\smartmontools\bin\runcmdu.exe» smartd install
  6. Выполните команду
    net start smartd

В случае возникновения ошибки жёсткого диска на экране появится окно сообщения с заголовком “SMART error detected on host: ИМЯКОМПЬЮТЕРА”, в окне будет текст с диагностикой ошибки (на английском).

Просмотр состояния и внутреннее тестирование жёстких дисков компьютера

Просматривать информацию SMART и выполнять внутренние тесты можно и программой smartctl из пакета smartmontools, но удобнее это делать в графической программе GSmartControl.

  1. Установите пакет smartmontools
  2. Установите пакет GSmartControl
  3. Запустите программу GSmartControl
  4. В окне GSmartControl увидите все обнаруженные жёсткие диски. “Откройте” нужный диск двойным кликом мышки.
  5. Откроется окно с заголовком “Device Information — …” (на месте многоточия будет условный физический адрес и модель диска).

    Содержимое окна “Device Information”:

  • На вкладке “Identity” приведена информация о диске
  • На вкладке “Attributes” показана таблица с информацией о состоянии диска. Если атрибут в какой-нибудь строчке выходит за пределы нормальности, эта строчка окрашена в розовый цвет, при этом и заголовок вкладки (слово “Attributes”) выведено тёмно-розовым шрифтом.
  • На вкладке “Capabilites” перечислены характеристики и функции, поддерживаемые контроллером диска.
  • На вкладке “Erroк Log” выведен протокол ошибок диска.
  • На вкладке “Self-test Logs” выведен протокол тестов диска.
  • На вкладке “Perform Tests” можно выбрать один из внутренних тестов и запустить его. Результат теста можно дождаться в окне тестирования, либо позже посмотреть на вкладке “Self-test Logs”.

Таким образом, когда диск “готовится к смерти”, вкладка “Attributes” сообщает об этом своим заголовком. Чтобы уточнить состояние диска, уже можно заглянуть на саму эту вкладку и увидеть характеристику (атрибут), вышедшую за пределы нормы.
Атрибуты различаются типами. Важные имеют тип “Pre-failure” (перед сбоем). Степень износа сообщают атрибуты с типом “Old age”.

    Самые важные атрибуты, по которым можно оценить ненадёжность диска:

  • №5 Reallocated sector Count — число обнаруженных сбойных блоков, которые были логически переадресованы контроллером диска на резервные;
  • №198 Offline Uncorrectable — число обнаруженных сбойных блоков, такой блок должен будет автоматически переназначен на резервный при неудачной записи в него и тогда счётчик уменьшится;
  • №197 Current Pending Sector Count — число блоков, ожидающих переназначения на резервные.

Если какой-то из этих атрибутов отличается от нуля, необходимо готовить замену жёсткого диска.

Есть ещё вариант настройки smartd с уведомлением по электронной почте, но он требует ещё одной программы (blat) и сложнее в настройке.

Smartmontools for Windows Package

(C) 2012-2020 Orsiris de Jong — http://www.netpower.fr

Smartmontools For Windows is an alternate package for smartmontools by Bruce Allen and Christian Franke, that has been created to smoothly install smartmontools as service,
support out of the box mail or local alerts, and configure smart daemon options with a graphical user interface.
Installation can be run silently with command line parameters for massive deployments, or with a graphical user interface.

Configuration files are automatically generated (but you can still enjoy manual editing of course).
A service called «smartd» is created and launched at system startups. This service will enumerate hard disks smartmontools can monitor and send an email and/or show a local message in case of errors.
Everytime smartd detects an issue, the current states of the drives are written to smart.log and an alert is triggered.
When mail / local alerts are triggered, all actions regarding alerts are logged to erroraction.log.

On install, the current states of all drives smartd can detect are written to smartmontools-install-(version).log for warranty issues.

The software has been tested on multiple platforms, nevertheless no responsibility will be taken for any problems or malfunctions that may occur while using this software.
Anyway, feel free to send a mail to ozy [at] netpower.fr for support on my free time.

Upgrade path

The configuration from previous installations is now kept (unless a smartd.conf and/or and erroraction_config.cmd file is provided along with the installer script).
The commandline options of the installer have heavily changed. Be sure to update your mass installer scripts according to new commandline syntax (see below).

Copyrights

The package itself, the python interfaces and it’s source code is licensed under GPLv2.
Additionnaly, it uses the following free software:

  • smartmontools by Bruce Allen & Christian Franke, http://smartmontools.sourceforge.net
  • smartd-pyngui by Orsiris de Jong, http://github.com/deajan/smartd-pyngui
  • Mailsend by Muhammad Muquit, http://www.muquit.com
  • Inno Setup by Jordan Russel, http://www.jrsoftware.org
  • Gzip by Free Software Foundation, Inc. Copyright (C) 1992, 1993 Jean-loup Gailly, http://gnuwin32.sourceforge.net/
  • Base64 by Matthias Gärtner, http://www.rtner.de/software/base64.htm
  • dd by Chrysocome and John Newbigin, http://www.chrysocome.net/dd

Binaries

You’ll find the latest binaries at http://www.netpower.fr/smartmontools-win

Useful command line parameters

smartmontools-win-6.6-x.exe [OPTIONS]

[OPTIONS]

/COMPONENTS=»comma separated list of component names»

This setting overrides the default selection.

Valid components are:
core Basic install, cannot be unselected
core\service Install smartd service
core\service\gui Graphical user interface for smartd and alerts
core\service\mailalert On alerts send an email
core\service\localalert On alerts show messages on screen
core\scheduledtestalerts Trigger a test alert every month
fixbadsecttools Fix bad sector script
regext Register SMART right click actions on drives
updatedb Update drive database right after installation
authorlinks Include links to the authors websites
statistics Send anonymous install statistics

/SILENT Installs smartmontools-win silently, without showing the configuration GUI.

/SUPPRESSMSGBOXES Removes the configuration files overwrite confirmation and keep the original configuration (unless new config files are supplied along with the installer).

/HELP Shows all possible commandline switches

See examples below

Unattended examples

You may want to preconfigure smartd settings or alert setting when making an unattended installation.
In that case you can install the package on a test computer, use the GUI to configure the service and alerts, and use the generated configuration files for a mass installation.
Putting a preconfigured smartd.conf file along with the setup exe will load it automatically.
Putting a preconfigured erroraction_config.cmd file along with the setup exe will automatically configure alert options.
Example files can be found at https://github.com/deajan/smartmontools-win/tree/master/unattended

Put the following files in the same directory

  • smartmontools-win-7.1-1.exe
  • smartd.conf
  • erroraction_config.cmd

Then run:
smartmontools-win-7.1-1.exe /COMPONENTS=»core\service,core\service\gui,core\service\mailsupport,updatedb,regext,authorlinks,statistics» /SUPPRESSMSGBOXES /SILENT

Compilation

Compilation works with Inno Setup & Inno Preprocessor 5.5+.
You’ll need to download all the software mentionned above and extract them to the corresponding directories listed in main iss file.

Build python executables

In order to build python executables from source, you’ll need:

pip install pygubu pywin32 cx_freeze

You may then run cxsetup.py in order to create executable versions of smartd-pyngui and erroraction_config

Table of Contents

  1. Attributes

    1. I see some strange output from smartctl. What does it mean?
    2. How can I get the attribute information in human readable format?
    3. Why is the attributes number and meaning different on the disks?
    4. What details can be interpreted from Raw read error rate?
    5. Why is my disk temperature reported by smartd as 150 Celsius?
    6. Attribute 194 (Temperature Celsius) behaves strangely on my Seagate disk
    7. smartctl reports the age as thousands of hours for my Maxtor/Hitachi/Fujitsu disk, yet it is only a few days old
    8. The power-on timer (Attribute 9 raw value) on my Maxtor disk acts strange.
    9. The time stamps in the self-test log don’t correspond to the power-on time, when test was run on my Western Digital (WD) disk
    10. The (normalized) WORST Attribute values of my Western Digital (WD) disk are larger than the (normalized) CURRENT Attribute values
    11. The SSD_Life_Left Attribute of my new SandForce based SSD reports zero
    12. The Power_On_Hours Attribute of my new Intel SSD reports ~890000 hours
  2. Protocols, Devices and Controllers

    1. Can I monitor disks behind RAID controllers?
    2. What is error recovery control (ERC) and why it is important to enable it for the (S)ATA disks in RAID?
    3. Smartmontools for FireWire, USB, and SATA disks/systems
    4. Smartmontools for SCSI disks and tapes (TapeAlert)
    5. Smartmontools for the NVMe devices
  3. Smartmontools Database

    1. My ATA/SATA drive is not in the smartctl/smartd database
    2. My SCSI/SAS drive is not in the smartctl/smartd database
    3. My NVMe drive is not in the smartctl/smartd database
    4. Could missing drive database entries be added locally?
    5. Why is my drive still missing in the drive database?
  4. Self-tests

    1. ATA drive is failing self-tests, but SMART health status is ‘PASSED’. What’s going on?
    2. Unreadable, uncorrectable, pending sectors or Medium error on disk. What’s going on?
    3. Why do self-tests take very long?
    4. Why is the system very slow during a self-test?
    5. Why do self-tests take much longer than predicted?
    6. Why are long self-tests keep getting interrupted?
    7. Where can I find manufacturer-specific disk-testing utilities?
  5. Operating System

    1. What are the operating system requirements?
    2. BIOS has a SMART enable/disable setting. What does it do, and how should I set it?
    3. Why does SAT pass-through fail under Linux if UAS is enabled
    4. Do smartctl and smartd run on a virtual machine guest OS?
    5. Is smartctl available for VMware ESXi?
    6. What is the purpose of the command smartctl-nc on Windows?
    7. smartctl aborts with the message «…SMART_GET_VERSION failed» on Windows. What is going wrong?
    8. On Windows smartctl prints the message: «…Log Read failed: Function not implemented»
    9. I found in syslog: ‘Can’t locate module block-major-65’
    10. On OSX smartctl prints ATA_READ_LOG_EXT (addr=0x11:0x00, page=0, n=1) failed: 48-bit ATA commands not implemented
    11. OSX — External USB / FireWire drive diagnostics support
  6. Firmware Issues

    1. ‘Error SMART Status command failed’ What’s the meaning of this smartctl message?
    2. ‘Warning: ATA error count 9 inconsistent with error log pointer 5’ What’s the meaning of this smartctl message?
  7. Distribution

    1. Is there a bootable standalone CD/DVD that contains smartmontools?
    2. How can I check that the package hasn’t been tampered with?
  8. Historic

    1. What Attributes does smartmontools not yet recognize?
    2. Startup message: smartd [FAILED] on Fedora Core Linux system
    3. What’s the story on IBM SMART disks?
    4. Does it work on Windows?
    5. Why did the release version scheme change?
  9. Other

    1. How to create a bug report

Attributes


I see some strange output from smartctl. What does it mean?

The raw SMART attributes (temperature, power-on lifetime, and so
on) are stored in vendor-specific structures. Sometime these are
strange. Hitachi disks (at least some of them) store power-on
lifetime in minutes, rather than hours (see next question below).
IBM disks (at least some of them) have three temperatures stored
in the raw structure, not just one. And so on.

If you find strange output, or unknown attributes, have a look
at our wiki pages, were we collect vendor specific info:

  • Fujitsu
  • IBM (Hitachi)
  • Maxtor
  • Seagate
  • Western Digital

When you don’t find an answer to your question there, please send an email to
smartmontools-support and we’ll help you try and figure it out.


How can I get the attribute information in human readable format?

smartctl provides human readable format as far as possible.
If the exact meaning of the RAW value is not known, there is nothing we can do.


Why is the attributes number and meaning different on the disks?

Unlike other parts of SMART (logs, self-tests), the attributes are not
(and never were) part of the ATA standards. Even the general attribute
format (ID, VALUE, WORST, RAW) is removed from the standard since ATA-4 (1998).

Attribute assignment and interpretation are vendor/device specific and
undocumented in many cases.


What details can be interpreted from Raw read error rate?

If no documentation is available, the RAW value of attribute 1 is typically useless.
The 48-bit field might encode several values, try -v 1,hex48 to check.


Why is my disk temperature reported by smartd as 150 Celsius?

It’s not.
For example, in the message:

Device: /dev/sda, SMART Usage Attribute: 194 Temperature_Celsius changed from 78 to 77

the value given is the Normalized not the Raw Attribute value (the
disk temperature in this case is about 22 Celsius). The
'-R' and '-r' Directives modify this behavior, so that
the information is printed with the Raw values as well, for example:

Device: /dev/sda, SMART Usage Attribute: 194 Temperature_Celsius changed from 78 [Raw 22] to 77 [Raw 23]

Here the Raw values are the actual disk temperatures in Celsius.
Please see the smartctl manual page for further explanation of the differences between Normalized and Raw Attribute values.

Alternatively suppress these messages with -I and enable temperature reports and/or warnings with -W directive.
For example this smartd.conf setting:

/dev/sda -a -I 190 -I 194 -W 1,45,50 -m ADDRESS

would result in messages like:

Device: /dev/sda, Temperature changed +1 Celsius to 23 Celsius (Min/Max 20/38)
Device: /dev/sda, Temperature 48 Celsius reached limit of 45 Celsius (Min/Max 20/48!)
Device: /dev/sda, Temperature 52 Celsius reached critical limit of 50 Celsius (Min/Max 20/52!)

The last message would also be sent as a warning email to ADDRESS.


Attribute 194 (Temperature Celsius) behaves strangely on my Seagate disk

Some Seagate disks store the current temperature Celsius in both the RAW and NORMALIZED Attribute 194 values, and the maximum lifetime temperature in Celsius in the WORST value. Since cooler is better, this means that in this case, lower NORMALIZED Attribute values are farther from failure, and that over time the WORST Attribute values get larger, not smaller (as with other Attributes).


smartctl reports the age as thousands of hours for my Maxtor/Hitachi/Fujitsu disk, yet it is only a few days old

On recent disks, Maxtor has started to use Attribute 9 to
store the power-on disk lifetime in minutes rather than hours.
In this case, use the: '-v 9,minutes' option to correctly
display hours and minutes.

Some models of Fujitsu disks use Attribute 9 to store
the power-on disk lifetime in seconds. In that case, use the:
'-v 9,seconds' option to correctly display hours, minutes and seconds.


The power-on timer (Attribute 9 raw value) on my Maxtor disk acts strange.

There are three related problems with Maxtor’s SMART firmware:

  1. On some Maxtor disks, the raw value of Attribute 9 (Power On Time) is supposed to be minutes. But it advances at an unpredictable rate, always more slowly than one count per minute. This is because when the disk is in idle mode, the counter stops advancing. This is only supposed to happen in standby mode. This will be corrected in Maxtor product lines released after October 2004.
  2. In Maxtor disks that use the raw value of Attribute 9 as a minutes counter, only two bytes (of the six available) are used to store the raw value. So it resets to zero once every 65536=216 minutes, or about once every 1092 hours. This is fixed in all Maxtor disks manufactured after July 2003, where the raw value was extended to four bytes.
  3. In Maxtor disks that use the raw value of Attribute 9 as a minutes counter, the hour time-stamps in the self-test and ATA error logs are calculated by right shifting 6 bits. This is equivalent to dividing by 64 rather than by 60. As a result, the hour time stamps in these logs advance 7% more slowly than they should. Thus, if you do self-tests once per week at the same time, instead of the time-stamps being 168 hours apart, they are 157 hours apart. This is also fixed in all Maxtor disks manufactured after July 2003.

The time stamps in the self-test log don’t correspond to the power-on time, when test was run on my Western Digital (WD) disk

The self-test log timestamps in many WD disks roll back to zero every
1092 hours (65536 minutes). This problem is due to a WD firmware bug.
The power-on lifetime in hours is correctly stored in Attribute 9.
However when the power-on lifetime is calculated for self-test log
entries, the lifetime in minutes is put into a 16-bit register then
divided by 60. The 16-bit register overflows and wraps around every 1092 hours.

For WD drives that exhibit this firmware bug, the relationship between
Attribute 9’s raw value (H) and the time-stamps in the self-test log (h) are given by:

 Let H = power on hours as shown by Attribute 9 (correct)
 Let M = 60*H (power on minutes, correct)
 Let m = M mod 65536 (incorrect value of power on minutes)
 Let h = m/60 (incorrect value of power on hours, shown in self-test log)

The (normalized) WORST Attribute values of my Western Digital (WD) disk are larger than the (normalized) CURRENT Attribute values

Western Digital firmware initializes SMART Attributes 10, 11, and
199 after either 120 spin-ups or 8 power-on hours. Until that time,
they have the uninitialized value 253.


The SSD_Life_Left Attribute of my new SandForce based SSD reports zero

It doesn’t. The RAW value of this attribute is always 0 and has no meaning. Check the normalized VALUE instead. It starts at 100 and indicates the approximate percentage of SDD life left. It typically decreases when Flash blocks are marked as bad, see the RAW value of Retired_Block_Count:

ID# ATTRIBUTE_NAME          FLAGS    VALUE WORST THRESH FAIL RAW_VALUE
...
  5 Retired_Block_Count     PO--CK   098   098   003    -    416
...
231 SSD_Life_Left           PO--C-   097   097   010    -    0

The Power_On_Hours Attribute of my new Intel SSD reports ~890000 hours

This is a bug in Intel 330 Firmware 300i and Intel 520 Firmware 400i.
The offset is 894794 hours.
See also ticket #289 and Intel SSD Toolbox SMART Attributes FAQ.
The hours counter from Device Statistics is not affected:

# smartctl -x /dev/ice
...
ID# ATTRIBUTE_NAME          FLAGS    VALUE WORST THRESH FAIL RAW_VALUE
...
  9 Power_On_Hours_and_Msec -O--CK   000   000   000    -    894808h+48m+52.360s
...
Device Statistics (GP Log 0x04)
Page Offset Size         Value  Description
...
  1  0x010  4               14  Power-on Hours

Protocols, Devices and Controllers


Can I monitor disks behind RAID controllers?

Support for disks behind RAID controllers is highly dependent on both platform
and controller type. See our page about smartmontools RAID controller support
for the details.


What is error recovery control (ERC) and why it is important to enable it for the (S)ATA disks in RAID?

In computing, error recovery control (ERC) is a feature of hard disks which allow a system administrator to configure the amount of time a drive’s firmware is allowed to spend recovering from a read or write error. Limiting the recovery time allows for improved error handling in hardware or software RAID environments. In some cases, there is a conflict as to whether error handling should be undertaken by the hard drive or by the RAID implementation, which leads to drives being marked as unusable and significant performance degradation, when this could otherwise have been avoided.

It is best for ERC to be «enabled» when in a RAID array to prevent the recovery time from a disk read or write error from exceeding the RAID implementation’s timeout threshold. If a drive times out, the hard disk will need to be manually re-added to the array, requiring a re-build and re-synchronization of the hard disk. Limiting the drives recovery timeout helps for improved error handling in the hardware or software RAID environments.

On disks that fully implement the ATA-8 standard, the smartctl utility can be used to control the ERC behavior of many drives by setting the SCT Error Recovery Control (scterc) parameter:

  • Reading current settings:
    smartctl -l scterc /dev/sda
         SCT Error Recovery Control:
               Read: Disabled
              Write: Disabled
    
  • Changing the setting:
    smartctl -l scterc,150,150 /dev/sda
        SCT Error Recovery Control:
                   Read:    150 (15.0 seconds)
                  Write:    150 (15.0 seconds)
    

ERC control needs to be set on the boot time and if hot-replacement been made. You may find sample Linux scripts and related discussion in the ticket #658.


Smartmontools for FireWire, USB, and SATA disks/systems

As for USB and FireWire (IEEE 1394) disks and tape drives, the news
is not good. They appear to the operating system as SCSI devices but their
implementations do not usually support those SCSI commands needed by
smartmontools. A consortium associated with IEEE 1394 certified some
external enclosures (containing a ATA disk and a protocol bridge)
as being compliant to the relevant standards. Even still, that
compliance means that they tend to only support the bare minimum of
commands needed for device operation (i.e. SMART support is an unsupported
extra). Hopefully external USB and Firewire devices will support SAT in
the future, see below. Some USB device based on cypress chips support a
proprietary protocol (ATACB) that allow to send raw ATA commands (i.e.
SMART support).

Smartmontools should work correctly with SATA drives under both
Linux 2.4 and 2.6 kernels. Depending on which subsystem the SATA
controller is in (i.e. drivers/ide, drivers/ata
or libata (under drivers/scsi) a SATA drive will
appear as /dev/hd* or /dev/sd*. Either way,
smartmontools should be able to figure out what is going on and act
accordingly. In some cases smartmontools may need a hint in the form of
a ‘-d sat‘ or ‘-d ata‘ option on the smartctl command
line or in the /etc/smartd.conf file.
There may be a hint to add one of those options in the log file
when smartd is run as a daemon or on the command line with smartctl.
The ‘-d ata‘ option means that even though
the drive has a SCSI device name, treat it as an ATA
disk. Unfortunately such an approach doesn’t often work. The next
paragraph has more information about ‘-d sat‘.

The SCSI to ATA Translation (SAT) standard (ANSI INCITS 431-2007)
may solve many problems in this area. It defines how SCSI commands will
be translated to the corresponding ATA commands and defines a
pass-through mechanism. ATA commands are conveyed natively by two
transports: parallel and serial ATA. SCSI commands can be
conveyed by many transports: the veteran SCSI Parallel Interface
(SPI), Fibre Channel (FC), Infiniband (SRP), Serial
Attached SCSI (SAS), IP (iSCSI and iSER), USB (mass storage), and IEEE
1394 (SBP) to name some. Due to their cost and storage capacity, more
and more ATA disks (especially SATA disks) are appearing «behind» a
SCSI transport. This is especially true of the SAS transport which can
painlessly accomodate both SAS and SATA disks. Enter another acronym:
SATL which stands for SCSI to ATA Translation Layer. In Linux libata
has a SATL in it. Some SAS host bus adapters have a SATL in their
firmware. FC might have a SATL in a switch. Perhaps in the future USB
and IEEE 1394 enclosures will have a SATL in them. Starting from
smartmontools versions 5.36 and 5.37, no matter where a SATL is,
irrespective of the operating system in use, the user should have less
problems with ATA disks, no matter which transport is involved. As
always, it helps to know a little of what is happening under the
covers. The ‘-d sat‘ option instructs smartctl
and smartd to assume a SATL is in place and act accordingly.
The smartctl command can often detect a SATL and autoconfigure
while in smartmontools version 5.37 smartd often needs a hint.

The current USB mass storage specification is based on a version of SCSI
(SPC-2) that can’t support SAT. But some chips manufacturers implement
proprietary SCSI commands that allow ATA pass through (similiar like for SAT).
Well known is the cypress chipset, that contains an ATACB proprietary pass through
(for ATA commands passed through SCSI commands) for which
some information is publicly available (see cy7c68300c_8.pdf).
Smartmontools 5.39 supports these cypress chips via
the ‘-d usbcypress‘ option on the smartctl command line.
A lot of devices can be autodetected already. Have a look on the
wiki page about supported USB-Devices,
wether your device is on the list. Check your device usb id (most
cypress usb ata bridge got vid=0x04b4, pid=0x6830)
or to try to call smartctl with option
-d usbcypress‘. If the usb device doesn’t support
ATACB, smartmontools will abort.


Smartmontools for SCSI disks and tapes (TapeAlert)

Smartmontools for SCSI disks and tapes (including medium changers) is
discussed on a separate page.


Smartmontools for the NVMe devices

Smartmontools supports NVMe interface starting from version 6.5. NVMe related functionality and supported configurations are discussed on the NVMe wiki page.



My ATA/SATA drive is not in the smartctl/smartd database

Does this break anything? How do I get it added?

If your drive is not in the database, then the names of the Attributes
(displayed in the ATTRIBUTE_NAME column of smartctl -A /dev/sdX)
and the format of the the raw Attribute values shown in the
RAW_VALUE column may be incorrect. This is mostly cosmetic:
the essential drive health monitoring/testing functionality of
smartmontools does not depend upon the database.

If your drive is not in the database, please make sure to
update the drive database first.
Please do not submit a new drive for the database without checking to see if it
is already in the current drive database
(drivedb.h​)
file.

If your drive is not in the current database,
to have it added to the database, first use the command:

smartctl -t short /dev/sdX

to run a short self-test on the drive, and wait a
few minutes for the test to complete.
Then create a full smartmontools report and redirect it to a text file:

smartctl -x /dev/sdX > smartctl-VENDOR-MODEL.txt

Note: Replace VENDOR-MODEL in the above file name with some actual identify information for the drive.

The timestamp in the self-test log will help us to determine whether Attribute 9 is
being used to store the lifetime in hours, minutes, or seconds.

Alternatively you could use:

smartctl -q noserial -x /dev/sdX > smartctl-VENDOR-MODEL.txt

This report does not contain the «Serial Number» and «LU WWN Device Id» output lines.

Then either email the file to
smartmontools-database
mailing list or create a ticket here in trac.
Add the file as a plain-text ASCII attachment to avoid reformatting.
In tickets, wiki markup for preformatted text
could be used alternatively.

Place the drive model name in the email subject or ticket summary.
To submit info about different drive models, please use separate emails or tickets.

Further information about the drive is welcome
(link to device specification, output from a vendor specific SMART tool,
name of the SSD controller, an already tested drivedb.h entry, …).

Please note that there usually will be no feedback on the smartmontools-database
mailing list after a drive has been added to the database.
If such feedback is desired, please create a ticket instead.


My SCSI/SAS drive is not in the smartctl/smartd database

My NVMe drive is not in the smartctl/smartd database

SCSI/SAS and NVMe drives do not provide ATA/SATA-like SMART Attributes.
Therefore the drive database does not contain any entries for these drives.
This may change in the future as some drives provide similar info via vendor specific commands (see ticket #870).


Could missing drive database entries be added locally?

Yes.
Create a separate local drive database file with the desired entries.
The entries in this file prepend and may override the entries in the installed or builtin database.
The default path of the local drive database is usually /etc/smart_drivedb.h.
On Windows, it is drivedb-add.h in the directory where smartctl.exe is installed.
See -B [+]FILE, --drivedb=[+]FILE section on smartctl man page for the configured default path and further info.
The default path is also included in the smartctl -h output.


Why is my drive still missing in the drive database?

Unfortunately we lack helping hands in the maintenance of the drivedb.
Therefore it may take a long time until somebody has time to analyse and investigate upon
user contributions for missing devices and finally add an entry to the drive database..
When you send us patches for the missing entry in drivedb.h additional to the smartctl report
and/or also links to vendor docs about the meaning of SMART attributes in this very case,
the chances get better that the entry will be added more quickly ;-)

And if you have more time to spend on smartmontools drivedb take a look at this job offer ;-)


Self-tests


ATA drive is failing self-tests, but SMART health status is ‘PASSED’. What’s going on?

If your ATA drive supports self-tests, you should run them on a regular basis, for example one per week:

 smartctl -t long /dev/hd?

After the test has completed, you should examine the results with:

 smartctl -l selftest /dev/hd?

If the drive fails a self-test, but still has ‘PASSED‘ SMART health status, this usually means that there is a corrupted (uncorrectable=UNC) sector on the disk. This means that the ECC data stored at that sector is not consistent with the user data stored at that sector, and an attempt to read the sector fails with a UNC error. This can be a one-time transient effect: a sudden power failure while the disk was writing to the sector corrupted the ECC code or data, but the sector <em>could</em> correctly store new data. Or it can be a permanent effect: the magnetic media has been damaged by a bit of dust, and the sector could not correctly store new data.

If the disk can read the sector of data a single time, and the damage is permanent, not transient, then the disk firmware will mark the sector as ‘bad’ and allocate a spare sector to replace it. But if the disk can’t read the sector even once, then it won’t reallocate the sector, in hopes of being able, at some time in the future, to read the data from it. A write to an unreadable (corrupted) sector will fix the problem. If the damage is transient, then new consistent data will be written to the sector.
If the damange is permanent, then the write will force sector reallocation. Please see Bad block HOWTO for instructions about how to force this sector to reallocate (Linux only).

The disk still has passing health status because the firmware has not found other signs of trouble, such as a failing servo.

Such disks can often be repaired by using the disk manufaturer’s ‘disk evaluation and repair’ utility. Beware: this may force reallocation of the lost sector and thus corrupt or destroy any file system on the disk. See Bad block HOWTO for generic Linux instructions.


Unreadable, uncorrectable, pending sectors or Medium error on disk. What’s going on?

SCSI and ATA disk drives store data in blocks (sectors) of 512(1) bytes. Each 512 bytes of user data is stored on the media plus 40 or more bytes of ECC data included in it. These — so called ECC Bytes — are used internally by the disk firmware for error checking/detection and correction.

Sometimes the data in a sector gets corrupted. This can happen because a speck of dust scratched the disk, or because the disk was powered down while writing data to that sector, or for other reasons. Usually the ECC bytes can be used to correct the corrupted data. However if the ECC bytes are inconsistent or can’t be used to correct the bad data, then the 512 bytes of data are lost. Such a sector is called unreadable or uncorrectable.

If your disk has an unreadable sector, this means that some of your data can’t be retrieved. You can force the disk to replace the unreadable sector with a spare good sector, but only at the price of losing the 512 bytes of data forever.

Disks with uncorrectable sectors can often be repaired by using the disk manufaturer’s ‘disk evaluation and repair’ utility (see previous FAQ entry). Beware: this may force reallocation of the lost sector and thus corrupt or destroy any file system on the disk. See Bad block HOWTO for generic Linux instructions.

Normally when an uncorrectable sector is found, the disk puts this onto a ‘pending sector list’ to indicate that it should be replaced with a spare good sector. However this replacement won’t take place until either the disk can read the data on the bad sector, or is instructed to write new data to that bad sector.

(1) In the future the block size for disks (especially in the terabyte range) will increase from 512 bytes to 4096 bytes.


Why do self-tests take very long?

Why is the system very slow during a self-test?

The smartctl -t TEST command (or smartd.conf -s directive) issues a command to start a test
(ATA: SMART EXECUTE OFF-LINE IMMEDIATE, SCSI: SEND DIAGNOSTIC).
The self-tests are controlled by drive firmware.
There is no related data transfer between host and drive during a test.
The interleaving of regular I/O and read tests depends on the specific implementation in the firmware.

Many implementations work reasonably.
Some slow down the self-test even on average system load such that the test virtually never ends.
Others slow down regular I/O such that the system is unusable during a test.


Why do self-tests take much longer than predicted?

The predicted completion time printed by smartctl -t TEST is based on values returned by drive firmware
(ATA: SELF-TEST ROUTINE RECOMMENDED POLLING TIME from SMART DATA STRUCTURE,
SCSI: EXTENDED SELF-TEST COMPLETION TIME from CONTROL MODE PAGE).
The prediction assumes that no regular I/O is done during the test.


Why are long self-tests keep getting interrupted?

The host may send a standby command to the drive after some time of I/O inactivity.
This also aborts any running self-test.
The self-test log then reports Aborted by host or Interrupted (host reset) as status.
This is typical for drives behind USB bridges.

As a workaround, run some tool or script which perform periodic low volume read accesses.
See this thread
on smartmontools-support mailing list for an example.


Where can I find manufacturer-specific disk-testing utilities?

The UBCD (Ultimate Boot CD)
includes some manufacturer-specific disk-testing utilities and many other useful
diagnostic tools ready to boot from CD or USB memory stick.

Note: if you do run one of these utilities, and it identifies the
meanings of any SMART Attributes that are not known to smartmontools,
please report them to the
smartmontools-support mailing list
or add the info to our info pages on vendor specific SMART Attributes.

These utilities have an important role to fill. If your disk has
bad sectors (for example, as revealed by running self-tests with
smartmontools) and the disk is not able to recover the data from those
sectors, then the disk will not automatically reallocate those
damaged sectors from its set of spare sectors, because
forcing the reallocation to take place may entail some loss of data.
Because the commands that force such reallocation are
Vendor Specific, most manufacturers provide a utility for this
purpose. It may cause data loss but can repair damaged sectors (at
least, until it runs out of replacement sectors).


Operating System


What are the operating system requirements?

Please see the first section of the
INSTALL file.


BIOS has a SMART enable/disable setting. What does it do, and how should I set it?

Some type of BIOS can check the SMART health status of a disk at bootup: the equivalent of ‘smartctl [-s on] -H /dev/sd?‘.
This one-time check on bootup is done if the BIOS SMART setting is set to ENABLE, and is not done if the setting is set to DISABLE.

If this one-time check is done, and the disk’s health status is found to be FAILED, then typically the BIOS will display an error message and refuse to boot the machine.

For the proper functioning of smartmontools, either BIOS setting may be used.

A BIOS may perform the SMART health check even if it does not provide a corresponding setting.
The check cannot be disabled in this case.


Why does SAT pass-through fail under Linux if UAS is enabled

The Linux kernel rejects SAT ATA pass-through commands to certain devices if UAS is enabled.
See the SAT with UAS under Linux page for details.


Do smartctl and smartd run on a virtual machine guest OS?

Yes and no. Smartctl and smartd run on a virtual machine guest OS without problems. But this isn’t very useful because the virtual disks do not support SMART. If a guest OS disk is configured as a raw disk, this only means that its sectors are mapped transparently to the underlying physical disk. This does not imply the ATA or SCSI pass-through access required to access the SMART info of the physical disk. Even the disk’s identity is typically not exposed to the guest OS.


Is smartctl available for VMware ESXi?

No. See the ESXi related tickets and this thread on smartmontools-support mailing list.


What is the purpose of the command smartctl-nc on Windows?

The file smartctl-nc.exe (no console) from the smartmontools Windows package is a copy of smartctl.exe with the SUBSYSTEM type in the EXE header changed from CONSOLE to GUI. This prevents that an empty console window is opened when the command is run in background with output redirected. GSmartControl uses this command for this purpose. When smartctl-nc is run without redirection from a console window, its output is not visible because Windows detaches the program from the console.


smartctl aborts with the message «…SMART_GET_VERSION failed» on Windows. What is going wrong?

A failing SMART_GET_VERSION call means that the device driver does not implement the I/O controls (see below) to access ATA SMART functionality.

Some Windows drivers for (S)ATA controllers are implemented as SCSI class drivers. This is usually the case for drivers which support RAID. Unfortunately, such drivers do not support the ATA specific SMART I/O controls.


On Windows smartctl prints the message: «…Log Read failed: Function not implemented»

What is going wrong?

This means that the device driver does not support the command SMART READ LOG.
The message does not indicate a hard disk problem»
It does also not mean that the disk itself does not support SMART logs.
It may still be possible to read the logs with a Linux version of smartmontools run from
some Live CD/DVD.

To access ATA SMART functionality on Windows, smartmontools uses the
I/O control calls
SMART_RCV_DRIVE_DATA and
SMART_SEND_DRIVE_CMD.
These calls were available since Win95 OSR2.
An example program from Microsoft can be found
(SmartApp.exe, no longer available, the related KB article 208048 is also no longer available).

Starting with NT4, these calls do more restrictive parameter checks.
In particular, the command codes for SMART READ LOG and ABORT SELF-TEST
are not accepted. To perform these functions, smartmontools uses the
undocumented functions SCSIOP_ATA_PASSTHROUGH (NT4) or
IOCTL_IDE_PASS_THROUGH (2000/XP) instead.
An example program using these calls can be found
here,
a related newsgroup thread is
here.

Unfortunately, these undocumented functions are not implemented in
most vendor specific ATA device drivers. smartctl prints a
«Function not implemented» message in this case.

A new I/O control call
IOCTL_ATA_PASS_THROUGH
is available since Win2003 and XP SP2.
It should be supported by most new drivers. Experimental code using
this call was added 2006-04-27 and is included in smartmontools
release 5.37.


I found in syslog: ‘Can’t locate module block-major-65’

When I run smartd, the SYSLOG /var/log/messages
contains messages like this:

smartd: Reading Device /dev/sdv 
modprobe: modprobe: Can't locate module block-major-65

This is because when smartd starts, if there is no
configuration file, it looks for all ATA and SCSI devices to monitor
(matching the pattern /dev/hd[a-t] or
/dev/sd[a-z]). The log messages appear because your
system doesn’t have most of these devices.

The solution is simple: use the smartd configuration file
/etc/smartd.conf to specify which devices to monitor.


On OSX smartctl prints ATA_READ_LOG_EXT (addr=0x11:0x00, page=0, n=1) failed: 48-bit ATA commands not implemented

When I run smartctl -x output contains lines that:

ATA_READ_LOG_EXT (addr=0x11:0x00, page=0, n=1) failed: 48-bit ATA commands not implemented
Read SATA Phy Event Counters failed

This is because OSX provides very limited SMART API and direct disk access is not allowed. It is possible to use Linux LiveCD to get full information about the drive.


OSX — External USB / FireWire drive diagnostics support

Mac OS X does not support diagnosing external drives using S.M.A.R.T. technology “out of the box” . In order to allow your Mac to diagnose external drives, you will need to install a special third party driver. Please note that this is a requirement of Mac OS X, and not smartmontools. Links:

  • Binary Fruit page about USB/OSX with instructions for the different versions
  • OSX Smart driver GitHub page original source code of the driver

Firmware Issues


‘Error SMART Status command failed’ What’s the meaning of this smartctl message?

The SMART status command (health monitoring) is not working properly. This is found on USB 3.0 enclosures based on LucidPORT USB300 bridge with firmware 2447 or earlier. Firmware 2580 may fix this error. Contact both your enclosure manufacturer and LucidPORT to obtain a working firmware.


‘Warning: ATA error count 9 inconsistent with error log pointer 5’ What’s the meaning of this smartctl message?

The ATA error log is stored in a circular buffer, and the ATA specifications are unambiguous about how the entries should be ordered. This warning message means that the disk’s firmware does not strictly obey the ATA specification regarding the ordering of the error log entries in the circular buffer. Smartmontools will correct for this oversight, so this warning message can be safely ignored by users. (On the other hand, firmware engineers: please read the ATA specs more closely then fix your code!).


Distribution


Is there a bootable standalone CD/DVD that contains smartmontools?

Yes there are. See the list of Live CDs/DVDs containing smartmontools.


How can I check that the package hasn’t been tampered with?

Since the smartmontools utilities run as root, you might
be concerned about something harmful being embedded within
them. Starting with release 5.19 of smartmontools, the released
files have been GPG signed (except releases 5.37 to 5.39.1).
The fingerprint are given in a file on the release page with a name
like smartmontools-7.3.tar.gz.asc.

Please verify these using the

  • Smartmontools GPG Signing Key (2021-2025)
  • Smartmontools GPG Signing Key (2019-2020)
  • Smartmontools GPG Signing Key (2017-2018)
  • Smartmontools GPG Signing Key (2015-2016)
  • Smartmontools GPG Signing Key (2013-2014)
  • Smartmontools GPG Signing Key (2010-2012)
  • Smartmontools GPG Signing Key (2005-2006)
  • Smartmontools GPG Signing Key (2003-2004)

Historic

The FAQ entries below are probably outdated.


What Attributes does smartmontools not yet recognize?

From Maxtor disks (99), (100), and (101). These are not used by
Maxtor in SMART revision 5. They will be used in SMART revision 6,
but the engineering group has not yet decided what to monitor with these Attributes.


Startup message: smartd [FAILED] on Fedora Core Linux system

Fedora Core is distributed with a smartd configuration file
/etc/smartd.conf that monitors the first IDE disk /dev/hda. If this
device does not exist (or lacks SMART capability) you will get the
error message above. Look in SYSLOG (/var/log/messages) for
additional details about what is going wrong.

The solution: If your system has only SCSI disks, or has IDE disk(s)
on a non-primary controller, just edit /etc/smartd.conf to reflect the
correct location of the drive(s). Please also read the smartd.conf
man page for additional information.


What’s the story on IBM SMART disks?

Apparently some of the older SMART firmware on IBM disks can
interfere with the regular operation of the disk. If you have this
problem, here is a link to an
IBM DeskStar hard disk drive firmware update.


Does it work on Windows?

Yes, finally it does. A windows port of smartctl 5.26 by Christian Franke was first checked in 2004/02/23 on CVS branch
RELEASE_5_26_WIN32_BRANCH and has been merged to the CVS trunk later.

The Cygwin or MSYS environment can be used to build Windows (using MinGW) versions of smartctl and smartd.
Installation instructions for binary distributions can be found here.


Why did the release version scheme change?

It was non-standard. So with the move to GNU Autoconf and GNU Automake it changed from 5.X-Y (where X and Y are one or more digits) to 5.Y. Starting with the first release, and moving forward in time, the releases are numbered as follows:

 5.0-1,
 5.0-2,
 ...,
 5.0-45,
 5.1-1,
 ...,
 5.1-18,
 5.19,
 5.20,
 ...

Other

How to create a bug report

The most convenient way for us is, when you create a new ticket here in TRAC. You must be logged in to your smartmontools.org Trac account in order to do that.

If you don’t have a smartmontools Trac account and don’t want to have one, you can also send the info to our smartmontools-support mailing list


Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • System windows forms nugget
  • Создание нескольких учетных записей в windows 10
  • Настройка заметок в windows
  • Windows vista ru board
  • Как запустить discord на windows 7