[root@localhost scripts]# smartctl --all /dev/sda
-bash: smartctl: 未找到命令
[root@localhost scripts]# yum search smartctl -y
已加載插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
======================================================================================= 匹配:smartctl ========================================================================================
smartmontools.x86_64 : Tools for monitoring SMART capable hard disks
[root@localhost scripts]# yum install smartmontools.x86_64 -y
smartctl
-i 指定設(shè)備
-d 指定設(shè)備類(lèi)型,例如:ata, scsi, marvell, sat, 3ware,N
-a 或A 顯示所有信息
-l 指定日志的類(lèi)型,例如:TYPE: error, selftest, selective, directory,background, scttemp[sts,hist]
-H 查看硬盤(pán)健康狀態(tài)
-t short 后臺(tái)檢測(cè)硬盤(pán),消耗時(shí)間短
-t long 后臺(tái)檢測(cè)硬盤(pán),消耗時(shí)間長(zhǎng)
-C -t short 前臺(tái)檢測(cè)硬盤(pán),消耗時(shí)間短
-C -t long 前臺(tái)檢測(cè)硬盤(pán),消耗時(shí)間長(zhǎng)
-X 中斷后臺(tái)檢測(cè)硬盤(pán)
-l selftest 顯示硬盤(pán)檢測(cè)日志
運(yùn)行 smartctl --scan 以打印附加設(shè)備id和RAID類(lèi)型的所有設(shè)備:

