|
Nico and Co. Exutoire, zone libre de Nicolas Barcet
|
| connexion ssl |
NavigationTags
électronique
amazon
ami
april
brevets
cloud
démocratie
dadvsi
divers
drm
ec2
ecole
education
europe
fiction
filter
filtrage
fosscamp
france
hadopi
informatique
internet
interopérabilité
ipred2
itunes
kvm
législation
liberté
libertyalliance
linux
linuxworld08
logiciel libre
machine-a-voter
mandriva
moratoire
OOXML
oscon08
p2p
Paquet telecom
parents
partage
planetubuntu
politique
présidentielle
presidentielles
quadrature
RFID
sarkozy
schiboleth
screen
server
solutionslinux
sondage ubuntu server linux
technique
ubuntu
uds
uds-jaunty
virtualization
vote
[en]
|
Check the status of an md device
Nicolas 01/06/2005 - 10:03
The following script allows to check the satus of an md device, and therefore to know if a disc from a raid is faulty. It is done by storing the result of
#!/bin/sh
#
# RAID monitor
#
BASE_FILE=/etc/mdstat.ok
DIFF_FILE=/tmp/mddiff$$.out
#
# make the comparison template
#
if [ ! -s ${BASE_FILE} ]
then
if [ "0" != "`id -u`" ]
then
echo "Must be 'root' to run this script for the first time!"
exit 0
fi
cat /proc/mdstat >${BASE_FILE}
fi
#
# compare current mdstat with saved good version
#
diff -C1 ${BASE_FILE} /proc/mdstat >${DIFF_FILE}
if [ -s ${DIFF_FILE} ]
then
rm -f ${DIFF_FILE}
echo "Raid problem ??"
exit 1
fi
rm -f ${DIFF_FILE}
echo "Raid OK"
exit 0
Technorati Tags: Répondre |
ConnexionBlogue récents
Recherche |
Commentaires récents
il y a 2 weeks 6 days
il y a 3 weeks 7 hours
il y a 37 weeks 9 hours
il y a 38 weeks 2 days
il y a 38 weeks 3 days
il y a 1 année 26 weeks
il y a 1 année 41 weeks
il y a 1 année 41 weeks
il y a 1 année 46 weeks
il y a 1 année 47 weeks