#!/bin/sh -e
#
# Report the partition tables

if [ -x /sbin/fdisk ] ; then
	( for disk in hda hdb hdc hdd sda sdb sdc sdd ; do
		/sbin/fdisk -l /dev/$disk || true
	  done
	) 2>&1 | sed "s%^%info: $0: fdisk: %"
else
	echo "error: $0: Unable to find /sbin/fdisk"
fi

if [ -f /proc/partitions ] ; then
	sed "s%^%info: $0: partitions: %" < /proc/partitions
else
	echo "error: $0: Unable to find /proc/partitions"
fi

if [ -f /etc/fstab ] ; then
	sed "s%^%info: $0: fstab: %" < /etc/fstab
else
	echo "error: $0: Unable to find /etc/fstab"
fi

if [ -x /bin/df ] ; then
	/bin/df -k | sed "s%^%info: $0: df: %"
else
	echo "error: $0: Unable to find /bin/df"
fi
