Tuesday 29 November 2011

Check if a filesystem is mounted or not

 # Use "mount" here, do not use "df" as if there is a FS problem "df" might hang
       filesystem=/tmp

        if [[ `mount | grep $filesystem ` = "" ]]
        then
 
                echo "The filesystem is not mounted !"
                exit  127
        fi

No comments:

Post a Comment

Tweets by @sriramperumalla