FastNetMon

Showing posts with label smartmontools. Show all posts
Showing posts with label smartmontools. Show all posts

Wednesday, 6 October 2010

S.M.A.R.T, smartctl и Adaptec 5405

Давно мучает меня - как получить S.M.A.R.T данные жестких дисков, если они подключены к Adaptec RAID контроллеру?

Сам массив доступен системе по привычному адресу /dev/sda и если сделать:
smartctl --all /dev/sda

То нас неминуемо постигнет разочарование:
smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

Device: Adaptec Device 0 Version: V1.0
scsiModePageOffset: response length too short, resp_len=4 offset=4 bd_len=0
>> Terminate command early due to bad response to IEC mode page
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

Как же быть? Да очень просто - Linux создает для всех физических дисков, подключенных к контроллеру виртуальные устройства (честно говоря, я не понял что это именно есть, но считать данные как с блочного устройства у меня с них не получилось да и команда file считает их "/dev/sg1: character special (21/1)", что также далеко от блочного устройства), через которые можно получить данные S.M.A.R.T. Имена этих устройств имеют вид /dev/sgX, причем, sg0 - это сам контроллер (и попытка прочесть у него что-либо посредством smartctl ни к чему кроме ошибки не приведет), а вот sg1...sgN - это SAS жесткие диски (возможно, для SATA дисков имена будут иные, возможности проверить у меня нету), подключенные к RAID контроллеру.

Итого, делаем запрос S.M.A.R.T. диска /dev/sg1:
smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

Device: SEAGATE ST3300657SS Version: 0008
Serial number: 3SJ20ZJK00009105PBVK
Device type: disk
Transport protocol: SAS
Local Time is: Wed Oct 6 09:04:21 2010 CEST
Device supports SMART and is Enabled
Temperature Warning Enabled
SMART Health Status: OK

Current Drive Temperature: 50 C
Drive Trip Temperature: 68 C
Elements in grown defect list: 0
Vendor (Seagate) cache information
Blocks sent to initiator = 757336451
Blocks received from initiator = 163754101
Blocks read from cache and sent to initiator = 55190153
Number of read and write commands whose size <= segment size = 849389 Number of read and write commands whose size > segment size = 0
Vendor (Seagate/Hitachi) factory information
number of hours powered up = 13.22
number of minutes until next internal SMART test = 34

Error counter log:
Errors Corrected by Total Correction Gigabytes Total
ECC rereads/ errors algorithm processed uncorrected
fast | delayed rewrites corrected invocations [10^9 bytes] errors
read: 3230895 0 0 3230895 3230895 387.756 0
write: 0 0 0 0 0 83.880 0
verify: 551501 0 0 551501 551501 0.000 0

Non-medium error count: 0

[GLTSD (Global Logging Target Save Disable) set. Enable Save with '-S on']
No self-tests have been logged
Long (extended) Self Test duration: 3200 seconds [53.3 minutes]


По мотивам: http://www.cyberciti.biz/faq/linux-checking-sas-sata-disks-behind-adaptec-raid-controllers/

Sunday, 7 February 2010

Сборка smartmontools 5.39.1 из исходников

Причина пересборки вручную довольно простая, при диагностике стандартным Дебияновским smartctl для новых винтов ST31500341AS появились загадочные записи:

241 Unknown_Attribute 0x0000 100 253 000 Old_age Offline - 2106849488
242 Unknown_Attribute 0x0000 100 253 000 Old_age Offline - 1822690218


А для SSD дсиков он начал выдавать полный бред.

Офсайт: http://sourceforge.net/apps/trac/smartmontools/

cd /usr/src
wget 'http://downloads.sourceforge.net/project/smartmontools/smartmontools/5.39.1/smartmontools-5.39.1.tar.gz?use_mirror=sunet'
tar -xf smartmontools-5.39.1.tar.gz
cd smartmontools-5.39.1


Если же свежеть версии релиза не устраивает, можно собрать из svn:

apt-get install -y subversion
cd /usr/src
svn co https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk/smartmontools smartmontools
cd smartmontool
./autogen.sh


Собираем:

./configure --prefix=/opt/smartmontools
make
make install



Запускаем диагностику:
/opt/smartmontools/sbin/smartctl --all /dev/sda



Ну вот и все, непонятные "Unknown_Attribute" сменились на Total_LBAs_Written и Total_LBAs_Read.

Thursday, 14 January 2010

Установка smartmontools на FreeBSD

cd /usr/ports/sysutils/smartmontools
make install clean


Запускать мониторинг так:
/usr/local/sbin/smartctl --all /dev/ad6