位置: 编程技术 - 正文

在Linux中使用Smartctl监控磁盘性能的方法(在linux中使用apache发布web服务时默认web站点)

发布时间:2024-02-27

推荐整理分享在Linux中使用Smartctl监控磁盘性能的方法(在linux中使用apache发布web服务时默认web站点),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:在linux中使用什么命令可以动态查看文件内容,在linux中使用什么命令可以给命令起别名,在linux中使用apache发布web服务时默认web站点,在linux中使用什么命令可以给命令起别名,在linux中使用什么命令可以给命令起别名,在linux中使用什么命令可以动态查看文件内容,在linux中使用apache发布web服务时默认web站点,在linux中使用apache发布web服务时默认web站点,内容如对您有帮助,希望把文章链接给更多的朋友!

Smartctl(S.M.A.R.T 自监控,分析和报告技术)是类Unix系统下实施SMART任务命令行套件或工具,它用于打印SMART自检和错误日志,启用并禁用SMRAT自动检测,以及初始化设备自检。

Smartctl对于Linux物理服务器十分有用,在这些服务器上,可以对智能磁盘进行错误检查,并将与硬件RAID相关的磁盘信息摘录下来。

在本帖中,我们将讨论smartctl命令的一些实用样例。如果你的Linux上海没有安装smartctl,请按以下步骤来安装。安装 Smartctl

对于 Ubuntu

复制代码代码如下:$ sudo apt-get install smartmontools

对于 CentOS & RHEL

复制代码代码如下:# yum install smartmontools

启动Smartctl服务

对于 Ubuntu

复制代码代码如下:$ sudo /etc/init.d/smartmontools start

对于 CentOS & RHEL

复制代码代码如下: # service smartd start ; chkconfig smartd on

样例样例:1 检查磁盘的 Smart 功能是否启用

复制代码代码如下: root@linuxtechi:~# smartctl -i /dev/sdb smartctl 6.2 -- r [x_-linux-3..0--generic] (local build) Copyright (C) -, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Model Family: Seagate Momentus .6 Device Model: STAS Serial Number: 5VD2VT LU WWN Device Id: 5 c aec4 Firmware Version: BSM1 User Capacity: ,,, bytes [ GB] Sector Size: bytes logical/physical Rotation Rate: rpm Device is: In smartctl database [for details use: -P show] ATA Version is: ATA8-ACS T/-D revision 4 SATA Version is: SATA 2.6, 1.5 Gb/s Local Time is: Sun Nov :: IST SMART support is: Available - device has SMART capability. SMART support is: Enabled

这里‘/dev/sdb’是你的硬盘。上面输出中的最后两行显示了SMART功能已启用。样例:2 启用磁盘的 Smart 功能

复制代码代码如下:root@linuxtechi:~# smartctl -s on /dev/sdb smartctl 6.2 -- r [x_-linux-3..0--generic] (local build) Copyright (C) -, Bruce Allen, Christian Franke, www.smartmontools.org === START OF ENABLE/DISABLE COMMANDS SECTION === SMART Enabled.

样例:3 禁用磁盘的 Smart 功能

复制代码代码如下: root@linuxtechi:~# smartctl -s off /dev/sdb smartctl 6.2 -- r [x_-linux-3..0--generic] (local build) Copyright (C) -, Bruce Allen, Christian Franke, www.smartmontools.org === START OF ENABLE/DISABLE COMMANDS SECTION === SMART Disabled. Use option -s with argument 'on' to enable it.

在Linux中使用Smartctl监控磁盘性能的方法(在linux中使用apache发布web服务时默认web站点)

样例:4 显示磁盘的详细 Smart 信息

复制代码代码如下:root@linuxtechi:~# smartctl -a /dev/sdb // For IDE drive root@linuxtechi:~# smartctl -a -d ata /dev/sdb // For SATA drive

样例:5 显示磁盘总体健康状况

复制代码代码如下:root@linuxtechi:~# smartctl -H /dev/sdb smartctl 6.2 -- r [x_-linux-3..0--generic] (local build) Copyright (C) -, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED Warning: This result is based on an Attribute check. Please note the following marginal Attributes: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE Airflow_Temperature_Cel 0x Old_age Always In_the_past (Min/Max /)

