安装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/secTiming buffered disk reads: 1214 MB in  3.00 seconds = 404.10 MB/sec

smartctl命令介绍及使用相关推荐

  1. linux smartctl 命令,使用smartctl命令检查磁盘

    使用smartctl命令检查磁盘 在TS过程中会碰到很多磁盘异常出现影响系统数据或者生产数据的情况,但是有时候无法判断磁盘出现问题是由于磁盘物理损坏还是磁盘SATA口接触不良导致,这个时候smartc ...

  2. smartctl命令

    smartctl命令 1.什么是S.M.A.R.T. SMART是一种磁盘自我分析检测技术,早在90年代末就基本得到了普及,每一块硬盘(包括IDE.SCSI)在运行的时候,都会将自身的若干参数记录下来 ...

  3. 第五课:系统目录及ls·文件类型及alias命令介绍

    1.上过一次我们学习了单用户和救援模式及服务器秘钥登录等操作,而我们最终的目的还是要操作和使用linux系统,所以我们今天先初步学习linux的基本命令如下: 一·目录介绍        ls命令介绍 ...

  4. puppet子命令介绍

    puppet子命令介绍 # puppet -V                //查看puppet的版本 # puppet help              //查看puppet支持的一些子命令 # ...

  5. linux系统防火墙相关问题及常用命令介绍

    今天介绍关于linux系统防火墙:centos5.centos6.redhat6系统自带的是iptables防火墙,centos7.redhat7自带firewall防火墙,ubuntu系统使用的是u ...

  6. linux vim编辑文本是 m,linux基础命令介绍四:文本编辑 vim

    本文介绍vim(版本7.4)的一般用法 vim是功能强大的文本编辑器,是vi的增强版. vim [options] [file ..] 使用vim编辑一个文件的最常用命令就是: vim file 其中 ...

  7. 常见网络命令介绍及使用

    常见网络命令介绍及使用 ping 介绍 参数说明 使用例子 ipconfig 介绍 参数说明 使用例子 tracert 介绍 参数说明 使用例子 netstat 介绍 参数说明 使用例子 route ...

  8. linux route 刷新_linux基础命令介绍十五:推陈出新

    本文介绍ip.ss.journalctl和firewall-cmd,它们旨在代替linux中原有的一些命令或服务. 1.ip ip [OPTIONS] OBJECT COMMAND ip是iprout ...

  9. 查看MySQL数据库表的命令介绍

    如果需要查看MySQL数据库中都有哪些MySQL数据库表,应该如何实现呢?下面就为您介绍查看MySQL数据库表的命令,供您参考. 进入MySQL Command line client下 查看当前使用 ...

最新文章

  1. 用Spring Security实现后台登录及权限认证功能
  2. 群晖使用Linux命令,群晖常用指令
  3. iOS快速开发框架Bee-Framework应用和解析(二) - Bee framework架构概览
  4. Akka入门(二)Akka的Actor模型如何满足现代分布式系统需求
  5. 认知无线电matlab代码详解,认知无线电频谱感知之功率检测matlab代码.docx
  6. study of javaserver faces lifecycle
  7. 【英语学习】【Level 07】U07 Stories of my Life L2 I actually did it!
  8. 视频会议系统的种类、选择方式、未来发展趋势详解
  9. C程序设计语言现代方法06:循环
  10. Linux升级ssh、ssl
  11. 关于mac突然无法链接Wi-Fi的问题
  12. 读书笔记 - 多Agent强化学习下的自适应交通信号控制研究综述2017
  13. 识别孩子潜能的6大细节
  14. 信息隐藏——第四章 图像信息隐藏数
  15. 传奇单机架设教程,五分钟完成单机架设
  16. 免费论文下载:林巧稚的论文期刊
  17. ROS1/ROS2版本代号
  18. SPH物体漂浮模拟 之 波海泛舟
  19. 【JokerのZYNQ7020】UART。
  20. 设计一个动物声音模拟器,希望模拟器可以模拟许多动物的叫声

热门文章

  1. 授权MySQL可以远程访问
  2. 实现Mybatis-Plus联表查询
  3. COJ_2040_成群的触手(双向dp)
  4. windows磁盘图标上多了一把锁的图标
  5. Vue3为什么要使用组合式API——Vue3的组合式API和Vue2的选项式API的优缺点
  6. java 独木桥_趣味算法——青蛙过河(JAVA)
  7. 生什么病,吃什么水果~~~太实用了!
  8. python的IDLE下载、安装、使用教程和技巧
  9. 贝叶斯生成对抗网络(GAN)
  10. 壶口瀑布奇观“水底冒烟”