#!/bin/bash #Get a human readable string for a disc, using sfdisk, smartctl and other tools DISC=$1 if ! [ -b $DISC ]; then exit 1 fi SIZE=`sfdisk -s $DISC 2>/dev/null` (( SIZE=SIZE/1024 )) INFO=`smartctl -i /dev/hda | egrep '(Device Model:|Device:|Model Family:|Serial Number:)' | sed -r 's/ +/ /g' | tr "\n" " "` echo "$DISC: $INFO ($SIZE Mb)"