样例:6 使用long和short选项测试硬盘

Long测试

复制代码代码如下:root@linuxtechi:~# smartctl --test=long /dev/sdb smartctl 6.2 -- r [x_-linux-3..0--generic] (local build) Copyright (C) -, Bruce Allen, Christian Franke, www.smartmontools.org === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION === Sending command: "Execute SMART Extended self-test routine immediately in off-line mode". Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful. Testing has begun. Please wait minutes for test to complete. Test will complete after Sun Nov :: Use smartctl -X to abort test.

或者,我们可以重定向测试输出到日志文件,就像下面这样

复制代码代码如下:root@linuxtechi:~# smartctl --test=long /dev/sdb > /var/log/long.text

Short测试

复制代码代码如下:root@linuxtechi:~# smartctl --test=short /dev/sdb smartctl 6.2 -- r [x_-linux-3..0--generic] (local build) Copyright (C) -, Bruce Allen, Christian Franke, www.smartmontools.org === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION === Sending command: "Execute SMART Short self-test routine immediately in off-line mode". Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful. Testing has begun. Please wait 1 minutes for test to complete. Test will complete after Sun Nov :: Use smartctl -X to abort test.

复制代码代码如下:root@linuxtechi:~# smartctl --test=short /dev/sdb > /var/log/short.text

注意:short测试将花费最多2分钟,而在long测试中没有时间限制,因为它会读取并验证磁盘的每个段。样例:7 查看驱动器的自检结果

复制代码代码如下:root@linuxtechi:~# smartctl -l selftest /dev/sdb smartctl 6.2 -- r [x_-linux-3..0--generic] (local build) Copyright (C) -, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Short offline Completed: read failure % # 2 Extended offline Completed: read failure %

样例:8 计算测试时间估值

复制代码代码如下:root@linuxtechi:~# smartctl -c /dev/sdb smartctl 6.2 -- r [x_-linux-3..0--generic] (local build) Copyright (C) -, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === General SMART Values: Offline data collection status: (0x) Offline data collection activity was never started. Auto Offline Data Collection: Disabled. Self-test execution status: ( ) The previous self-test completed having the read element of the test failed. Total time to complete Offline data collection: ( 0) seconds. Offline data collection capabilities: (0x) SMART execute Offline immediate. Auto Offline data collection on/off support. Suspend Offline collection upon new command. No Offline surface scan supported. Self-test supported. Conveyance Self-test supported. Selective Self-test supported. SMART capabilities: (0x) Saves SMART data before entering power-saving mode. Supports SMART auto save timer. Error logging capability: (0x) Error logging supported. General Purpose Logging supported. Short self-test routine recommended polling time: ( 1) minutes. Extended self-test routine recommended polling time: ( ) minutes. Conveyance self-test routine recommended polling time: ( 2) minutes. SCT capabilities: (0xb) SCT Status supported. SCT Error Recovery Control supported. SCT Feature Control supported. SCT Data Table supported.

样例:9 显示磁盘错误日志

复制代码代码如下:root@linuxtechi:~# smartctl -l error /dev/sdb Sample Output smartctl 6.2 -- r [x_-linux-3..0--generic] (local build) Copyright (C) -, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === SMART Error Log Version: 1 ATA Error Count: 5 CR = Command Register [HEX] FR = Features Register [HEX] SC = Sector Count Register [HEX] SN = Sector Number Register [HEX] CL = Cylinder Low Register [HEX] CH = Cylinder High Register [HEX] DH = Device/Head Register [HEX] DC = Device Command Register [HEX] ER = Error register [HEX] ST = Status register [HEX] Powered_Up_Time is measured from power on, and printed as DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes, SS=sec, and sss=millisec. It "wraps" after . days. Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- da e7 e5 a5 4c ::. READ DMA EXT da df e5 a5 4c ::. READ DMA EXT da 5f e5 a5 4c ::. READ DMA EXT da f0 5f e6 a5 4c ::. READ DMA EXT da 4f e6 a5 4c ::. READ DMA EXT

