Главная » Статьи » Система | [ Добавить статью ] |
smartmontools - контроль и наблюдает за системными накопителями с помощью S.M.A.R.T. |
smartmontools - контроль и наблюдает за системными накопителями с помощью S.M.A.R.T. Пакет smartmontools состоит из двух утилит (smartctl и smartd), которые контролируют и следят за системными накопителями используя самопроверку, анализ и систему технологического отчёта (S.M.A.R.T.), встроенную в большинство современных ATA и SCSI жёстких дисков. Этот пакет основан на коде пакета smartsuite и включает поддержку ATA/ATAPI-5 дисков. Он должен быть запущен на любой современной Linux системе. S.M.A.R.T. производит наблюдение за основными характеристиками накопителя, каждая из которых получает оценку. Характеристики можно разбить на две группы:
Утилиты smartctl и smartd необходимо запускать из терминала. Утилита smartctl служит для просмотра текущих значений S.M.A.R.T. В терминале выполните следующую команду: sudo smartctl -a /dev/sda Пример: sudo smartctl -a /dev/sda smartctl 6.2 2013-07-26 r3841 [i686-linux-3.13.0-24-generic] (local build) Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Model Family: Toshiba 3.5" HDD DT01ACA... Device Model: TOSHIBA DT01ACA100 Serial Number: 93HU14AJS LU WWN Device Id: 5 000039 ff6f5a811 Firmware Version: MS2OA750 User Capacity: 1 000 204 886 016 bytes [1,00 TB] Sector Sizes: 512 bytes logical, 4096 bytes physical Rotation Rate: 7200 rpm Device is: In smartctl database [for details use: -P show] ATA Version is: ATA8-ACS T13/1699-D revision 4 SATA Version is: SATA 3.0, 6.0 Gb/s (current: 3.0 Gb/s) Local Time is: Sat May 24 22:40:18 2014 OMST SMART support is: Available - device has SMART capability. SMART support is: Enabled === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED General SMART Values: Offline data collection status: (0x84) Offline data collection activity was suspended by an interrupting command from host. Auto Offline Data Collection: Enabled. Self-test execution status: ( 0) The previous self-test routine completed without error or no self-test has ever been run. Total time to complete Offline data collection: ( 7216) seconds. Offline data collection capabilities: (0x5b) SMART execute Offline immediate. Auto Offline data collection on/off support. Suspend Offline collection upon new command. Offline surface scan supported. Self-test supported. No Conveyance Self-test supported. Selective Self-test supported. SMART capabilities: (0x0003) Saves SMART data before entering power-saving mode. Supports SMART auto save timer. Error logging capability: (0x01) Error logging supported. General Purpose Logging supported. Short self-test routine recommended polling time: ( 1) minutes. Extended self-test routine recommended polling time: ( 121) minutes. SCT capabilities: (0x003d) SCT Status supported. SCT Error Recovery Control supported. SCT Feature Control supported. SCT Data Table supported. SMART Attributes Data Structure revision number: 16 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000b 100 100 016 Pre-fail Always - 1 2 Throughput_Performance 0x0005 141 141 054 Pre-fail Offline - 72 3 Spin_Up_Time 0x0007 125 125 024 Pre-fail Always - 185 (Average 183) 4 Start_Stop_Count 0x0012 100 100 000 Old_age Always - 324 5 Reallocated_Sector_Ct 0x0033 100 100 005 Pre-fail Always - 0 7 Seek_Error_Rate 0x000b 100 100 067 Pre-fail Always - 0 8 Seek_Time_Performance 0x0005 118 118 020 Pre-fail Offline - 33 9 Power_On_Hours 0x0012 100 100 000 Old_age Always - 2062 10 Spin_Retry_Count 0x0013 100 100 060 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 321 192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 340 193 Load_Cycle_Count 0x0012 100 100 000 Old_age Always - 340 194 Temperature_Celsius 0x0002 162 162 000 Old_age Always - 37 (Min/Max 19/42) 196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0 197 Current_Pending_Sector 0x0022 100 100 000 Old_age Always - 0 198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x000a 200 200 000 Old_age Always - 0 SMART Error Log Version: 1 ATA Error Count: 2 CR = Command Register [HEX] FR = Features Register [HEX] SC = Sector Count Register [HEX] SN = Sector Number Register [HEX] CL = Cylinder Low Register [HEX] CH = Cylinder High Register [HEX] DH = Device/Head Register [HEX] DC = Device Command Register [HEX] ER = Error register [HEX] ST = Status register [HEX] Powered_Up_Time is measured from power on, and printed as DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes, SS=sec, and sss=millisec. It "wraps" after 49.710 days. Error 2 occurred at disk power-on lifetime: 572 hours (23 days + 20 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 84 51 e9 17 7f 0e 07 Error: ICRC, ABRT at LBA = 0x070e7f17 = 118390551 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 60 08 68 00 11 81 40 08 06:45:16.646 READ FPDMA QUEUED 61 08 00 e8 cb 1e 40 08 06:45:16.646 WRITE FPDMA QUEUED 61 08 60 00 80 0e 40 08 06:45:16.646 WRITE FPDMA QUEUED 61 00 58 00 7c 0e 40 08 06:45:16.646 WRITE FPDMA QUEUED 61 00 50 00 78 0e 40 08 06:45:16.646 WRITE FPDMA QUEUED Error 1 occurred at disk power-on lifetime: 73 hours (3 days + 1 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 84 51 01 ff 66 ab 01 Error: ICRC, ABRT at LBA = 0x01ab66ff = 28010239 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 60 00 00 00 66 ab 40 08 03:51:10.135 READ FPDMA QUEUED 60 00 08 00 65 ab 40 08 03:51:10.135 READ FPDMA QUEUED 60 00 00 00 64 ab 40 08 03:51:10.134 READ FPDMA QUEUED 60 00 00 00 63 ab 40 08 03:51:10.134 READ FPDMA QUEUED 60 00 08 00 62 ab 40 08 03:51:10.133 READ FPDMA QUEUED 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% 2028 - 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. Для получения информации о диске выполните следующую команду: sudo smartctl -i /dev/sda Для запуска механизма самотестирования диска выполните следующую команду: sudo smartctl -l selftest /dev/sda Пример: sudo smartctl -l selftest /dev/sda smartctl 6.2 2013-07-26 r3841 [i686-linux-3.13.0-24-generic] (local build) Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org Smartctl open device: /dev/sda failed: Permission denied liman@liman-GA-78LMT-S2:~$ sudo smartctl -l selftest /dev/sda smartctl 6.2 2013-07-26 r3841 [i686-linux-3.13.0-24-generic] (local build) Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === 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% 2062 - # 2 Short offline Completed without error 00% 2028 - Демон smartd Утилита-демон smartd помогает регулярно проверять состояние дисков. Демон отслеживает состояние SMART-данных и обнаруживает ошибки и отсылает сообщения на e-mail в случае обнаружения ошибки. smartd опрашивает SMART дисков каждые 30 минут. Управляется smartd при помощи файла конфигурации /etc/smartd.conf. В файл конфигурации необходимо добавить одну строчку (или несколько в зависимости от кол-ва жестких дисков): /dev/sda -S on -o on -a -I 194 -m administrator@host.ru -o on - включение автоматического оффлайн-теста -S on - включение функции автоматического сохранения значений атрибутов -a - включение наблюдения за всеми параметрами SMART -m - атрибут указывает на какой e-mail отправлять уведомления об ошибках -I 194 - игнорирование изменения температуры жёсткого диска Перед запуском демона необходимо изменить файл /etc/default/smartmontools sudo nano /etc/default/smartmontools раскомментируйте строчки: enable_smart="/dev/sda" - измените значение на sda и добавьте через пробел /dev/sdb если используете второй диск start_smartd=yes smartd_opts="--interval=1800" Выполните следующую команду для запуска демона: sudo /etc/init.d/smartmontools start Для контроля демона на работоспособность выполните следующую команду: ps waux | grep smart Проверим работает ли демон с выбранным Вами жестким диском sudo tail -100 /var/log/syslog | grep smartd Пример: sudo tail -100 /var/log/syslog | grep smartd May 25 00:03:54 liman-GA-78LMT-S2 smartd[21988]: smartd 6.2 2013-07-26 r3841 [i686-linux-3.13.0-24-generic] (local build) May 25 00:03:54 liman-GA-78LMT-S2 smartd[21988]: Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org May 25 00:03:54 liman-GA-78LMT-S2 smartd[21988]: Opened configuration file /etc/smartd.conf May 25 00:03:54 liman-GA-78LMT-S2 smartd[21988]: Drive: DEVICESCAN, implied '-a' Directive on line 21 of file /etc/smartd.conf May 25 00:03:54 liman-GA-78LMT-S2 smartd[21988]: Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices May 25 00:03:54 liman-GA-78LMT-S2 smartd[21988]: Device: /dev/sda, type changed from 'scsi' to 'sat' May 25 00:03:54 liman-GA-78LMT-S2 smartd[21988]: Device: /dev/sda [SAT], opened May 25 00:03:54 liman-GA-78LMT-S2 smartd[21988]: Device: /dev/sda [SAT], TOSHIBA DT01ACA100, S/N:93HU14AJS, WWN:5-000039-ff6f5a811, FW:MS2OA750, 1.00 TB May 25 00:03:54 liman-GA-78LMT-S2 smartd[21988]: Device: /dev/sda [SAT], found in smartd database: Toshiba 3.5" HDD DT01ACA... May 25 00:03:55 liman-GA-78LMT-S2 smartd[21988]: Device: /dev/sda [SAT], is SMART capable. Adding to "monitor" list. May 25 00:03:55 liman-GA-78LMT-S2 smartd[21988]: Device: /dev/sda [SAT], state read from /var/lib/smartmontools/smartd.TOSHIBA_DT01ACA100-93HU14AJS.ata.state May 25 00:03:55 liman-GA-78LMT-S2 smartd[21988]: Monitoring 1 ATA and 0 SCSI devices May 25 00:03:56 liman-GA-78LMT-S2 smartd[21988]: Device: /dev/sda [SAT], state written to /var/lib/smartmontools/smartd.TOSHIBA_DT01ACA100-93HU14AJS.ata.state May 25 00:03:56 liman-GA-78LMT-S2 smartd[21990]: smartd has fork()ed into background mode. New PID=21990. May 25 00:03:56 liman-GA-78LMT-S2 smartd[21990]: file /var/run/smartd.pid written containing PID 21990 Логирование дополнительно настраивать не нужно, все сохраняется в /var/log/syslog. После запуска, интерактивно, можно понаблюдать так: tail -f /var/log/syslog
| ||||||||||||||||||||||||||
Просмотров: 1190 | | ||||||||||||||||||||||||||
|
Всего комментариев: 0 | |
НОВОЕ ВИДЕО | Смотреть все видео |
Добавить видео |
Яндекс поиск
Опрос
Яндекс диск
Яндекс.Диск — бесплатный сервис, благодаря которому ваши фотографии, видеоролики и документы доступны вам из любой точки мира, где есть интернет.
Новости
НОВЫЕ СТАТЬИ
ПОПУЛЯРНОЕ
Популярное Видео