当前位置:网站首页>Hard disk monitoring and analysis tool: smartctl
Hard disk monitoring and analysis tool: smartctl
2022-07-03 18:42:00 【Brother Xing plays with the clouds】
Smartctl(S.M.A.R.T Self monitoring , Analysis and Reporting Technology ) It's a class Unix Implementation under system SMART Task command line suite or tool , It's for printing SMART Self inspection and Error log , Enable and disable SMRAT Automatic detection , And initialize the device self-test .
Smartctl about Linux Physics The server Very useful , In these The server On , You can perform error checking on smart disks , And will Hardware RAID Extract the relevant disk information .
In this post , We will discuss smartctl Some practical examples of commands . If your Linux Not installed in Shanghai smartctl, Please follow the steps below to install .
Use Smartctl check Dell The server Bad record http://www.linuxidc.com/Linux/2012-07/65723.htm
install Smartctl
about Ubuntu
- $ sudo apt-get install smartmontools
about CentOS & RHEL
- # yum install smartmontools
start-up Smartctl service
about Ubuntu
- $ sudo /etc/init.d/smartmontools start
about CentOS & RHEL
- # service smartd start ; chkconfig smartd on
Examples
Examples :1 Check the disk for Smart Whether the function is enabled
- [email protected]:~# smartctl -i /dev/sdb
- smartctl 6.22013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
- Copyright(C)2002-13,BruceAllen,ChristianFranke, www.smartmontools.org
- === START OF INFORMATION SECTION ===
- ModelFamily:SeagateMomentus5400.6
- DeviceModel: ST9320325AS
- SerialNumber:5VD2V59T
- LU WWN DeviceId:5000c50020a37ec4
- FirmwareVersion:0002BSM1
- UserCapacity:320,072,933,376 bytes [320 GB]
- SectorSize:512 bytes logical/physical
- RotationRate:5400 rpm
- Deviceis:In smartctl database [for details use:-P show]
- ATA Versionis: ATA8-ACS T13/1699-D revision 4
- SATA Versionis: SATA 2.6,1.5Gb/s
- LocalTimeis:SunNov1612:32:092014 IST
- SMART support is:Available- device has SMART capability.
- SMART support is:Enabled
here ‘/dev/sdb’ It's your hard drive . The last two lines in the output above show SMART Feature enabled .
Examples :2 Enable disk Smart function
- [email protected]:~# smartctl -s on /dev/sdb
- smartctl 6.22013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
- Copyright(C)2002-13,BruceAllen,ChristianFranke, www.smartmontools.org
- === START OF ENABLE/DISABLE COMMANDS SECTION ===
- SMART Enabled.
Examples :3 Disable disk Smart function
- [email protected]:~# smartctl -s off /dev/sdb
- smartctl 6.22013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
- Copyright(C)2002-13,BruceAllen,ChristianFranke, www.smartmontools.org
- === START OF ENABLE/DISABLE COMMANDS SECTION ===
- SMART Disabled.Use option -s with argument 'on' to enable it.
Examples :4 Displays the details of the disk Smart Information
- [email protected]:~# smartctl -a /dev/sdb // For IDE drive
- [email protected]:~# smartctl -a -d ata /dev/sdb // For SATA drive
Examples :5 Displays the overall health of the disk
- [email protected]:~# smartctl -H /dev/sdb
- smartctl 6.22013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
- Copyright(C)2002-13,BruceAllen,ChristianFranke, www.smartmontools.org
- === START OF READ SMART DATA SECTION ===
- SMART overall-health self-assessment test result: PASSED
- Warning:This result is based on an Attribute check.
- Please note the following marginal Attributes:
- ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
- 190Airflow_Temperature_Cel0x0022067045045Old_ageAlwaysIn_the_past33(Min/Max25/33)
Examples :6 Use long and short Option test hard disk
Long test
- [email protected]:~# smartctl --test=long/dev/sdb
- smartctl 6.22013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
- Copyright(C)2002-13,BruceAllen,ChristianFranke, www.smartmontools.org
- === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
- Sending command:"Execute SMART Extended self-test routine immediately in off-line mode".
- Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.
- Testing has begun.
- Please wait 102 minutes for test to complete.
- Test will complete after SunNov1614:29:432014
- Use smartctl -X to abort test.
perhaps , We can redirect the test output to the log file , It looks like this
- [email protected]:~# smartctl --test=long/dev/sdb >/var/log/long.text
Short test
- [email protected]:~# smartctl --test=short/dev/sdb
- smartctl 6.22013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
- Copyright(C)2002-13,BruceAllen,ChristianFranke, www.smartmontools.org
- === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
- Sending command:"Execute SMART Short self-test routine immediately in off-line mode".
- Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful.
- Testing has begun.
- Please wait 1 minutes for test to complete.
- Test will complete after SunNov1612:51:452014
- Use smartctl -X to abort test.
or
- [email protected]:~# smartctl --test=short/dev/sdb >/var/log/short.text
Be careful :short The test will cost the most 2 minute , And in the long There is no time limit in the test , Because it will read and verify every segment of the disk .
Examples :7 Check the self-test results of the drive
- [email protected]:~# smartctl -l selftest /dev/sdb
- smartctl 6.22013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
- Copyright(C)2002-13,BruceAllen,ChristianFranke, www.smartmontools.org
- === START OF READ SMART DATA SECTION ===
- SMART Self-test log structure revision number 1
- NumTest_DescriptionStatusRemainingLifeTime(hours) LBA_of_first_error
- # 1 Short offline Completed: read failure 90% 492 210841222
- # 2 Extended offline Completed: read failure 90% 492 210841222
Examples :8 Calculate test time estimates
- [email protected]:~# smartctl -c /dev/sdb
- smartctl 6.22013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
- Copyright(C)2002-13,BruceAllen,ChristianFranke, www.smartmontools.org
- === START OF READ SMART DATA SECTION ===
- General SMART Values:
- Offline data collection status:(0x00)Offline data collection activity
- was never started.
- AutoOfflineDataCollection:Disabled.
- Self-test execution status:(121)The previous self-test completed having
- the read element of the test failed.
- Total time to complete Offline
- data collection:(0) seconds.
- Offline data collection
- capabilities:(0x73) SMART execute Offline immediate.
- AutoOffline data collection on/off support.
- SuspendOffline collection upon new
- command.
- NoOffline surface scan supported.
- Self-test supported.
- ConveyanceSelf-test supported.
- SelectiveSelf-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.
- GeneralPurposeLogging supported.
- Shortself-test routine
- recommended polling time:(1) minutes.
- Extendedself-test routine
- recommended polling time:(102) minutes.
- Conveyanceself-test routine
- recommended polling time:(2) minutes.
- SCT capabilities:(0x103b) SCT Status supported.
- SCT ErrorRecoveryControl supported.
- SCT FeatureControl supported.
- SCT DataTable supported.
Examples :9 Display disk error log
- [email protected]:~# smartctl -l error /dev/sdb
- SampleOutput
- smartctl 6.22013-07-26 r3841 [x86_64-linux-3.13.0-32-generic](local build)
- Copyright(C)2002-13,BruceAllen,ChristianFranke, www.smartmontools.org
- === START OF READ SMART DATA SECTION ===
- SMART ErrorLogVersion:1
- ATA ErrorCount:5
- CR =CommandRegister[HEX]
- FR =FeaturesRegister[HEX]
- SC =SectorCountRegister[HEX]
- SN =SectorNumberRegister[HEX]
- CL =CylinderLowRegister[HEX]
- CH =CylinderHighRegister[HEX]
- DH =Device/HeadRegister[HEX]
- DC =DeviceCommandRegister[HEX]
- ER =Errorregister[HEX]
- ST =Statusregister[HEX]
- Powered_Up_Timeis 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.
- Commands leading to the command that caused the error were:
- CR FR SC SN CL CH DH DC Powered_Up_TimeCommand/Feature_Name
- ----------------------------------------------------
- 25 da 08 e7 e5 a5 4c0000:30:44.515 READ DMA EXT
- 25 da 08 df e5 a5 4c0000:30:44.514 READ DMA EXT
- 25 da 805f e5 a5 4c0000:30:44.502 READ DMA EXT
- 25 da f0 5f e6 a5 4c0000:30:44.496 READ DMA EXT
- 25 da 104f e6 a5 4c0000:30:44.383 READ DMA EXT
边栏推荐
- G1 garbage collector of garbage collector
- 简述服务量化分析体系
- Sensor 调试流程
- FBI 警告:有人利用 AI 换脸冒充他人身份进行远程面试
- Computer graduation design PHP makeup sales Beauty shopping mall
- 多媒体NFT聚合平台OKALEIDO即将上线,全新的NFT时代或将来临
- What problems can cross-border e-commerce sellers solve with multi platform ERP management system
- Usage of laravel conditional array in
- 189. Rotation array
- Zero length array
猜你喜欢
Transformer T5 model read slowly
2022-2028 global solid phase extraction column industry research and trend analysis report
NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
CTO and programmer were both sentenced for losing control of the crawler
Getting started with JDBC
Sensor debugging process
2022-2028 global marking ink industry research and trend analysis report
Win 11 major updates, new features love love.
English grammar_ Noun classification
2022-2028 global petroleum pipe joint industry research and trend analysis report
随机推荐
2022-2028 global aircraft head up display (HUD) industry research and trend analysis report
Win 11 major updates, new features love love.
What problems can cross-border e-commerce sellers solve with multi platform ERP management system
Closure and closure function
Bidding procurement scheme management of Oracle project management system
Coordinate layer conversion tool (video)
Torch learning notes (1) -- 19 common ways to create tensor
Sensor debugging process
Usage of laravel conditional array in
An academic paper sharing and approval system based on PHP for computer graduation design
SQL injection -day16
SQL: special update operation
2022-2028 global physiotherapy clinic industry research and trend analysis report
硬盘监控和分析工具:Smartctl
NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
Introduction to SSH Remote execution command
[Yu Yue education] world reference materials of Microbiology in Shanghai Jiaotong University
FBI warning: some people use AI to disguise themselves as others for remote interview
204. Count prime
189. Rotation array