成都網(wǎng)站制作、做網(wǎng)站介紹好的網(wǎng)站是理念、設(shè)計(jì)和技術(shù)的結(jié)合。成都創(chuàng)新互聯(lián)公司擁有的網(wǎng)站設(shè)計(jì)理念、多方位的設(shè)計(jì)風(fēng)格、經(jīng)驗(yàn)豐富的設(shè)計(jì)團(tuán)隊(duì)。提供PC端+手機(jī)端網(wǎng)站建設(shè),用營(yíng)銷(xiāo)思維進(jìn)行網(wǎng)站設(shè)計(jì)、采用先進(jìn)技術(shù)開(kāi)源代碼、注重用戶(hù)體驗(yàn)與SEO基礎(chǔ),將技術(shù)與創(chuàng)意整合到網(wǎng)站之中,以契合客戶(hù)的方式做到創(chuàng)意性的視覺(jué)化效果。
[root@localhost scripts]# smartctl --scan
/dev/sda -d scsi # /dev/sda, SCSI device
/dev/sdb -d scsi # /dev/sdb, SCSI device
/dev/bus/0 -d megaraid,0 # /dev/bus/0 [megaraid_disk_00], SCSI device
/dev/bus/0 -d megaraid,1 # /dev/bus/0 [megaraid_disk_01], SCSI device
在這里,megaraid 是RAID類(lèi)型,megaraid_disk_00第一個(gè)0代表的是raid0 第二個(gè)0代表的是硬盤(pán)設(shè)備 id 0
megaraid 是RAID類(lèi)型,megaraid_disk_01第一個(gè)0代表的是raid1 第二個(gè)1代表的是硬盤(pán)設(shè)備 id 1
[root@localhost scripts]# smartctl -i /dev/sda1
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-3.10.0-862.el7.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org
Smartctl open device: /dev/sda1 failed: DELL or MegaRaid controller, please try adding '-d megaraid,N'
由于演示的服務(wù)器是dell的,同時(shí)事先給這個(gè)機(jī)器的2塊ssd硬盤(pán)做了raid0的
[root@localhost scripts]# /opt/MegaRAID/MegaCli/MegaCli64 -cfgdsply -aALL|grep -A7 "Virtual Drive Information"|sed '1d'
Virtual Drive: 0 (Target Id: 0)
Name :
RAID Level : Primary-0, Secondary-0, RAID Level Qualifier-0
Size : 223.0 GB
State : Optimal
Strip Size : 64 KB
Number Of Drives : 1
--
Virtual Drive Information:
Virtual Drive: 1 (Target Id: 1)
Name :
RAID Level : Primary-0, Secondary-0, RAID Level Qualifier-0
Size : 223.0 GB
State : Optimal
Strip Size : 64 KB
Number Of Drives : 1查看硬盤(pán)設(shè)備類(lèi)型(dell服務(wù)器,并且磁盤(pán)做了raid0的):
[root@localhost scripts]# smartctl -i /dev/sda1 -d megaraid,0
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-3.10.0-862.el7.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Intel 730 and DC S35x0/3610/3700 Series SSDs
Device Model: INTEL SSDSC2BB240G7
Serial Number: PHDV7234023C240AGN
LU WWN Device Id: 5 5cd2e4 14e0aaaf5
Firmware Version: N2010112
User Capacity: 240,057,409,536 bytes [240 GB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-3 T13/2161-D revision 5
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Fri Jan 17 17:13:49 2020 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabledsuper server 超威服務(wù)器:主板未綁定raid卡, 硬盤(pán)沒(méi)有做raid
[root@localhost ~]# smartctl -i /dev/sda
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-3.10.0-957.el7.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: SanDisk SD8SBAT256G1122
Serial Number: 161855404280
LU WWN Device Id: 5 001b44 4a4b8c6ca
Firmware Version: Z2333000
User Capacity: 256,060,514,304 bytes [256 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 T13/2015-D revision 3
SATA Version is: SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Fri Jan 17 17:35:09 2020 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled查看硬盤(pán)型號(hào),檢測(cè)硬盤(pán)狀態(tài),查看硬盤(pán)報(bào)錯(cuò)日志:
[root@localhost ~]# smartctl -i /dev/sda -H -l error
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-3.10.0-957.el7.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: SanDisk SD8SBAT256G1122
Serial Number: 161855404280
LU WWN Device Id: 5 001b44 4a4b8c6ca
Firmware Version: Z2333000
User Capacity: 256,060,514,304 bytes [256 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: ACS-2 T13/2015-D revision 3
SATA Version is: SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Fri Jan 17 17:40:50 2020 CST
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
SMART Error Log Version: 1
No Errors Loggeddell服務(wù)器查看磁盤(pán)的詳細(xì)信息:
[root@localhost ~]# smartctl -a /dev/sda
[root@localhost ~]# smartctl -A /dev/sda1 -d megaraid,0
[root@localhost ~]# smartctl -a /dev/sda1 -d megaraid,0
[root@localhost ~]# smartctl -a -d megaraid,0 /dev/sda -s on
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-3.10.0-862.el7.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Intel 730 and DC S35x0/3610/3700 Series SSDs
Device Model: INTEL SSDSC2BB240G7
Serial Number: PHDV7234023C240AGN
LU WWN Device Id: 5 5cd2e4 14e0aaaf5
Firmware Version: N2010112
User Capacity: 240,057,409,536 bytes [240 GB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-3 T13/2161-D revision 5
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Fri Feb 7 17:24:40 2020 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.
=== START OF READ SMART DATA SECTION ===
SMART Status not supported: ATA return descriptor not supported by controller firmware
SMART overall-health self-assessment test result: PASSED
Warning: This result is based on an Attribute check.
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: ( 0) seconds.
Offline data collection
capabilities: (0x79) SMART execute Offline immediate.
No Auto Offline data collection support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
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: ( 2) minutes.
Conveyance self-test routine
recommended polling time: ( 2) 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: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
5 Reallocated_Sector_Ct 0x0032 100 100 000 Old_age Always - 0
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 18907
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 16
170 Available_Reservd_Space 0x0033 100 100 010 Pre-fail Always - 0
171 Program_Fail_Count 0x0032 100 100 000 Old_age Always - 0
172 Erase_Fail_Count 0x0032 100 100 000 Old_age Always - 0
174 Unsafe_Shutdown_Count 0x0032 100 100 000 Old_age Always - 12
175 Power_Loss_Cap_Test 0x0033 100 100 010 Pre-fail Always - 13590 (125 4176)
183 SATA_Downshift_Count 0x0032 100 100 000 Old_age Always - 0
184 End-to-End_Error 0x0033 100 100 090 Pre-fail Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
190 Temperature_Case 0x0022 072 068 000 Old_age Always - 28 (Min/Max 19/32)
192 Unsafe_Shutdown_Count 0x0032 100 100 000 Old_age Always - 12
194 Temperature_Internal 0x0022 100 100 000 Old_age Always - 28
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
199 CRC_Error_Count 0x003e 100 100 000 Old_age Always - 0
225 Host_Writes_32MiB 0x0032 100 100 000 Old_age Always - 275286
226 Workld_Media_Wear_Indic 0x0032 100 100 000 Old_age Always - 1638
227 Workld_Host_Reads_Perc 0x0032 100 100 000 Old_age Always - 1
228 Workload_Minutes 0x0032 100 100 000 Old_age Always - 1134456
232 Available_Reservd_Space 0x0033 100 100 010 Pre-fail Always - 0
233 Media_Wearout_Indicator 0x0032 099 099 000 Old_age Always - 0
234 Thermal_Throttle 0x0032 100 100 000 Old_age Always - 0/0
241 Host_Writes_32MiB 0x0032 100 100 000 Old_age Always - 275286
242 Host_Reads_32MiB 0x0032 100 100 000 Old_age Always - 3597
243 NAND_Writes_32MiB 0x0032 100 100 000 Old_age Always - 850447
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
No self-tests have been logged. [To run self-tests, use: smartctl -t]
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.HP硬盤(pán):
smartctl -s on -d cciss,0 /dev/cciss/c0d0 開(kāi)啟SMART
smartctl -a -d cciss,0 -i /dev/cciss/c0d0 顯示所有SMART信息
smartctl -l error -d cciss,0 -i /dev/cciss/c0d0 查看磁盤(pán)錯(cuò)誤日志演示記錄到此,方便工作中查閱
新聞名稱(chēng):硬盤(pán)管理工具介紹:smartctl
本文來(lái)源:http://chinadenli.net/article18/ihhcgp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供營(yíng)銷(xiāo)型網(wǎng)站建設(shè)、App開(kāi)發(fā)、面包屑導(dǎo)航、動(dòng)態(tài)網(wǎng)站、品牌網(wǎng)站建設(shè)、品牌網(wǎng)站設(shè)計(jì)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)