#!/bin/ksh
unset LANG
disque=$1
chdev -l $disque -a pv=yes
SERIAL=`lscfg -vl $disque|grep Serial|sed 's/\./ /g'|awk '{ print $3 }'`
FILE_LOG=/tmp/formatage/logs/$disque.$SERIAL.log
lsattr -El $disque > $FILE_LOG
lscfg -vl $disque >> $FILE_LOG
echo "....Lancement du formatage...`date`"
diag -c -d $1 -T format >> $FILE_LOG 2>&1
ret=$?
grep "successful" $FILE_LOG
if test $? -ne 0
then
echo "...ATTENTION, erreur sur formatage de $disque (Code=$ret)"
fi
echo "....Fin du formatage de $disque `date`"