查看centos服务器硬盘状态信息

windows下有HDTune可以查看磁盘的状态,防止磁盘挂掉才会自己知道,CentOS下有SMART (Self-Monitoring, Analysis and  Reporting Technology System) 同样对磁盘做状态检测

http://www.smartmontools.org/

下面以dell R720服务器举例,/dev/sda是1T的scsi接口普通硬盘,/dev/sdd 是三块盘做的raid5

# df -h                                  #查看磁盘的名字

# dmesg |grep sdd               #查看开机信息里面的磁盘info

sd 0:2:0:0: [sdd] Attached SCSI disk

# hdparm -I /dev/sda           #查看磁盘硬件信息、开启的功能等,信息特别详细

下面用smart查看磁盘的状态:

# yum install smartmontools  //安装SMART
# smartctl -H /dev/sdd   //磁盘健康状况查看
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-3.10.56-11.el6.centos.alt.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen,
http://smartmontools.sourceforge.net
SMART Health Status: OK

# smartctl -A /dev/sda  或者 smartctl --all /dev/sda  #硬盘的smart信息

# smartctl -a /dev/sdd 
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-3.10.56-11.el6.centos.alt.x86_64] (local build)
Copyright (C) 2002-12 by Bruce Allen,
http://smartmontools.sourceforge.net
Vendor: DELL
Product: PERC H310
Revision: 2.12
User Capacity: 598,879,502,336 bytes [598 GB]
Logical block size: 512 bytes
Logical Unit id: 
Serial number: 
Device type: disk
Local Time is: Wed Jan 14 15:37:39 2015 CST
Device does not support SMART
Error Counter logging not supported
Device does not support Self Test logging

这里提示Device does not support SMART,所以按下面方式查看

查看raid5中第一块磁盘的状态

# smartctl -a -d megaraid,0 /dev/sdd 

同样查看第二块、第三块磁盘的状态,根据自己的监控情况,加速nagios、zabbix报警

# smartctl -a -d megaraid,1 /dev/sdd

# smartctl -a -d megaraid,2 /dev/sdd

除此之外的smartctl用法,介绍的很详细:

# smartctl -h
Usage: smartctl [options] device
============================================ SHOW INFORMATION OPTIONS =====
  -h, --help, --usage
         Display this help and exit
  -V, --version, --copyright, --license
         Print license, copyright, and version information and exit
  -i, --info
         Show identity information for device
  -g NAME, --get=NAME
        Get device setting: all, aam, apm, lookahead, security, wcache
  -a, --all
         Show all SMART information for device
  -x, --xall
         Show all information for device
  --scan
         Scan for devices
  --scan-open
         Scan for devices and try to open each device

================================== SMARTCTL RUN-TIME BEHAVIOR OPTIONS =====

  -q TYPE, --quietmode=TYPE                                           (ATA)
         Set smartctl quiet mode to one of: errorsonly, silent, noserial
  -d TYPE, --device=TYPE       
 Specify device type to one of: ata, scsi, sat[,auto][,N][+TYPE], 
usbcypress[,X], usbjmicron[,x][,N], usbsunplus, marvell, areca,N/E, 
3ware,N, hpt,L/M/N, megaraid,N, cciss,N, auto, test

  -T TYPE, --tolerance=TYPE                                           (ATA)
        Tolerance: normal, conservative, permissive, verypermissive
  -b TYPE, --badsum=TYPE                                              (ATA)
         Set action on bad checksum to one of: warn, exit, ignore
  -r TYPE, --report=TYPE
         Report transactions (see man page)
  -n MODE, --nocheck=MODE                                             (ATA)
         No check if: never, sleep, standby, idle (see man page)

