Archive for August, 2009

Description of the file system hierarchy

Wednesday, August 19th, 2009

man hier

;)

Bash script: effectively check if a filesystem is mounted

Tuesday, August 18th, 2009

Whenever you want to check if a file system is mounted and perform some action in you script based on this, the simplest and most accurate way to do it in Linux is to check /proc/mounts:

if grep -qs ‘/mnt/sda2′ /proc/mounts; then
echo “fs mounted”
else
echo “fs not mounted”
fi