Smartctl - утилита SMART для контроля и диагностики состояния дисков


Материал из Wiki - Iphoster - 'the best ever support'

Перейти к: навигация, поиск

Самые выгодные сервера‎


CentOS 6 - установка:
# yum install -y smartmontools
# /etc/init.d/smartd start

Смотрим какие диски есть на сервере:

# ls -la /dev/ | grep sd
brw-rw----  1 root disk      8,   0 Jan  6 09:01 sda
brw-rw----  1 root disk      8,   1 Jan  6 09:01 sda1
brw-rw----  1 root disk      8,   2 Jan  6 09:01 sda2
brw-rw----  1 root disk      8,   3 Jan  6 09:01 sda3
brw-rw----  1 root disk      8,  16 Jan  6 09:01 sdb
brw-rw----  1 root disk      8,  17 Jan  6 09:01 sdb1
brw-rw----  1 root disk      8,  18 Jan  6 09:01 sdb2
brw-rw----  1 root disk      8,  19 Jan  6 09:01 sdb3

Проверяем состояние обоих:

# smartctl --all /dev/sdb | grep Power_On
 9 Power_On_Hours          0x0032   043   043   000    Old_age   Always       -       42279  
# smartctl --all /dev/sda | grep Power_On 9 Power_On_Hours 0x0032 063 063 000 Old_age Always - 27268


Логи smartctl для CentOS смотрим в /var/log/messages

# tail -n100000 /var/log/messages | grep smart
Jan  9 09:24:49 srv6988 smartd[23724]: smartd 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-573.12.1.el6.x86_64] (local build)
Jan  9 09:24:49 srv6988 smartd[23724]: Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net
Jan  9 09:24:49 srv6988 smartd[23724]: Opened configuration file /etc/smartd.conf
Jan  9 09:24:49 srv6988 smartd[23724]: Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
Jan  9 09:24:49 srv6988 smartd[23724]: Device: /dev/sda, type changed from 'scsi' to 'sat'
Jan  9 09:24:49 srv6988 smartd[23724]: Device: /dev/sda [SAT], opened
Jan  9 09:24:49 srv6988 smartd[23724]: Device: /dev/sda [SAT], WDC WD10EARS-00MVWB0, S/N:WD-WMAZA2845858, WWN:5-0014ee-2b0095f4a, FW:51.0AB51, 1.00 TB
Jan  9 09:24:49 srv6988 smartd[23724]: Device: /dev/sda [SAT], found in smartd database: Western Digital Caviar Green (Adv. Format)
Jan  9 09:24:49 srv6988 smartd[23724]: Device: /dev/sda [SAT], is SMART capable. Adding to "monitor" list.
Jan  9 09:24:49 srv6988 smartd[23724]: Device: /dev/sdb, type changed from 'scsi' to 'sat'
Jan  9 09:24:49 srv6988 smartd[23724]: Device: /dev/sdb [SAT], opened
Jan  9 09:24:49 srv6988 smartd[23724]: Device: /dev/sdb [SAT], WDC WD10EARS-22Y5B1, S/N:WD-WCAV5K857424, WWN:5-0014ee-25a95f8d9, FW:80.00A80, 1.00 TB
Jan  9 09:24:49 srv6988 smartd[23724]: Device: /dev/sdb [SAT], found in smartd database: Western Digital Caviar Green (Adv. Format)
Jan  9 09:24:50 srv6988 smartd[23724]: Device: /dev/sdb [SAT], is SMART capable. Adding to "monitor" list.
Jan  9 09:24:50 srv6988 smartd[23724]: Monitoring 2 ATA and 0 SCSI devices
Jan  9 09:24:50 srv6988 smartd[23726]: smartd has fork()ed into background mode. New PID=23726.
Индекс цитирования