root@gucloud:~# apt install smartmontools Reading package lists... 525 kB in 4s (130 kB/s) Selecting previously unselected package smartmontools. /smartmontools_7.1-1build1_amd64.deb ... Unpacking smartmontools (7.1-1build1) ... Setting up smartmontools (7.1-1build1) ... /smartmontools.service.
安装: yum install smartmontools help: #smartctl –help smartctl version 5.38 [i686-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen Home page is http://smartmontools.sourceforge.net/ Usage: smartctl [options]
服务器坏道实录 http://www.linuxidc.com/Linux/2012-07/65723.htm 安装 Smartctl 对于 Ubuntu $ sudo apt-get install smartmontools 对于 CentOS & RHEL # yum install smartmontools 启动Smartctl服务 对于 Ubuntu $ sudo /etc/init.d/smartmontools r3841 [x86_64-linux-3.13.0-32-generic](local build) Copyright(C)2002-13,BruceAllen,ChristianFranke, www.smartmontools.org r3841 [x86_64-linux-3.13.0-32-generic](local build) Copyright(C)2002-13,BruceAllen,ChristianFranke, www.smartmontools.org r3841 [x86_64-linux-3.13.0-32-generic](local build) Copyright(C)2002-13,BruceAllen,ChristianFranke, www.smartmontools.org
exit status 1 error: install: %pre scriptlet failed (2), skipping cvuqdisk-1.0.9-1 google搜索发现是因为系统缺少smartmontools 使用yum 安装 [root@oradb23 ~]# yum install smartmontools ... Installed: smartmontools.x86_64 1:5.43-1.el6 100%] 1:cvuqdisk ########################################### [100%] 最后只需要在其他节点都yum安装smartmontools
Mar 28 10:09:36 localhost smartd[9865]: Configuration file /etc/smartmontools/smartd.conf was parsed, Mar 28 10:24:36 localhost.localdomain smartd[8613]: Configuration file /etc/smartmontools/smartd.conf Mar 28 15:31:47 localhost smartd[42226]: Opened configuration file /etc/smartmontools/smartd.conf Mar 28 15:31:47 localhost smartd[42226]: Configuration file /etc/smartmontools/smartd.conf was parsed, found Mar 28 15:31:47 localhost.localdomain smartd[42226]: Configuration file /etc/smartmontools/smartd.conf
命令:sudo apt-get updatesudo apt-get install lshw dmidecode smartmontools htop inxi查看已安装的硬件检测工具:dpkg -l 示例:安装 lshw 和 dmidecode:sudo apt-get updatesudo apt-get install lshw dmidecode示例:安装 smartmontools:sudo apt-get update sudo apt-get install smartmontools示例:安装 htop:sudo apt-get updatesudo apt-get install install smartmontools2.4 工具使用不当问题:硬件兼容性测试工具使用不当,导致测试结果不准确。 示例:安装 lshw 依赖:sudo apt-get updatesudo apt-get install libxml2-utils 示例:安装 smartmontools 依赖:sudo apt-get
命令:sudo apt-get updatesudo apt-get install lshw dmidecode smartmontools htop查看已安装的硬件检测工具:dpkg -l | grep 示例:安装 lshw 和 dmidecode:sudo apt-get updatesudo apt-get install lshw dmidecode示例:安装 smartmontools:sudo apt-get update sudo apt-get install smartmontools示例:安装 htop:sudo apt-get updatesudo apt-get install install smartmontools2.4 工具使用不当问题:硬件检测工具使用不当,导致检测结果不准确。 示例:安装 lshw 依赖:sudo apt-get updatesudo apt-get install libxml2-utils示例:安装 smartmontools 依赖:sudo apt-get
安装 Smartctl 对于 Ubuntu 复制代码代码如下: $ sudo apt-get install smartmontools 对于 CentOS & RHEL 复制代码代码如下: # yum install smartmontools 启动Smartctl服务 对于 Ubuntu 复制代码代码如下: $ sudo /etc/init.d/smartmontools start 对于 CentOS 64-linux-3.13.0-32-generic] (local build) Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org 64-linux-3.13.0-32-generic] (local build) Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org 64-linux-3.13.0-32-generic] (local build) Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
更新和安装smartmontools (以debian和ubuntu) apt-get update && apt-get upgrade Bash apt install smartmontools -y Bash 查一下盘 fdisk -l Bash 运行smartmontools的命令查询 smartctl -A /dev/sda Bash Power_On_Hours,这个单位是小时,就是硬盘已经使用了的时间
一、smartctl工具简介 Smartmontools是一种硬盘检测工具,通过控制和管理硬盘的SMART(Self Monitoring Analysis and Reporting Technology Windows没有内置SMART相关工具,需要安装第三方工具软件,vmware虚拟机的硬盘不支持SMART,Linux上很早就有了SMART支持了,可以yum命令安装该工具即可,smartctl是Smartmontools 二、使用示例 1、命令安装 [root@s186 /]# yum install -y smartmontools 2、查看磁盘是否支持smart [root@s186 /]# smartctl linux-3.10.0-1062.el7.x86_64] (local build) Copyright © 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org linux-3.10.0-1062.el7.x86_64] (local build) Copyright © 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org
ext4 文件系统: sudo e2fsck -l badsectors.txt /dev/sda10 对于其他文件系统: sudo fsck -l badsectors.txt /dev/sda10 Smartmontools 用Smartmontools检查磁盘健康状况(推荐) 这种方法更适合现代磁盘(包括 ATA/SATA 和 SCSI/SAS 硬盘以及固态硬盘),因为这些磁盘都内置了 S.M.A.R.T(自监测、分析和报告技术 第一步:在 Linux 上安装 smartmontools 可以通过运行以下命令来安装 sudo apt install smartmontools #For Debian-based sudo dnf install smartmontools #For RHEL-based 第二步:用 smartctl 进行健康检查 安装完成后,就可以使用 smartctl 了,它用于控制磁盘内置的 S.M.A.R.T 总结 在本文中,我们介绍了如何通过 badblocks 和 smartmontools 在 Linux 磁盘上检测和处理坏扇区。监控存储设备的健康状况非常重要,而这些工具让这一过程变得简单明了。
3.1 使用 smartmontools安装 smartmontools:sudo apt-get install smartmontools使用 smartctl 检查硬盘健康状态:sudo smartctl
磁盘大小,硬盘的SMART健康状态,硬盘通电次数,硬盘通电时间,硬盘温度等硬盘smart健康检测使用说明如果我们想监测硬盘SMART特性(包括硬盘健康、通电次数、通电时间、硬盘温度等),需要在被监控主机安装smartmontools 工具1、在agent/config/application.properties配置开启smart#硬盘smart检测是否开启,yes开启,no关闭,开启时需要安装smartmontools工具smartOn
安装smartmontools 需要借助smartmontools工具来进行查看硬盘信息,安装方法如下: #Debian or Ubuntu apt -y install smartmontools # CentOS yum -y install smartmontools 查看硬盘信息 输入fdisk -l可看到有2块磁盘,分为为/dev/sdb和/dev/sda,如下图: 输入smartctl -
特殊符号用单引号,如'C:' diskBlock: /dev,/snap/**此外,WGCLOUD也可以监控硬盘的SMART健康状态,不过需要在被监控主机安装smartmontools工具我们安装好了 smartmontools后,就可以监测硬盘SMART特性(包括硬盘健康、通电次数、通电时间、硬盘温度等)在agent/config/application.properties配置开启smart #
本文介绍如何使用smartctl(Smartmontools)对Linux进行此类测试。 安装Smartmontools Smartmontools可以使用yum直接安装: # yum install -y smartmontools 要确保硬盘支持SMART并启用,请使用以下命令(本例中为硬盘 linux-3.10.0-514.el7.x86_64] (local build) Copyright (C) 2002-15, Bruce Allen, Christian Franke, www.smartmontools.org r3458 [x86_64-linux-2.6.32-358.el6.x86_64] (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net 64-linux-3.13.0-32-generic] (local build) Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
安装 smartmontools:sudo apt-get install smartmontools # 对于Debian/Ubuntu系统sudo yum install smartmontools
2010-10-16 r3189 [i386-redhat-linux-gnu] (local build) Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net 2010-10-16 r3189 [i386-redhat-linux-gnu] (local build) Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net 2010-10-16 r3189 [i386-redhat-linux-gnu] (local build) Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net 进行长格式的自检 /etc/init.d/smartd restart 说明:配置好 smartd.conf后需执行以下命令即可生效 ---- 其他和smartd.conf相关的配置可参见: http://smartmontools.sourceforge.net
开机进入救援系统,查询命令 dbian/ubuntu使用: apt install smartmontools 第一块硬盘 smartctl --all /dev/nvme0n1 smartctl -A 使用fdisk -l命令可以查看硬盘编号替换就可查询 第二块硬盘 smartctl --all /dev/nvme1n1 Centos使用: yum install smartmontools 第一块硬盘
安装 smartmontools:sudo apt-get install smartmontools检查硬盘健康状况:sudo smartctl -t long /dev/sda sudo smartctl