#!/bin/bash VERSION=1.0.0 #Grab the line entries for the mountpoints to establish disk labels. grep -v "^#" /etc/fstab | awk ' $3 == "ext3" { print $1,$2 } ' | while read BlockDevice MountPoint do # Use tune2fs to determine the volume name (disk label) # Get the label (volume) name # Strip out the spaces Label=`tune2fs -l ${BlockDevice} | awk -F: ' $1 ~ /Filesystem volume name/ { print $2 } ' | sed 's:^ *::g'` echo "${MountPoint}:${BlockDevice}:${Label}" done