Wednesday, July 7, 2010

Solaris 10: Find new disk and label it

#cat format.cmd
label
quit

#cat list
4B19
5B19
6B19
7B19

#! /bin/sh
echo "\n" | format > format.before
#cfgadm -al
echo "\n" | format > format.after
for i in `cat list`
do
echo $i
grep -i $i format.after| grep -i configured| awk -F: '{print $1}' > a.out
echo "format -s -f format.cmd `grep -i $i format.after| grep -i configured| awk -F: '{print $1}'`" > labeldisk.sh
done

#sh -x labeldisk.sh