smartctl命令详解_smartmontools

smartctl命令详解_smartmontools安装smartctlubuntu系统安装方法。root@gucloud:~#aptinstallsmartmontoolsReadingpackagelists…DoneBuildingdependencytreeReadingstateinformation…DoneSuggestedpackages:gsmartcontrolsmart-notifiermailx|mailutilsThefollowingNEWp

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

Jetbrains全系列IDE稳定放心使用

安装smartctl

ubuntu系统安装方法。

root@gucloud:~# apt install smartmontools  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  gsmartcontrol smart-notifier mailx | mailutils
The following NEW packages will be installed:
  smartmontools
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 525 kB of archives.
After this operation, 2,087 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 smartmontools amd64 7.1-1build1 [525 kB]
Fetched 525 kB in 4s (130 kB/s)        
Selecting previously unselected package smartmontools.
(Reading database ... 147536 files and directories currently installed.)
Preparing to unpack .../smartmontools_7.1-1build1_amd64.deb ...
Unpacking smartmontools (7.1-1build1) ...
Setting up smartmontools (7.1-1build1) ...
Created symlink /etc/systemd/system/smartd.service → /lib/systemd/system/smartmontools.service.
Created symlink /etc/systemd/system/multi-user.target.wants/smartmontools.service → /lib/systemd/system/smartmontools.service.
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.4) ...
root@gucloud:~# smartctl --version  //查看版本
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-65-generic] (local build)

如果是centos7以上系统可以使用 #yum -y install smartmontools

smartctl简单用法

  -a   //查看全部信息

root@gucloud:~# smartctl -a /dev/sda  //查看sda所有信息
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-65-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     Qunion P20A 128G   //设备名称
Serial Number:    XSRQ2020011574   //SN码
LU WWN Device Id: 0 000000 000000000
Firmware Version: 1.00
User Capacity:    128,035,676,160 bytes [128 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-4 (minor revision not indicated)
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s) 
Local Time is:    Thu Feb 18 06:43:20 2021 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled  //已开启smart

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

  -H   //查看硬盘健康状态 

root@gucloud:~# smartctl -H /dev/sda 
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-65-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED  //提示passed成功,Failure失败

-i  简要显示硬盘信息

root@gucloud:~# smartctl -i /dev/sda
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-65-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     Qunion P20A 128G
Serial Number:    XSRQ2020011574
LU WWN Device Id: 0 000000 000000000
Firmware Version: 1.00
User Capacity:    128,035,676,160 bytes [128 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-4 (minor revision not indicated)
SATA Version is:  SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Thu Feb 18 06:56:49 2021 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

使用hdparm测试

hdparm参数介绍

a<快取分区> 设定读取文件时,预先存入块区的分区数,若不加上<快取分区>选项,则显示目前的设定。

-A<0或1> 启动或关闭读取文件时的快取功能。

-c<I/O模式> 设定IDE32位I/O模式。

-C 检测IDE硬盘的电源管理模式。-d<0或1> 设定磁盘的DMA模式。

-f 将内存缓冲区的数据写入硬盘,并清楚缓冲区。

-g 显示硬盘的磁轨,磁头,磁区等参数。

-h 显示帮助。

-i 显示硬盘的硬件规格信息,这些信息是在开机时由硬盘本身所提供。

-I 直接读取硬盘所提供的硬件规格信息。

-k<0或1> 重设硬盘时,保留-dmu参数的设定。

-K<0或1> 重设硬盘时,保留-APSWXZ参数的设定。

-m<磁区数> 设定硬盘多重分区存取的分区数。

-n<0或1> 忽略硬盘写入时所发生的错误。

-p<PIO模式> 设定硬盘的PIO模式。

-P<磁区数> 设定硬盘内部快取的分区数。

-q 在执行后续的参数时,不在屏幕上显示任何信息。

-r<0或1> 设定硬盘的读写模式。

-S<时间> 设定硬盘进入省电模式前的等待时间。

-t 评估硬盘的读取效率。

-T 评估硬盘快取的读取效率。

-u<0或1> 在硬盘存取时,允许其他中断要求同时执行。

-v 显示硬盘的相关设定。

-W<0或1> 设定硬盘的写入快取。

-X<传输模式>  设定硬盘的传输模式。

-y 使IDE硬盘进入省电模式。

-Y 使IDE硬盘进入睡眠模式。

-Z 关闭某些Seagate硬盘的自动省电功能。

 测试单个硬盘的读写速度。

root@gucloud:~# hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   26504 MB in  2.00 seconds = 13267.32 MB/sec
 Timing buffered disk reads: 1214 MB in  3.00 seconds = 404.10 MB/sec

 

 

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

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/184729.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • vue子组件向父组件传值的三种方式_vue父页面传值到子页面

    vue子组件向父组件传值的三种方式_vue父页面传值到子页面1.用于子组件触发事件传递给父组件子组件:rowEvent里面也可以带参数事件treeData是携带的参数rowEvent(){this.$emit(‘rowEvent’,’treeData’’);},父组件:在父组件绑定自定义事件直接可以获取到rowEvents(obj){console.log(obj)},2.用ref(常用于不触发的事件)子组件定义个…

    2025年8月31日
    5
  • snmptrap配置_snmp服务端ip和端口

    snmptrap配置_snmp服务端ip和端口一、trap的用途TRAP是提供从代理进程到管理站的异步报告机制。为了使管理站能够及时而又有效地对被管理设备进行监控,同时又不过分增加网络的通信负载,必须使用陷入(TRAP)制导的轮讯过程。代理进程负责在必要时向管理站报告异常事件,得到异常事件的报告后,管理站可以查询有关的代理,以便得到更具体的信息,对事件的原因做进一步的分析二、trap的工作流程1、agent端: A

    2022年8月20日
    25
  • 原生JDBC连接数据库

    原生JDBC连接数据库JDBC概述概述JDBC(JavaDataBaseConnectivity,java数据库连接)是SUN公司开发的,一种用于执行SQL语句的JavaAPI JDBC是Java访问数据库的标准规范,可以为不同的关系型数据库提供统一访问,它由一组用Java语言编写的接口和类组成 JDBC需要连接驱动,驱动是两个设备要进行通信,满足一定通信数据格式,数据格式由设备提供商规定,设备提供…

    2022年7月15日
    13
  • 世态炎凉

    世态炎凉网络爱情之睡美人作者:漫步黑夜云端    看到那个熟悉的头像晃动起来,依依知道是那个在网上让自己牵肠挂肚的恋人上线了。一年多的时间,让依依和这个叫云凡的男人,从相遇,相知到相爱,彼此相惜沉浸爱河。   依依点开对话窗口,温馨的话语出现了“依,想你一天了,终于见到你了!”依依幸福的笑了,但笑容只持续了几秒钟就僵住了。   因为她哭了,对云凡说:“云凡,我想我们的缘分到尽头了,我不能再陪你了

    2022年4月30日
    53
  • php curl_init post/get请求

    php curl_init post/get请求publicfunctiongetCurlApi(){$url=’地址’;$headers=array(‘access_token:’.$token);$curl=curl_init();curl_setopt($curl,CURLOPT_URL,$url);//设置调用地址curl_setopt($curl,CURLOPT_HTTPHEADER,$headers);//添加头…

    2022年7月12日
    19
  • Android 多线程下载网络文件

    Android 多线程下载网络文件

    2021年8月23日
    43

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

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