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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • MySQL 中 concat 函数

    MySQL 中 concat 函数MySQL中concat函数concat函数MySQL中concat函数MySQL中concat_ws函数MySQL中group_concat函数语法:concat(str1,str2,…)注意:返回结果为连接参数产生的字符串,如果有任何一个参数为NULL,则返回值为NULL。selectconcat(“a”,”b”,”c”);输出:abc注:Mysql的concat函数在连接字符串的时候,只要其中一个为NULL则返回值为NULL.sel

    2022年5月6日
    40
  • vim复制粘贴_vim如何复制粘贴

    vim复制粘贴_vim如何复制粘贴一、打开文件        执行vimtest命令打开test文件        在命令模式下输入setnu,展示文本行号二、按字符复制与粘贴        在命令行模式下输入字符v(小写),便可以进入按字符选择模式,通过h、i、j、k键移动光标选择要进行复制的字符串。        完成选择后按下y键进行复制,将鼠标移动到最后一行,按下p执行粘贴操作就完成了对选择…

    2022年4月19日
    59
  • 风控模型开发全流程

    风控模型开发全流程本篇我们对开发金融风控模型做一个总结,先给出流程图:建立模型,当然需要数据,金融风控的数据一般来源于内部与外部,内部是在公司业务系统内已有的,外部主要靠采购三方数据扩展。三方数据的采集标…

    2022年5月7日
    55
  • ORA-01940: cannot drop a user that is currently connected

    ORA-01940: cannot drop a user that is currently connected

    2021年9月13日
    51
  • 河北对口计算机专业一分一档6,600分以上830人!河北一市中考一分一档表出炉!…

    河北对口计算机专业一分一档6,600分以上830人!河北一市中考一分一档表出炉!…出分啦!承德市2021年中考成绩公布6月30日,承德市教育考试招生信息平台公布2021年承德市中考成绩一分一档表!今年承德中考文化和体育是630分,理化实验20分,总计是650分。据一分一档表显示今年承德中考600分以上是830人2021年承德市中考成绩一分一档表除承德外河北其他地市什么时候能查分呢?有粉丝在后台问,衡水什么时候可以查分,这不,衡水市中考成绩发布时间也来啦~衡水市一、中考成绩发布时…

    2022年7月13日
    25
  • python-修改目录下带有特定字符的所有文件内容,文件名字,目录名字

    python-修改目录下带有特定字符的所有文件内容,文件名字,目录名字

    2021年5月18日
    135

发表回复

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

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