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)
上一篇 2022年10月7日 下午11:46
下一篇 2022年10月8日 上午6:00


相关推荐

  • Java springboot Object转换List String转List 数组转List

    Java springboot Object转换List String转List 数组转List以下是 Object 转 List 的需求场景前端通过 http 请求 body 以 json 形式 内容含有字符串 数组 后端使用 Map string Object 的方式接收 些时如何将部分的 Object 转换成 List 此时 如何将数组参数 Object 转换成 List 直接强转 list 如果确定参数传进来是数组的话 可以使用强转 if map get list instanceofAr Listlist ArrayList map get list 改变 string Object

    2026年3月16日
    4
  • 淘宝 PC 桌面版更新:支持 OpenClaw 搜索比价加购

    淘宝 PC 桌面版更新:支持 OpenClaw 搜索比价加购

    2026年3月16日
    3
  • 安装petalinux_怎么在Linux上搭建环境

    安装petalinux_怎么在Linux上搭建环境安装petalinux工具包和配置工作环境;·xilinx官网下载petalinux-v2017.3-final-installer.run安装包,注意:版本必须和你vivado一致; ·下载ubuntu16.4,按照ug1144安装工具包; ·建立petalinux安装目录,注意安装目录的权限必须为755且安装不能用root用户安装;$mkdir-p/opt/pkg/petal…

    2025年10月30日
    4
  • String转换jsonobject格式错误

    String转换jsonobject格式错误String转换jsonobject格式错误开发工具与关键技术:java作者:彭浩达撰写时间:2019年7月24日publicvoidUpdataecdrud(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,I…

    2022年8月23日
    11
  • Liquibase的简单使用[通俗易懂]

    Liquibase的简单使用[通俗易懂]`LiquiBase`是一个用于数据库重构和迁移的开源工具,通过日志文件的形式记录数据库的变更,然后执行日志文件中的修改,将数据库更新或回滚到一致的状态。它的目标是提供一种数据库类型无关的解决方案,通

    2022年8月5日
    9
  • mysql截取字符串最后两位_java 字符串截取 – 最后带上mysql字符串截取比较[通俗易懂]

    mysql截取字符串最后两位_java 字符串截取 – 最后带上mysql字符串截取比较[通俗易懂]Java中的substring()方法有两个方法的重载,一个带一个参数的,一个带两个参数的。第一种写法:substring(n);//从索引是n的字符开始截取,条件(n>=0,n第二种写法:substring(n,m);//从n开始,截取m-n个字符,条件(n通俗点:str.substring(intbegin,intend);从字符串开始位置(开始位置即为下标,下标是从0开始)截…

    2022年10月2日
    3

发表回复

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

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