Skip to main content

SMART tests with smartctl

SMART tests with smartctl

 

 rahul-Inspiron-3542 ~ # smartctl --info /dev/sda | grep 'SMART support is:'
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

or 

rahul-Inspiron-3542 ~ # smartctl -i /dev/sda | grep 'SMART support is:'
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

 

 

rahul-Inspiron-3542 ~ # smartctl -H /dev/sda
smartctl 6.2 2013-04-20 r3812 [x86_64-linux-3.11.0-12-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

To enable'

  smartctl -s on -d ata /dev/sda

 

 Run overall-health self-assessment test, enter:

 smartctl -d ata -H /dev/sda

 

 The following will provide even more information about failing hard disk: # smartctl --attributes --log=selftest /dev/sda

 

 You can read more data from hard disk by typing the following command: # smartctl -d ata -a /dev/sda

 

Task: Extended self-test of drive

You need to begin an extended self-test of drive /dev/hdc. You can issue this command on a running system. The results can be seen in the self-test log visible with the '-l selftest' option after it has completed:
# smartctl -d ata -t long /dev/sdb




 

 

 

 

A note about RAID controller

To look at ATA disks behind 3ware SCSI RAID controllers, the syntax is:
# smartctl -a -d 3ware,2 /dev/sda
# smartctl -a -d 3ware,0 /dev/twe0




For adaptec check the o/p of lsscsci

 

 

SATA Health Check Disk Syntax

# smartctl -d sat --all /dev/sgX
# smartctl -d sat --all /dev/sg1

Run test:
# smartctl -d sat --all /dev/sg1 -H
For SAS disk use the following syntax:
# smartctl -d scsi --all /dev/sgX
# smartctl -d scsi --all /dev/sg1
# smartctl -d scsi --all /dev/sg1 -H

Sample outputs:
smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
Device: SEAGATE  ST3146855SS      Version: 0002
Serial number: xxxxxxxxxxxxxxx
Device type: disk
Transport protocol: SAS
Local Time is: Wed Jul  7 04:34:30 2010 CDT
Device supports SMART and is Enabled
Temperature Warning Enabled
SMART Health Status: OK
Current Drive Temperature:     24 C
Drive Trip Temperature:        68 C
Elements in grown defect list: 0
Vendor (Seagate) cache information
  Blocks sent to initiator = 1857385803
  Blocks received from initiator = 1967221471
  Blocks read from cache and sent to initiator = 804439119
  Number of read and write commands whose size <= segment size = 312098925
  Number of read and write commands whose size > segment size = 45998
Vendor (Seagate/Hitachi) factory information
  number of hours powered up = 13224.42
  number of minutes until next internal SMART test = 42
Error counter log:
           Errors Corrected by           Total   Correction     Gigabytes    Total
               ECC          rereads/    errors   algorithm      processed    uncorrected
           fast | delayed   rewrites  corrected  invocations   [10^9 bytes]  errors
read:   58984049        1         0  58984050   58984050       3151.730           0
write:         0        0         0         0          0   9921230881.600           0
verify:     1308        0         0      1308       1308          0.000           0
Non-medium error count:        0
No self-tests have been logged
Long (extended) Self Test duration: 1367 seconds [22.8 minutes]
Replace /dev/sg1 with your disk number. If you've raid 10 array with 4 disks than:
  • /dev/sg0 - RAID 10 controller (you will not get any info or /dev/sg0).
  • /dev/sg1 - First disk in RAID 10 array.
  • /dev/sg2 - Second disk in RAID 10 array.
  • /dev/sg3 - Third disk in RAID 10 array.
  • /dev/sg4 - Fourth disk in RAID 10 array.
Another simple command to just check basic status is as follows:
# /usr/StorMan/arcconf getconfig 1 | grep State
# /usr/StorMan/arcconf getconfig 1 | grep -B 3 State

Sample outputs:
----------------------------------------------------------------------
      Device #0
         Device is a Hard drive
         State                              : Online
--
         S.M.A.R.T.                         : No
      Device #1
         Device is a Hard drive
         State                              : Online
--
         S.M.A.R.T.                         : No
      Device #2
         Device is a Hard drive
         State                              : Online
--
         S.M.A.R.T.                         : No
      Device #3
         Device is a Hard drive
         State                              : Online

  +++++++++++++++++++++++++++++++++++++

 Adaptec

  for i in `ll /dev/sg*  | awk '{print $NF}'`; do echo "smart result for $i "; smartctl -a -d scsi --all $i -H; echo "-----------------------------" ; done


3Ware

smartctl -a -d 3ware,N /dev/twax

x-controller number

N-drive number



Megaraid+

 

 storcli /c0 /eall /sall show
Controller = 0
Status = Success
Description = Show Drive Information Succeeded.
Drive Information :

—————————————————————————
EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp
—————————————————————————
252:0 10 Onln 0 930.390 GB SATA HDD N N 512B ST1000DM003-9YN162 U
252:1 11 Onln 0 930.390 GB SATA HDD N N 512B ST1000DM003-9YN162 U
252:2 9 Onln 0 930.390 GB SATA HDD N N 512B ST1000DM003-9YN162 U
252:3 8 Onln 0 930.390 GB SATA HDD N N 512B ST1000DM003-9YN162 U
252:4 12 Onln 0 930.390 GB SATA HDD N N 512B ST1000DM003-9YN162 U
252:5 14 Onln 0 930.390 GB SATA HDD N N 512B ST1000DM003-9YN162 U
252:6 13 Onln 0 930.390 GB SATA HDD N N 512B ST1000DM003-9YN162 U
252:7 15 Onln 0 930.390 GB SATA HDD N N 512B ST1000DM003-9YN162 U
—————————————————————————

 

 

smartctl -a -d megaraid,N /dev/sda

For SATA disk, use the following syntax

smartctl -a -d sat+megaraid,N /dev/sda


RAID-Controller Linux FreeBSD NetBSD OpenBSD MacOS Solaris Windows
LSI 3ware SATA RAID controller -d 3ware,N /dev/twX 1. -d 3ware,N /dev/twX 2. - - - - /dev/sdX,N 3.
Areca SATA[/SAS] RAID controller -d areca,N[/E] /dev/sgX 4. -d areca,N[/E] /dev/arcmsrX 11. - - - - -d areca,N[/E] /dev/arcmsrX 12.
HighPoint RocketRAID SATA RAID controller -d hpt,L/M/N /dev/sdX 5. -d hpt,L/M/N /dev/hptX 6. - - - - -
CCISS (HP/Compaq Smart Array Controller) -d cciss,N /dev/cciss/cXd0 7. -d cciss,N /dev/cissX - - - - -
LSI MegaRAID SAS RAID controller
Dell PERC 5/i,6/i controller
-d megaraid,N /dev/sdX 8. /dev/passX 9. - - - - /dev/csmiX,N 13.
Intel ICHxR RAID
(Intel Rapid/Matrix Storage)
/dev/sdX /dev/adX ? ? ? ? /dev/csmiX,N 10.
Adaptec SAS RAID controller
(devices supported by aacraid driver)
-d aacraid,H,L,ID /dev/sdX14.- - - - - -d aacraid,H,L,ID /dev/sdX15.

 

  https://www.smartmontools.org/wiki/Supported_RAID-Controllers

Comments

Popular posts from this blog

How to tweak linux server harddisk using hdparm

hdparm switches explained http://manpages.ubuntu.com/manpages/intrepid/man8/hdparm.8.html   First of all you have to install hdparm in linux. apt-get install hdparm #hdparm /dev/sda /dev/sda: readonly = 0 (off) readahead = 120 (on) geometry = 8850/255/63, sectors = 142182912, start = 0 Hard disk Performance Information # hdparm -tT /dev/hda /dev/hdd: Timing cached reads: 496 MB in 2.00 seconds = 247.42 MB/sec Timing buffered disk reads: 60 MB in 3.03 seconds = 19.81 MB/sec Hard drive set to low, slow settings # hdparm -cuda /dev/hda /dev/hda: IO_support = 0 (default 16-bit) unmaskirq = 0 (off) using_dma = 0 (off) readahead = 256 (on) Use below tweaks to increase disk read write performance. For sda drive ~]# hdparm -a 2048 /dev/sda /dev/sda: setting fs readahead to 2048 readahead = 2048 (on) For sdb drive [root@439298a ~]# hdparm -a 2048 /dev/sdb /dev/sdb: setting fs readahead to 2048 readahead = 2048 (on) ]# echo “anticipatory” >...

Modsecurity block rule for XMLRPC and wp-login attack

SecAction phase:1,nolog,pass,initcol:ip=%{REMOTE_ADDR},initcol:user=%{REMOTE_ADDR},id:5000134  <Locationmatch "/wp-login.php">  SecRule user:bf_block "@gt 0" "deny,status:401,log,id:5000135,msg:'ip address blocked for 5 minutes, more than 10 login attempts in 3 minutes.'"  SecRule RESPONSE_STATUS "^302" "phase:5,t:none,nolog,pass,setvar:ip.bf_counter=0,id:5000136"  SecRule RESPONSE_STATUS "^200" "phase:5,chain,t:none,nolog,pass,setvar:ip.bf_counter=+1,deprecatevar:ip.bf_counter=1/180,id:5000137"  SecRule ip:bf_counter "@gt 10" "t:none,setvar:user.bf_block=1,expirevar:user.bf_block=300,setvar:ip.bf_counter=0"  </Locationmatch>  SecAction phase:1,nolog,pass,initcol:ip=%{REMOTE_ADDR},initcol:user=%{REMOTE_ADDR},id:5000234  <Locationmatch "/xmlrpc.php">  SecRule user:bf_block "@gt 0" "deny,status:401,log,id:5000235,msg:'ip address blocked for 5 m...

RAID

Check the Raid installed lspci | grep RAID     Software Raid ============== Linux Support For Software RAID Currently, Linux supports the following RAID levels (quoting from the man page): LINEAR RAID0 (striping) RAID1 (mirroring) RAID4 RAID5 RAID6 RAID10 MULTIPATH, and FAULTY. MULTIPATH is not a Software RAID mechanism, but does involve multiple devices: each device is a path to one common physical storage device. FAULTY is also not true RAID, and it only involves one device. It provides a layer over a true device that can be used to inject faults. Install mdadm Type the following command under RHEL / CentOS / Fedora Linux: # yum install mdadm Type the following command under Debian / Ubuntu Linux: # apt-get update && apt-get install mdadm How Do I Create RAID1 Using mdadm? Type the following command to create RAID1 using /dev/sdc1 and /dev/sdd1 (20GB size each). First run fdisk on /dev/sdc and /dev/sdd with " Softwa...