在Linux系统上使用转发服务器处理邮件通信的教程 当你启动并运行应用服务器后,你就需要一台好的邮件服务器来为你传递邮件。我为我所有的服务器开通了postfix邮件服务,下面就是我常用的配置。Cent

在Linux系统上安装数据库监控程序Bugzilla的方法 这里,我们将展示如何在一台Ubuntu.或CentOS6.5/7上安装Bugzilla。Bugzilla是一款基于web,用来记录跟踪缺陷数据库的bug跟踪软件,它同时是一款免费及开源

详细解读Linux系统中ntpq命令的使用 命令ntpq-q输出下面这样的一个表:复制代码代码如下:remoterefidsttwhenpollreachdelayoffsetjitter==============================================================================LOCAL(0)

标签: 在linux中使用apache发布web服务时默认web站点

本文链接地址:https://www.jiuchutong.com/biancheng/367546.html 转载请保留说明!

上一篇:在Linux系统上安装VPN服务器的教程(linux中安装软件可使用哪些方式)

下一篇:在Linux系统上使用转发服务器处理邮件通信的教程(linux 使用)

  • 外币借款本金的汇兑差额
  • 小规模纳税人个税是月报还是季报
  • 业务招待费报销要求
  • 珠宝首饰可以开发票吗
  • 金融债券的利息收入
  • 单利率和复利率excel计算公式
  • 普通发票需要进项税额转出吗
  • 企业多交所得税不想退税在电子税务局如何处理
  • 季报现金流量表是必报表吗
  • 外商投资企业的组织形式,组织机构
  • 交易性金融资产借贷方向
  • 会计核算制度包括哪些准则
  • 折扣销售的增值税处理方式
  • 出口货物退运管理办法
  • 研发折旧会计分录
  • 如何解决私账流水过大的问题?
  • 交以前年度所得税怎么算
  • 公司之间借钱不还违法吗
  • 债券分期还本利息怎么算
  • 开票系统维护费计入什么科目
  • 购买可供出售金融资产的交易费用
  • 存货和应付账款
  • 预收账款转收入附单据吗
  • 长期待摊费用当月增加当月摊销吗
  • 股票买卖属于投资活动吗
  • 发票验证系统费用多少钱?
  • 返税怎么操作流程
  • 去税务局交的社保能退么
  • 白蚁防治费计入什么科目
  • 金税盘全额抵扣分录怎么做
  • 城建税及教育费附加计提表
  • 文化事业建设费减免政策
  • 工程项目产生的沙石怎么处理
  • 退票费可以开公司发票吗
  • 债券折价摊销属于借款费用吗
  • win11玩游戏怎样
  • 报税残疾人保障金怎么算
  • 虚拟机怎么安装gcc
  • 默认网关不可用频繁掉线
  • 电脑如何设置屏幕常亮
  • 发票开出后对方不付款
  • dxva2.dll是什么意思
  • php中实现文件上传的函数是什么
  • 收到过期银行汇票怎么办
  • 委托银行收款的会计分录怎么写
  • win7界面旋转
  • vue 查询
  • 高新企业技术服务成本核算
  • 蒙特城堡干红葡萄酒价格
  • php pop
  • php中的pdo
  • 简易办法征收增值税政策的通知
  • 手把手教你在瑞典停车
  • php弹出登录框
  • 织梦图片要放哪里
  • 增值税税目明细
  • 计提和支付可以录在一张凭证吗
  • 销售价格确定的方法有
  • 无形资产减值准备是什么科目
  • 公司注册地址变更有什么影响
  • 税控盘的进项税在哪里申报
  • 资产处置收益项目有哪些
  • 广告费计入什么会计分录
  • T-SQL中使用正则表达式函数
  • xbox无法连接无线网络
  • windows server 2016最大内存
  • win8管理员权限怎么打开
  • 如何关闭office开机自启动
  • 不能运行应用程序的是
  • 虚拟光驱uiso
  • iptables防火墙规则
  • jQuery中Nicescroll滚动条插件的用法
  • node语句
  • 前端头像裁剪
  • JavaScript电子时钟倒计时
  • 浙江个体户开票软件
  • 增值税发票不够用怎么增票
  • 中国采购网地胶
  • 计提缴纳城建税分录
  • 纪检组长如何监督党员
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号