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
ATARAID(4)						   BSD Kernel Interfaces Manual 						ATARAID(4)

NAME
ataraid -- software BIOS RAID SYNOPSIS
pseudo-device ataraid ld* at ataraid? vendtype ? unit ? DESCRIPTION
The ataraid driver provides support for BIOS-based software RAID controllers. These are devices which have some simple support for several basic RAID levels (often RAID 0 and RAID 1), but which require software support to actually perform the RAID function. The BIOS support is largely just to create and recognize the array so that it may be a boot device. The driver currently supports RAID formats from: o Adaptec HostRAID (found in Intel 6300ESB) o Intel MatrixRAID o JMicron RAID o nVidia MediaShield o Promise FastTrak o Via V-RAID (found in many VIA-based motherboards) Status of the logical disk as well as the disks associated with it, can be viewed through the bioctl(8) utility. SEE ALSO
ld(4), bioctl(8) HISTORY
The ataraid driver first appeared in NetBSD 2.0. AUTHORS
The ataraid driver was originally adapted from FreeBSD by Jason Thorpe <thorpej@NetBSD.org>. BUGS
Not all features of the software RAID are currently recognized or supported. For example, the Adaptec support doesn't recognize when a RAID 1 should be in a ``building'' state, and it does not do the right thing. At least part of the reason for this is that the publically-available information on these formats is quite limited. BSD
September 16, 2008 BSD
All times are GMT -4. The time now is 09:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy