linux 查看smart_离线安装smartctl

linux 查看smart_离线安装smartctlSmartctl(S.M.A.R.T自监控,分析和报告技术)是类Unix系统下实施SMART任务命令行套件或工具,它用于打印SMART自检和错误日志,启用并禁用SMRAT自动检测,以及初始化设备自检。Smartctl对于Linux物理服务器十分有用,在这些服务器上,可以对智能磁盘进行错误检查,并将与硬件RAID相关的磁盘信息摘录下来。在本帖中,我们将讨论smartctl命令的一些实用样例。如果你…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

Smartctl(S.M.A.R.T 自监控,分析和报告技术)是类Unix系统下实施SMART任务命令行套件或工具,它用于打印SMART自检和错误日志,启用并禁用SMRAT自动检测,以及初始化设备自检。

Smartctl对于Linux物理服务器十分有用,在这些服务器上,可以对智能磁盘进行错误检查,并将与硬件RAID相关的磁盘信息摘录下来。

在本帖中,我们将讨论smartctl命令的一些实用样例。如果你的Linux上海没有安装smartctl,请按以下步骤来安装。

安装 Smartctl

对于 Ubuntu

复制代码代码如下:

$ sudo apt-get install smartmontools

对于 CentOS & RHEL

复制代码代码如下:

# yum install smartmontools

启动Smartctl服务

对于 Ubuntu

复制代码代码如下:

$ sudo /etc/init.d/smartmontools start

对于 CentOS & RHEL

复制代码代码如下:

# service smartd start ; chkconfig smartd on

样例样例:1 检查磁盘的 Smart 功能是否启用

复制代码代码如下:

root@linuxtechi:~# smartctl -i /dev/sdb

smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)

Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===

Model Family: Seagate Momentus 5400.6

Device Model: ST9320325AS

Serial Number: 5VD2V59T

LU WWN Device Id: 5 000c50 020a37ec4

Firmware Version: 0002BSM1

User Capacity: 320,072,933,376 bytes [320 GB]

Sector Size: 512 bytes logical/physical

Rotation Rate: 5400 rpm

Device is: In smartctl database [for details use: -P show]

ATA Version is: ATA8-ACS T13/1699-D revision 4

SATA Version is: SATA 2.6, 1.5 Gb/s

Local Time is: Sun Nov 16 12:32:09 2014 IST

SMART support is: Available – device has SMART capability.

SMART support is: Enabled

这里‘/dev/sdb’是你的硬盘。上面输出中的最后两行显示了SMART功能已启用。

样例:2 启用磁盘的 Smart 功能

复制代码代码如下:

root@linuxtechi:~# smartctl -s on /dev/sdb

smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)

Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF ENABLE/DISABLE COMMANDS SECTION ===

SMART Enabled.

样例:3 禁用磁盘的 Smart 功能

复制代码代码如下:

root@linuxtechi:~# smartctl -s off /dev/sdb

smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)

Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF ENABLE/DISABLE COMMANDS SECTION ===

SMART Disabled. Use option -s with argument ‘on’ to enable it.

样例:4 显示磁盘的详细 Smart 信息

复制代码代码如下:

root@linuxtechi:~# smartctl -a /dev/sdb // For IDE drive

root@linuxtechi:~# smartctl -a -d ata /dev/sdb // For SATA drive

样例:5 显示磁盘总体健康状况

复制代码代码如下:

root@linuxtechi:~# smartctl -H /dev/sdb

smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)

Copyright (C) 2002-13, Bruce Allen, Christian Franke, 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

190 Airflow_Temperature_Cel 0x0022 067 045 045 Old_age Always In_the_past 33 (Min/Max 25/33)

样例:6 使用long和short选项测试硬盘

Long测试

复制代码代码如下:

root@linuxtechi:~# smartctl –test=long /dev/sdb

smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)

Copyright (C) 2002-13, Bruce Allen, Christian Franke, 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 Sun Nov 16 14:29:43 2014

Use smartctl -X to abort test.

或者,我们可以重定向测试输出到日志文件,就像下面这样

复制代码代码如下:

root@linuxtechi:~# smartctl –test=long /dev/sdb > /var/log/long.text

Short测试

复制代码代码如下:

root@linuxtechi:~# smartctl –test=short /dev/sdb

smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)

Copyright (C) 2002-13, Bruce Allen, Christian Franke, 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 Sun Nov 16 12:51:45 2014

Use smartctl -X to abort test.

复制代码代码如下:

root@linuxtechi:~# smartctl –test=short /dev/sdb > /var/log/short.text

注意:short测试将花费最多2分钟,而在long测试中没有时间限制,因为它会读取并验证磁盘的每个段。

样例:7 查看驱动器的自检结果

复制代码代码如下:

root@linuxtechi:~# smartctl -l selftest /dev/sdb

smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)

Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===

SMART Self-test log structure revision number 1

Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error

