Sponsored Content
Full Discussion: Find out the failed disk
Operating Systems Linux Red Hat Find out the failed disk Post 302701697 by dilibau on Monday 17th of September 2012 05:51:28 AM
Old 09-17-2012
Code:
#!/bin/bash

# Who should e-mails about failure go to
MAILTO='admin@domain.com'

LOG_FILE=/root/raid.log
OK_FILE=/root/raid.ok

# If OK file doesn't exist create it
if [ ! -e $OK_FILE ]; then
cat /proc/mdstat > $OK_FILE
fi

rm -f $LOG_FILE

SYSTEM=`uname --nodename`

cat /proc/mdstat > $LOG_FILE

DIFF=`diff $OK_FILE $LOG_FILE | wc -l `

if [ $DIFF -ne 0 ]; then
echo "RAID failed"
mail -s "URGENT: RAID disk failure detected on $SYSTEM" $MAILTO < $LOG_FILE
else
echo "RAID OK"
fi
exit 0


Last edited by Corona688; 09-17-2012 at 01:11 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Scsi Disk Failed

My WS boot disk has failed so when i want to boot system (by OK boot -s or Ok boot disk0 ) i get these mesgs: disk read error boot :can not find misc/sparc9v/krtld boot:error loading interperetor (misc/sparc9v/krtld) Elf64 read error. boot failed. although it's probed ,finally i try... (1 Reply)
Discussion started by: nikk
1 Replies

2. Solaris

How can we confirm that, the disk has failed in Solaris?

Hi All, Seems to be one of the disk has failed on my Solaris server. How do i confirm that disk has really failed or not? Here are alert details. ------- iostat -En out/put c1t3d0 Soft Errors: 1884 Hard Errors: 153 Transport Errors: 54 Vendor: FUJITSU Product:... (3 Replies)
Discussion started by: Naresh Kommina
3 Replies

3. Solaris

How to replace failed disk?

Dear all Please can any one explain me how to replace failed disk in Solaris 10. Please tell me the step by step procedure. (9 Replies)
Discussion started by: suneelieg
9 Replies

4. Solaris

Cannot remove and replace failed disk

-bash-3.00# zpool detach zonepool c1t1d0 cannot detach c1t1d0: only applicable to mirror and replacing vdevs -bash-3.00# zpool remove zonepool c1t1d0 cannot remove c1t1d0: only inactive hot spares, cache, top-level, or log devices can be removed -bash-3.00# zpool offline zonepool c1t1d0... (3 Replies)
Discussion started by: LittleLebowski
3 Replies

5. Boot Loaders

read sectors from disk failed with timeout

i'm writing some code to simulate the boot progress after power on but when i try to read the 2nd sector from a floppy disk, this operation always fail with ah=0x80h which means timeout, how can i get over this problem? my code would be like this: $ cat boot.S .code16 #define SETUPLEN 4... (0 Replies)
Discussion started by: wljackhero
0 Replies

6. Linux

read sectors from disk failed with timeout

i'm writing some code to simulate the boot progress after power on but when i try to read the 2nd sector from a floppy disk, this operation always fail with ah=0x80h which means timeout, how can i get over this problem? my code would be like this: $ cat boot.S .code16 #define SETUPLEN 4... (0 Replies)
Discussion started by: wljackhero
0 Replies

7. UNIX for Advanced & Expert Users

read sectors from disk failed with timeout

i'm writing some code to simulate the boot progress after power on but when i try to read the 2nd sector from a floppy disk, this operation always fail with ah=0x80h which means timeout, how can i get over this problem? my code would be like this: $ cat boot.S .code16 #define SETUPLEN 4... (0 Replies)
Discussion started by: wljackhero
0 Replies

8. Solaris

Recover failed system disk

I have an oldish Solaris 10 system (SunFire x4240), which due to a recent heating event in the server room, lost it's system disk. I have rsync backups of all the other (data) disks, but apparently I do not have a backup of /. :-( I can start the machine up in failsafe mode, but running fsck on... (4 Replies)
Discussion started by: jj5406
4 Replies

9. AIX

Failed Disk,unable to varyonvg

Iam new to AIX I am unable varyonvg on the vios,some of the disk are reported as harware failure. I am going to replace the disk,Please tell me how to remove the disk without any corruption in the VG lspv -l hdiskx also didn't work (0 Replies)
Discussion started by: roayaix
0 Replies

10. Solaris

Replacing a failed disk using SVM

Hi Please can you help me on replacing or removing a faulty disk drive on a SUN NETRA X4250server with 4 internal drives only. the format comand show me the following: format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t0d0 <drive type unknown> ... (9 Replies)
Discussion started by: fretagi
9 Replies
vxr5check(1M)															     vxr5check(1M)

NAME
vxr5check - verify RAID-5 volume parity SYNOPSIS
/etc/vx/bin/vxr5check [-i | -v] [-g diskgroup] volume DESCRIPTION
The vxr5check utility compares the parity of each stripe of a RAID-5 volume specified by volume. vxr5check reads the data for each stripe, generates the parity for this stripe, and compares this parity with the existing parity. vxr5check can be run against the entire RAID-5 volume, or incrementally on RAID-5 stripe boundaries, by specifying the -i option. OPTIONS
-g diskgroup Specifies the Veritas Volume Manager (VxVM) disk group name for the RAID-5 volume name for verification. If this option is not specified, the default disk group is determined using the rules given in the vxdg(1M) manual page. -i Verifies the RAID-5 volume incrementally per stripes. If a parity mismatch is found, that stripe location is displayed. -v Verbose output for the incremental vxr5check verification. The verbose option outputs each stripe number that is being verified. OUTPUT FORMAT
In verbose mode and incremental mode, summary reports for each stripe of the RAID-5 volume are printed in output records. If an error is returned for a stripe, then an error message and stripe number are displayed. In non-verbose mode, if an error is returned, an error mes- sage is displayed. If a parity mismatch error is determined on a stripe, vxr5check exits on that stripe and does not continue for the remaining stripes in the RAID-5 volume. FILES
/usr/lib/vxvm/bin/vxr5vrfy The utility that vxr5check calls to perform RAID-5 parity verification operations for the specified RAID-5 volume. EXIT CODES
The vxr5check utility exits with a non-zero status if the attempted operation fails. A non-zero exit code is not a complete indicator of the problems encountered, but rather denotes the first condition that prevented further execution of the utility. See vxintro(1M) for a list of standard exit codes. NOTES
Do not run vxr5check on a volume that is in degraded mode. SEE ALSO
vxevac(1M), vxintro(1M), vxmend(1M), vxvol(1M) VxVM 5.0.31.1 24 Mar 2008 vxr5check(1M)
All times are GMT -4. The time now is 12:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy