ÒýÓÃ:ÌáÒª£º´ó¼ÒÐÄÀí×îŵIJ»Êǰ²×°Ä³¸öϵͳ£¬¶øÊÇÐÁÐÁ¿à¿à°²×°Ö®ºó£¬ºöÈ»ÓÐÒ»ÌìÓ²ÅÌ»µÁË£¬ÓÖûÓб¸·Ý(DAT£¬DLTÖ®Àà´Å´ø»ú¹óµÃÏÅËÀÈË)¡£ÔõôÑù²ÅÄÜÖªµÀÄãµÄÓ²ÅÌÄÜ·ñ¹ýÐÂÄêÄØ£¿(Ó²ÅÌ״̬ÈçºÎ£¿) ÌØ±ðÊÇÈç¹ûÄܹ»ÌáǰԤ±¨£¬¸æËß´ó¼ÒÓ²Å̿춥²»×¡ÁË£¬ÄǸÃÓжàºÃ¡£
¡¡¡¡
¡¡¡¡±¾ÎIJâÊÔ»·¾³FreeBSDºÍDebian
¡¡¡¡
¡¡¡¡½â¾ö°ì·¨£º
¡¡¡¡
¡¡¡¡SMART
¡¡¡¡SMART(SFF-8035i) ÊÇÓ²ÅÌÉú²úÉÌÃǽ¨Á¢µÄÒ»¸ö¹¤Òµ±ê×¼£¬Õâ¸ö±ê×¼¾ÍÊÇÔÚÓ²ÅÌÉϱ£´æÒ»¸ö¸úÖ´ÐÐÇé¿ö£¬¿É¿¿³Ì¶È£¬¶ÁÕÒ´íÎóÂʵÈÊôÐԵıí¸ñ¡£ËùÓÐÊôÐÔ¶¼ÓÐÒ»¸ö1byte(´óС·¶Î§1-253)µÄ±ê×¼»¯Öµ£¬»¹°üº¬ÁíÒ»¸ö1byteµÄ¹Ø¼ü½×¶ÎÖµ£¬Èç¹ûÊôÐÔ±í¸ñÄÚij¸öÊý¾Ý½Ó½üСÓÚ»ò´ïµ½¹Ø¼ü½×¶ÎÖµ£¬ÄÇôÄãµÄÓ²Å̾Ϳì¸úÄãÓÀ±ðÁË£¬ÖÁÉÙÒ²Êdz¬¹ýËüµÄÉè¼ÆÊ¹Óü«ÏÞÁË- ¸Ã×ö±¸·ÝºÍ×µÄ´òËãÁË¡£
¡¡¡¡
¡¡¡¡SFF-8035i¹¤Òµ±ê×¼¾¹ýATA-3£¬ATA-4µ½ÁËATA-5£¬¼ÓÈëÁËÒ»¸ö´íÎóÐÅÏ¢Îļþ(error log) ºÍһϵÁÐÓ²ÅÌ×Ô²âSMARTÃüÁî¡£SMARTÊÊÓ¦ÓëIDEºÍSCSIÓ²ÅÌ¡£
¡¡¡¡
¡¡¡¡ÎÒÓÃFreeBSD 5.2ºÍDebian×öÁËʵÑ飬¶¼²»´í£¬OpenBSDÏÂÃæ¿ÉÒÔÖ±½ÓÓÃatactl£¬´ó¼Ò¿´¿´man atactl¡£ÆäËülinuxϵͳûÎÊÌâ¡£
¡¡¡¡
¡¡¡¡°²×° smartmontools
¡¡¡¡FreeBSD:
¡¡¡¡
¡¡¡¡#/usr/ports/sysutils/smartmontools
¡¡¡¡#make install clean
¡¡¡¡#cp /usr/local/etc/rc.d/smartd.sh.sample /usr/local/etc/rc.d/smartd.sh
¡¡¡¡#cp /usr/local/etc/smartd.conf.sample /usr/local/etc/smartd.conf
¡¡¡¡#chmod 555 /usr/local/etc/rc.d/smartd.sh
¡¡¡¡
¡¡¡¡Debian:
¡¡¡¡apt-get install smartmontool*
¡¡¡¡/etc/smartd.conf
¡¡¡¡
¡¡¡¡FreeBSDÉèÖÃÎļþ/usr/local/etc/smartd.conf
¡¡¡¡DebianÉèÖÃÎļþ /etc/smartd.conf
¡¡¡¡
¡¡¡¡×¢Ò⣺
¡¡¡¡
¡¡¡¡Ç§Íò²»ÒªÍüÁ˸ÄдÉèÖÃÎļþ£¡£¡£¡£¡
¡¡¡¡FreeBSDϵÚÒ»ÕÅIDEÓ²ÅÌÊÇad0£¬SCSIÓ²ÅÌÊÇda0
¡¡¡¡DebianϵÚÒ»ÕÅIDEÓ²ÅÌÊÇ/dev/hda£¬SCSIÓ²ÅÌÊÇ/dev/sda
¡¡¡¡
¡¡¡¡ÏÂÃæÎÒÓÃFreeBSD×öÀý×Ó£¬ÎÒµÄÓ²ÅÌÊÇIDE£¬Èç¹ûÄãµÄÊÇSCSI£¬Äã¾ÍÈ¥¹Ù·½ÍøÕ¾²éѯ¡£
¡¡¡¡
¡¡¡¡Æô¶¯¼à»¤³ÌÐò£º
¡¡¡¡/usr/local/etc/rc.d/smartd.sh start
¡¡¡¡
¡¡¡¡Ê×ÏÈÈÃÎÒÃÇ¿´Ò»ÏÂÄãµÄÓ²ÅÌÊÇ·ñÖ§³ÖSMART£º
¡¡¡¡
¡¡¡¡bash-2.05b# smartctl -i /dev/ad0
¡¡¡¡
¡¡¡¡smartctl version 5.26 Copyright (C) 2002-3 Bruce Allen
¡¡¡¡Home page is http://smartmontools.sourceforge.net/
¡¡¡¡=== START OF INFORMATION SECTION ===
¡¡¡¡Device Model: IBM-DJSA-220
¡¡¡¡Serial Number: 44K443Z0103
¡¡¡¡Firmware Version: JS4OAC3A
¡¡¡¡Device is: Not in smartctl database [for details use: -P showall]
¡¡¡¡ATA Version is: 5
¡¡¡¡ATA Standard is: ATA/ATAPI-5 T13 1321D revision 1
¡¡¡¡Local Time is: Mon Dec 22 21:04:38 2003 CET
¡¡¡¡SMART support is: Available - device has SMART capability.
¡¡¡¡SMART support is: enable
¡¡¡¡
¡¡¡¡The SMART RETURN STATUS return value (smartmontools -H option/Directive)
¡¡¡¡can not be retrieved with this version of ATAng, please do not rely on this value
¡¡¡¡
¡¡¡¡¿´¿´ÎÒµÄÅ̽¡¿µ²âÊÔ£¬Èç¹ûÄãµÄself-assessment test resultÊÇFAILING£¬ÄǾÍÊÇ˵
¡¡¡¡ËüÒªÍêµ°ÁË£¬ÂíÉϱ¸·Ý£¡£¡£¡
¡¡¡¡
¡¡¡¡bash-2.05b# smartctl -Hc /dev/ad0
¡¡¡¡
¡¡¡¡smartctl version 5.26 Copyright (C) 2002-3 Bruce Allen
¡¡¡¡Home page is http://smartmontools.sourceforge.net/
¡¡¡¡The SMART RETURN STATUS return value (smartmontools -H option/Directive)
¡¡¡¡can not be retrieved with this version of ATAng, please do not rely on
¡¡¡¡this value
¡¡¡¡=== START OF READ SMART DATA SECTION ===
¡¡¡¡SMART overall-health self-assessment test result: PASSED
¡¡¡¡
¡¡¡¡General SMART Values:
¡¡¡¡Offline data collection status: (0x00) Offline data collection activity
¡¡¡¡was
¡¡¡¡never started.
¡¡¡¡Auto Offline Data Collection: Disabled.
¡¡¡¡
¡¡¡¡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: ( 650) seconds.
¡¡¡¡Offline data collection
¡¡¡¡capabilities: (0x1b) 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.
¡¡¡¡No 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.
¡¡¡¡No General Purpose Logging support.
¡¡¡¡Short self-test routine
¡¡¡¡recommended polling time: ( 2) minutes.
¡¡¡¡Extended self-test routine
¡¡¡¡recommended polling time: ( 29) minutes.
¡¡¡¡
¡¡¡¡ÏÂÃæ±í¸ñ¸ø³öµÄÊôÐÔÐÅÏ¢¸ù¾ÝÄãµÄÓ²Å̳§É̲»Í¬¶ø²»Í¬£¬×î ÖØÒªµÄÊÇÃ÷°×ÿ¸ö×ÝÐеÄÒâÒ壺Èç¹ûÓÐÒ»¸ö±ê×¼Öµ(VALUE)СÓÚ»òµÈ춹ؼüÖµ(THRESH)ʱ£¬WHEN_FAILED ÐÐ»á¸ø³öÐÅÏ¢£¬ÎÒWHEN_FAILED×ÝÐÐÊÇ¿ÕÐУ¬ËµÃ÷ûʶù¡£Èç¹ûWHEN_FAILED±¨´í£¬Ó²ÅÌÓÐÎÊÌâÁË¡£¡£¡£¡£WORST ÊDZê×¼Öµ(VALUE)µÄ×îСֵ¡£
¡¡¡¡
¡¡¡¡bash-2.05b# smartctl -A /dev/ad0
¡¡¡¡smartctl version 5.26 Copyright (C) 2002-3 Bruce Allen
¡¡¡¡Home page is http://smartmontools.sourceforge.net/
¡¡¡¡The SMART RETURN STATUS return value (smartmontools -H option/Directive)
¡¡¡¡can not be retrieved with this version of ATAng, please do not rely on
¡¡¡¡this value
¡¡¡¡=== START OF READ SMART DATA SECTION ===
¡¡¡¡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 062 Pre-fail Always
¡¡¡¡- 0
¡¡¡¡2 Throughput_Performance 0x0005 100 100 040 Pre-fail Offline
¡¡¡¡- 0
¡¡¡¡3 Spin_Up_Time 0x0007 113 113 033 Pre-fail Always
¡¡¡¡- 1
¡¡¡¡4 Start_Stop_Count 0x0012 100 100 000 Old_age Always
¡¡¡¡- 985
¡¡¡¡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 100 100 040 Pre-fail Offline
¡¡¡¡- 0
¡¡¡¡9 Power_On_Hours 0x0012 097 097 000 Old_age Always
¡¡¡¡- 1642
¡¡¡¡10 Spin_Retry_Count 0x0013 100 100 060 Pre-fail Always
¡¡¡¡- 0
¡¡¡¡12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always
¡¡¡¡- 914
¡¡¡¡191 G-Sense_Error_Rate 0x000a 100 100 000 Old_age Always
¡¡¡¡- 0
¡¡¡¡192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always
¡¡¡¡- 8
¡¡¡¡193 Load_Cycle_Count 0x0012 096 096 050 Old_age Always
¡¡¡¡- 45262
¡¡¡¡196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always
¡¡¡¡- 17
¡¡¡¡197 Current_Pending_Sector 0x0022 100 100 000 Old_age Always
¡¡¡¡- 1
¡¡¡¡198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline
¡¡¡¡- 0
¡¡¡¡199 UDMA_CRC_Error_Count 0x000a 200 200 000 Old_age Always
¡¡¡¡- 0
¡¡¡¡
¡¡¡¡ÏÂÃæÃüÁî¸ø³öÓ²ÅÌÀúÊ·´íÎóÐÅÏ¢(error log),ÒòΪƪ·ù¹ØÏµÎҾͲ»¸ø³öÁË¡£
¡¡¡¡smartctl -l error /dev/ad0
¡¡¡¡
¡¡¡¡ÏÂÃæÃüÁî¸ø³öÓ²ÅÌ×Ô²â
¡¡¡¡
¡¡¡¡smartctl -l selftest /dev/ad0
¡¡¡¡
¡¡¡¡ÖÕÖ¹Ó²ÅÌ×Բ⡣
¡¡¡¡
¡¡¡¡smartctl -X /dev/ad0
¡¡¡¡
¡¡¡¡½¨Ò飺¸ÄдÉèÖÃÎļþsmartd.conf£¬ÓÐÒ»¸ö¡°-m¡±µÄÑ¡Ïî·Ç³£ÓÐÓã¬Ëü¿ÉÒÔ°ÑÐÅÏ¢ÓÃmail·¢¸øÄã¡£
¡¡¡¡
¡¡¡¡±à¼ºó¼Ç£º
¡¡¡¡SMART ¿ÉÒÔÌáÐÑÄ㣬µ«²»ÄܰïÄã×ö±¸·Ý¡£ÒªÕæÕýµÄÈÃSMARTΪÄã·þÎñ£¬Ó¦¸ÃºÃºÃ¶Áдsmartd & smartd.conf µÄ×¢ÊÍ, ÈÃÆäºǫ́³ÌÐòÔÚÒ»¶¨Çé¿öÏÂÌáÐÑÄã(mail)ÓÐЩ¹Ø¼üÖµ´ïµ½ÁËΣÏÕÇøÓò, ÒÔÉϸø³öµÄ¼¸¸öÃüÁîÊÇÔÚÄ㿪ʼ¸Ðµ½Çé¿ö²»ÃîµÄʱºò½øÐеÄÊÖ¹¤²âÊÔ¡£