============================== DEVICE FEATURE ENABLE/DISABLE COMMANDS =====

  -s VALUE, --smart=VALUE
        Enable/disable SMART on device (on/off)
  -o VALUE, --offlineauto=VALUE                                       (ATA)
        Enable/disable automatic offline testing on device (on/off)
  -S VALUE, --saveauto=VALUE                                          (ATA)
        Enable/disable Attribute autosave on device (on/off)
  -s NAME[,VALUE], --set=NAME[,VALUE]
        Enable/disable/change device setting: aam,[N|off], apm,[N|off],
        lookahead,[on|off], security-freeze, standby,[N|off|now],
        wcache,[on|off]

======================================= READ AND DISPLAY DATA OPTIONS =====

  -H, --health
        Show device SMART health status
  -c, --capabilities                                                  (ATA)
        Show device SMART capabilities
  -A, --attributes
        Show device SMART vendor-specific Attributes and values
  -f FORMAT, --format=FORMAT                                          (ATA)
        Set output format for attributes: old, brief, hex[,id|val]
  -l TYPE, --log=TYPE
        Show device log. TYPE: error, selftest, selective, directory[,g|s],
                               xerror[,N][,error], xselftest[,N][,selftest],
                               background, sasphy[,reset], sataphy[,reset],
                               scttemp[sts,hist], scttempint,N[,p],
                               scterc[,N,M], devstat[,N], ssd,
                               gplog,N[,RANGE], smartlog,N[,RANGE]
  -v N,OPTION , --vendorattribute=N,OPTION                            (ATA)
        Set display OPTION for vendor Attribute N (see man page)
  -F TYPE, --firmwarebug=TYPE                                         (ATA)
        Use firmware bug workaround: none, samsung, samsung2,
                                    samsung3, swapid
  -P TYPE, --presets=TYPE                                             (ATA)
        Drive-specific presets: use, ignore, show, showall
  -B [+]FILE, --drivedb=[+]FILE                                       (ATA)
        Read and replace [add] drive database from FILE
        [default is +/etc/smart_drivedb.h
         and then    /usr/share/smartmontools/drivedb.h]

============================================ DEVICE SELF-TEST OPTIONS =====

  -t TEST, --test=TEST
        Run test. TEST: offline, short, long, conveyance, force, vendor,N,
                        select,M-N, pending,N, afterselect,[on|off]
  -C, --captive
        Do test in captive mode (along with -t)
  -X, --abort
        Abort any non-captive test on device

=================================================== SMARTCTL EXAMPLES =====

  smartctl --all /dev/hda                    (Prints all SMART information)
  smartctl --smart=on --offlineauto=on --saveauto=on /dev/hda
                                              (Enables SMART on first disk)
  smartctl --test=long /dev/hda          (Executes extended disk self-test)
  smartctl --attributes --log=selftest --quietmode=errorsonly /dev/hda
                                      (Prints Self-Test & Attribute errors)
  smartctl --all --device=3ware,2 /dev/sda
  smartctl --all --device=3ware,2 /dev/twe0
  smartctl --all --device=3ware,2 /dev/twa0
  smartctl --all --device=3ware,2 /dev/twl0
          (Prints all SMART info for 3rd ATA disk on 3ware RAID controller)
  smartctl --all --device=hpt,1/1/3 /dev/sda
          (Prints all SMART info for the SATA disk attached to the 3rd PMPort
           of the 1st channel on the 1st HighPoint RAID controller)
  smartctl --all --device=areca,3/1 /dev/sg2
          (Prints all SMART info for 3rd ATA disk of the 1st enclosure
           on Areca RAID controller)
时间: 2024-08-14 20:35:19

查看centos服务器硬盘状态信息的相关文章

使用 SHOW STATUS 查看mysql 服务器状态信息

在LAMP架构的网站开发过程中,有些时候我们需要了解MySQL的服务器状态信息,譬如当前MySQL启动后的运行时间,当前MySQL的客户端会话连接数,当前MySQL服务器执行的慢查询数,当前MySQL执行了多少SELECT语句.执行了多少UPDATE/DELETE/INSERT语句等统计信息,从而便于我们根据当前MySQL服务器的运行状态进行对应的调整或优化工作. 在MySQL中,我们可以使用SHOW STATUS指令语句来查看MySQL服务器的状态信息.下面,我们以DOS命令窗口的形式连接My

