View the CentOS server hard disk status information

Source: Internet
Author: User

Windows has hdtune to see the status of the disk, to prevent the disk from hanging up to know, CentOS under the Smart (self-monitoring, analysis and Reporting technology System also do state detection of disks

http://www.smartmontools.org/

The following is a Dell R720 server example,/DEV/SDA is a 1T SCSI interface ordinary hard disk,/DEV/SDD is three disk made of RAID5

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

# DMESG |grep SDD #查看开机信息里面的磁盘info

SD 0:2:0:0: [SDD] attached SCSI disk

# hdparm-i/DEV/SDA #查看磁盘硬件信息, open functions, etc., the information is particularly detailed

Use smart to see the status of the disk below:

# yum Install smartmontools//install smart# smartctl-h/DEV/SDD//Disk health view 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.netSMART Health Status:ok

# smartctl-a/DEV/SDA or Smartctl--all/dev/sda #硬盘的smart信息

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/58/9F/wKioL1S2IpSiTFUKAAiHu-JuDik403.jpg "title=" Qq20150114155807.jpg "alt=" Wkiol1s2ipsitfukaaihu-judik403.jpg "/>


# 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.netvendor:dellproduct:perc h310revision:  2.12User capacity:598,879,502,336 bytes [598 gb]logical block size:512 byteslogical Unit id:serial number:device type: Disklocal time is:wed Jan 15:37:39 Cstdevice does not support Smarterror Counter logging not supporteddevice Doe s not support Self Test logging

This indicates that device does isn't support SMART, so view it as follows

View the status of the first disk in RAID5

# smartctl-a-D MEGARAID,0/DEV/SDD
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/58/A3/wKiom1S2I2bDXLeDAAZgo7U8njc605.jpg "title=" Qq20150114160540.jpg "alt=" Wkiom1s2i2bdxledaazgo7u8njc605.jpg "/>

Also view the status of the second and third disks, and speed up Nagios and Zabbix alarms according to your own monitoring situation

# smartctl-a-D MEGARAID,1/DEV/SDD

# smartctl-a-D MEGARAID,2/DEV/SDD

In addition to the SMARTCTL usage, the introduction is very detailed:

# smartctl -husage: 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)


This article is from the "back Line Swallow" blog, please make sure to keep this source http://bbotte.blog.51cto.com/6205307/1603985

View the CentOS server hard disk status information

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.