# 1 Short offline Completed: read failure 90% 492 210841222

# 2 Extended offline Completed: read failure 90% 492 210841222

样例:8 计算测试时间估值

复制代码代码如下:

root@linuxtechi:~# smartctl -c /dev/sdb

smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)

Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===

General SMART Values:

Offline data collection status: (0x00) Offline data collection activity

was never started.

Auto Offline Data Collection: 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.

Auto Offline data collection on/off support.

Suspend Offline collection upon new

command.

No 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: ( 102) minutes.

Conveyance self-test routine

recommended polling time: ( 2) minutes.

SCT capabilities: (0x103b) SCT Status supported.

SCT Error Recovery Control supported.

SCT Feature Control supported.

SCT Data Table supported.

样例:9 显示磁盘错误日志

复制代码代码如下:

root@linuxtechi:~# smartctl -l error /dev/sdb

Sample Output

smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-32-generic] (local build)

Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===

SMART Error Log Version: 1

ATA Error Count: 5

CR = Command Register [HEX]

FR = Features Register [HEX]

SC = Sector Count Register [HEX]

SN = Sector Number Register [HEX]

CL = Cylinder Low Register [HEX]

CH = Cylinder High Register [HEX]

DH = Device/Head Register [HEX]

DC = Device Command Register [HEX]

ER = Error register [HEX]

ST = Status register [HEX]

Powered_Up_Time is 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_Time Command/Feature_Name

— — — — — — — — —————- ——————–

25 da 08 e7 e5 a5 4c 00 00:30:44.515 READ DMA EXT

25 da 08 df e5 a5 4c 00 00:30:44.514 READ DMA EXT

25 da 80 5f e5 a5 4c 00 00:30:44.502 READ DMA EXT

25 da f0 5f e6 a5 4c 00 00:30:44.496 READ DMA EXT

25 da 10 4f e6 a5 4c 00 00:30:44.383 READ DMA EXT

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/184589.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • vue分页组件动态页码_怎样分页设置页码

    vue分页组件动态页码_怎样分页设置页码效果如下:HTML:<ulclass=”pagef16tcmt30″><li><spanv-if=”page>1″><b@click=”page–,pageClick()”>上一页</b></span><spanv-if=”page==1″>上一页</span><spanv-for=”indexinpagesAll”:key=”index”.

  • 森林岔路91%_01746

    森林岔路91%_01746原题链接森森开了一家快递公司,叫森森快递。因为公司刚刚开张,所以业务路线很简单,可以认为是一条直线上的N个城市,这些城市从左到右依次从0到(N−1)编号。由于道路限制,第i号城市(i=0,⋯,N−2)与第(i+1)号城市中间往返的运输货物重量在同一时刻不能超过C​i​​ 公斤。公司开张后很快接到了Q张订单,其中j张订单描述了某些指定的货物要从S​j​​ 号城市运输到T​j​​ 号城市。这里我们简单地假设所有货物都有无限货源,森森会不定时地挑选其中一部分货物进行运输。安全起见,这些货物不会在中

  • 友善串口助手使用教程_友善串口调试助手基本功能怎么使用-友善串口调试助手使用教程…

    友善串口助手使用教程_友善串口调试助手基本功能怎么使用-友善串口调试助手使用教程…软件功能:友善串口调试助手(win7串口调试工具)是一个很好而小巧的串口调试助手,友善串口调试助手官方版支持二进制面板和TLS、支持终端窗口和远程访问,能够与串口进行通信,访问、修改串行端口,还能够自动识别、自动搜索串口。友善串口调试助手还可以用ASCII码或十六进制接收或发送任何数据或字符,也可以让用户任意设定自动发送周期,还能够把结束数据保存成文本文件,用户也可以通过友善串口调试助手发送任意大…

  • db2有没有rownum_row_number() over order by

    db2有没有rownum_row_number() over order byrank和rownumber都是自动生成序号,后面都可以跟partitionby分组和orderby排序。不同之处在于,rownumber在orderby后面的字段,排序字段数值相等时,rownumber字段依次递增。   rank在orderby后面的字段,排序字段数值相等时,rownumber都相同,直接跳到下一个不同的序号。selectrank

  • 2021.5.1idea激活码(最新序列号破解)

    2021.5.1idea激活码(最新序列号破解),https://javaforall.cn/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

  • Android 蓝牙开发之搜索、配对、连接、通信大全

    Android 蓝牙开发之搜索、配对、连接、通信大全关注微信公众号(文强的技术小屋),学习更多技术知识,一起遨游知识海洋~蓝牙(Bluetooth®):是一种无线技术标准,可实现固定设备、移动设备和楼宇个人域网之间的短距离数据交换(使用2.4—2.485GHz的ISM波段的UHF无线电波)。蓝牙设备最多可以同时和7个其它蓝牙设备建立连接,进行通信,当然并不是每一个蓝牙都可以达到最大值。下面,我们从蓝牙的基本概念…

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号