查看CentOS的版本信息

1)[[email protected] ~]# cat /proc/version Linux version 2.6.18-194.el5 ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Fri Apr 2 14:58:14 EDT 2010 2) [[email protected] ~]# uname -a Linux localhost.localdomain 2.6.18-194.e

如何查看CentOS 7.x版本信息

前言由于CentOS 7 和之前的6以下的版本查看系统版本及查看机器位数x86-64的方法不一样,部分命令差异也比较大,现就如在CentOS 7下查询版本信息 首先要清楚什么样标识是32位的,什么样的是64位的. PC server X86 系列 I386--I686 都是32位 x86_64 是 64位 查看位数命令 命令实在是不要太多,为了防止选择性障碍,一致选择第一种方式,后面的仅作为补充.方法1: [[email protected] ~]# uname -aLinux linuxidc

查看centos的内核版本,位数,版本号等信息

忽然间想看看自己系统是什么版本的,却忘了命令,哈哈.索性整理了一下. [[email protected] ~]# cat /etc/redhat-release                                      #查看系统的版本CentOS Linux release 7.2.1511 (Core) 系统 #uname -a                     #查看内核/操作系统/CPU信息 #head -n 1 /etc/issue      #查看操作系统版本

centos系统各个信息的查看(不断添加更新)

采用cat /proc/version 可以查看到具体的操作系统的信息,包括内核的版本,在redhat中的版本. uname -a和上面的输出差不多,还有输出hostname cat  /etc/issue可以看到当前centos的版本为centos 6.4 e可以看到当前的内核的版本号,和当前的系统的时间和系统的位数,以及cpu的个数 ,和cpu的使用情况 hostname查看系统的主机名 free -k查看内存的使用情况 df -h查看磁盘的使用情况,也可以修改参数来查看系统的inode使用

查看CentOS的CPU内存信息及操作系统的版本信息

经常要查看Linux服务器的CPU,内存信息以及操作系统版本等信息,总结一下常用的命令,以便以后查阅.1.查看CPU型号(8个逻辑CPU)[[[email protected] ~]# cat /proc/cpuinfo |grep "name" |cut -f2 -d: |uniq -c8 Intel(R) Xeon(R) CPU           E5506  @ 2.13GHz2.查看物理CPU个数(两个4核CPU)[[email protected] ~]# cat /pro

查看CentOS服务器的cpu、内存、操作系统版本信息

经常要查看Linux服务器的CPU.内存.操作系统版本等信息,总结一下常用的命令 1.查看CPU型号(32个逻辑CPU) [[email protected] ~]# cat /proc/cpuinfo |grep "name" |cut -f2 -d: |uniq -c 32  Intel(R) Xeon(R) CPU E5-4620 v2 @ 2.60GHz 2.查看物理CPU个数(两个16核CPU) [[email protected] ~]# cat /proc/cpuinfo

netstat查看端口的不同的状态信息

netstat命令是一个dos命令,后接不同的参数可以查看端口的不同的状态信息. 命令格式: netstat [-a] [-b] [-e] [-f] [-n] [-o] [-p proto] [-r] [-s] [-x] [-t] [interval] 参数解析: 输入netstat -help: -a 显示所有连接和侦听端口. -b 显示在创建每个连接或侦听端口时涉及的可执行程序.在某些情况下,已知可执行程序承载 多个独立的组件,这些情况下,显示创建连接或侦听端口时涉及的组件序列.在此情况下,

查看CentOS版本信息

在CentOS中可以通过下面三个命令查看系统相关信息. uname -a cat /proc/version cat /etc/redhat-release 参考查看CentOS版本:https://docsxyz.com/wiki/centos/check-release-version 原文地址:https://www.cnblogs.com/docsxyz/p/12178246.html