Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Solaris - Format Utility - Multi Disk Formatting

Status
Not open for further replies.

MrBleeness

Technical User
May 22, 2004
16
US
Hello again everyone!

I have a solaris box that I use for a disk test bed. Often I find the need to wipe the drives .. and usually I have multiple drives to do this with. I was wondering if within solaris if there is any command argument that i can issue to do multi-formatting simultaniously. Seeings tho a 18 g drive takes about 300 minutes.. & turn around time with these things is poor.. and that to the 'Upper Mgmnt' is compleetly unacceptable. As far as software goes.. I cant buy any.. were running shoe string here.. so thats the deal there. Ultimatally.. ide also like to know how to set up a d1000 for doing the same things.

Thanx a Million !

- Steve

 
man prtvtoc
man fmthard

you can copy disklayouts with the following commands:
prtvtoc /dev/rdsk/templatedisks2 | fmthard -s - /dev/rdsk/destinationdisks2

Best Regards, Franz
--
Solaris System Manager from Munich, Germany
I used to work for Sun Microsystems Support (EMEA) for 5 years
 
Based on a disk scrubbing script from Solaris, this won't make it faster but will automate multiple disks.

--David Perry

#!/usr/bin/ksh
# set -x
# scrubbing disks with Solaris
# reboot -- -r
# touch /reconfigure ; reboot
echo "devfsadm -v"
devfsadm -C
devfsadm -v
DISKLIST="/tmp/scrub$$"
touch $DISKLIST
LOGDIR="/tmp/scrublog"
PERMLOGDIR="/opt/scrublog"
if [ ! -d $PERMLOGDIR ] ; then
mkdir -p $PERMLOGDIR
fi

if [ ! -d $LOGDIR ] ; then
mkdir $LOGDIR
fi
FMTCMD="/tmp/format.dat"
cat <<- EOT > $FMTCMD
format
analyze
setup
yes
no
4
yes
no
yes
126
yes
yes
yes
yes
quit
verify
quit
backup
quit
EOT
CDROM="c0t6d0"
BOOTDRIVE="c0t0d0"
PS3='disk? '
set -A diskarray `ls /dev/rdsk/*s2 | sed -e 's,/dev/rdsk/,,g' -e 's,s2,,g' | grep -v $BOOTDRIVE | grep -v $CDROM | sort -k 4 -n`
print "${diskarray[*]}"
i=0
typeset -uL1 reply
# set -x
while [ $i -lt `print "${diskarray[*]}" | wc -w` ] ; do
read reply?"Scrub disk ${diskarray[$i]} [Y|n]: "
if [ "$reply" != "N" ] ; then
echo ${diskarray[$i]} >> $DISKLIST
fi
(( i = i + 1 ))
done

if [ `wc -l "$DISKLIST" | awk '{ print $1 }'` -gt 0 ] ; then
for DISK in `cat $DISKLIST` ; do
echo "format -f $FMTCMD -l ${LOGDIR}/formatlog.$DISK $DISK"
if format -M -f $FMTCMD -l ${LOGDIR}/formatlog.$DISK $DISK ; then
echo "format of disk $DISK completed" >> ${LOGDIR}/passedanalyze
else
echo "format of disk $DISK failed" >> ${LOGDIR}/failedanalyze
fi
sd=`echo $DISK | sed -e 's/s0//'`
if [ `uname -r` = "5.9" ` ] ; then
serialno=`iostat -Exin | awk "/^$sd/,/Device Id/ { print $1 }" | awk '/Device Id:/ { print $NF }' | sed -e 's/^id.,//'`
else
serialno=`iostat -Exn | awk "/^$sd/,/Serial No/ { print $1 }" | awk '/Serial No:/ { print $NF }'`
fi
echo $serialno >> ${LOGDIR}/formatlog.$DISK
cp ${LOGDIR}/formatlog.$DISK $PERMLOGDIR/${serialno}.txt
done
fi

rm -f $DISKLIST
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top