#!/bin/sh
#@(#)disks	1.14 03/02/99 23:24:32

../tools/fmt 1>/dev/null 2>&1

../tools/diskinfo 1>disks/diskinfo 2>disks/diskinfo.err

ls -l /dev/rdsk 1>disks/ls-l_dev_rdsk.out 2>/dev/null

swap -l 1>disks/swap-l.out 2>&1
swap -s 1>disks/swap-s.out 2>&1

# gather major/minor numbers, which may be needed in following through
# crash dumps.
# REQUESTED by: Bede Seymor, SMCC CTE
ls -lL /dev/*dsk/* 1> disks/maj_min_dev\#.out 2>/dev/null
find /dev -type d -print | xargs ls -lL 1>disks/dev-lL.out 2>/dev/null

ls -ld /tmp 1>disks/ls-ld_tmp.out 2>/dev/null


# df -k,
# REQUESTED by: Bede Seymor, SMCC CTE
df -k > disks/df-k.out
df -a > disks/df-a.out
df -e > disks/df-e.out
df -g > disks/df-g.out



# gather disk partition information
# REQUESTED by: Bob Moore, ENP-CTE
mkdir disks/prtvtoc
for i in `ls /dev/rdsk/*s2`
do
    diskname=`echo $i|sed s/.dev.rdsk.//|sed s/s2//| sed s/\$/\&s/`

    # we need devinfo to find a non zero length partition, since prtvtoc
    # will return "No such device or address" on a zero length partition.
    # prtvtoc will be executed on one partition only as the info is the same
    # for all partitions.
    for k in 0 1 2 3 4 5 6 7
    do
        if test "`devinfo -p /dev/rdsk/$diskname$k 2>/dev/null`" != ""
	then
            prtvtoc /dev/rdsk/$diskname$k 1>disks/prtvtoc/$diskname$k 2>/dev/null
            break
        fi
    done
done
