Wednesday, May 18, 2016

how to mount the raw disks or nfs mounts that are listed in fstab

we can use this simple method to find what disks or mounts are missing before we bring the database up....

To understand this better.... initially the admins will put an entry in fstab for the disks and mounts that need to be mounted... but sometimes we dont see all disks come up.... it figure it out and make them available you can use this small script....

list=`awk '{print $2}' /etc/fstab |grep -i "/" | grep -v '^/etc/fstab' | grep -v '^/director' | grep -v '/abcdef_data' | egrep '/.'`         ----(you can exclude some more using grep -V)
for i in $list
do
grep -iw $i /proc/mounts > /dev/null
status=$?
if [ $status -eq 0 ]; then
echo " $i is mounted"
else
echo "$i is not mounted"                      ---------you can mount the missing one by adding (mount $i)                                                                      ... if you want it to mount directly)
fi
done

No comments:

Post a Comment

PostgreSql: Useful Commands-

 1)   ************************* Users ***************************  -- List of users with roles assigned: SELECT usename AS role_name,   CASE...