Since you asked for a script, this one will do any directory you desire, giving you the file system type of that directory and its immediate subdirectories. You can simply update the translation code as new types are discovered.
#!/bin/bash
function xlat {
retVal=" [Not recognized]"
if [[ "$1" == "ext2/ext3" ]] ; then
retVal=" [Normal]"
fi
if [[ "$1" == "tmpfs" ]] ; then
retVal=" [Temporary]"
fi
if [[ "$1" == "sysfs" ]] ; then
retVal=" [System]"
fi
if [[ "$1" == "proc" ]] ; then
retVal=" [Process]"
fi
if [[ "$1" == "nfs" ]] ; then
retVal=" [NFS]"
fi
echo ${retVal}
}
baseDir="$1"
if [[ -z "${baseDir}" ]] ; then
baseDir=.
fi
if [[ ! -d "${baseDir}" ]] ; then
echo "ERROR: '${baseDir}' is not a directory."
exit
fi
echo "Processing '${baseDir}':"
for dirSpec in $(find ${baseDir} -maxdepth 1 -type d) ; do
dirType=$(stat -f -L -c %T ${dirSpec})
echo " ${dirSpec} is '${dirType}'" $(xlat "${dirType}")
done
Here's the output from one of my zLinux boxes (from "classify_dirs.sh /
"):
Processing '/':
/ is 'ext2/ext3' [Normal]
/boot is 'ext2/ext3' [Normal]
/selinux is 'UNKNOWN (0xfffffffff97cff8c)' [Not recognized]
/bin is 'ext2/ext3' [Normal]
/srv is 'ext2/ext3' [Normal]
/dev is 'tmpfs' [Temporary]
/lib64 is 'ext2/ext3' [Normal]
/home is 'ext2/ext3' [Normal]
/lib is 'ext2/ext3' [Normal]
/misc is 'UNKNOWN (0x187)' [Not recognized]
/sys is 'sysfs' [System]
/opt is 'ext2/ext3' [Normal]
/tmp is 'ext2/ext3' [Normal]
/var is 'ext2/ext3' [Normal]
/proc is 'proc' [Process]
/usr is 'ext2/ext3' [Normal]
/net is 'UNKNOWN (0x187)' [Not recognized]
/lost+found is 'ext2/ext3' [Normal]
/root is 'ext2/ext3' [Normal]
/media is 'ext2/ext3' [Normal]
/mnt is 'ext2/ext3' [Normal]
/etc is 'ext2/ext3' [Normal]
/sbin is 'ext2/ext3' [Normal]