#!/bin/sh 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 case ${MountPoint} in /) Label=root ;; /boot) Label=boot ;; /usr) Label=usr ;; /usr/bp) Label=usrBP ;; /var) Label=var ;; # /backups) # Label=backups # ;; /mirror) Label=root-mirror ;; /mirror/boot) Label=boot-mirror ;; /mirror/usr) Label=usr-mirror ;; /mirror/usr/bp) Label=usrBP-mirror ;; /mirror/var) Label=var-mirror ;; # /mirror/backups) # Label=backups-mirror # ;; esac echo "Labeling ${BlockDevice} at ${MountPoint} as ${Label}" tune2fs -L ${Label} ${BlockDevice} > /dev/null done