Check if all mountpoints are in read-write mode

If you work with servers  that use SAN storages yo uprobably know this scenario – one or more paths got temporarily offline. After all paths are online again you need to be sure that all filesystems are accessible and are still in read-write mode. You can easily check it using commands below:
 

Linux

FILE=readwrite.check; for i in `mount | awk ' $5!~/(proc|sysfs|devpts|tmpfs|debugfs|usbfs|subfs|binfmt_misc|rpc_pipefs|nfsd|vxodmfs|securityfs|fusectl|oracleasmfs)/ {print $3}'`; do echo "======== $i ========"; echo "Objects in folder: $(ls -la $i | wc -l)"; echo "rw check" > $i/$FILE; ls -la $i/$FILE; rm -f $i/$FILE; echo; done;
 

AIX

FILE=readwrite.check; for i in `mount | awk '$3 !~/procfs/ {print $2}'`; do echo "======== $i ========"; echo "Objects in folder: $(ls -la $i | wc -l)"; echo "rw check" > $i/$FILE; ls -la $i/$FILE; rm -f $i/$FILE; echo; done
 

Solaris

FILE=readwrite.check; for i in `mount | awk ' $3!~/(fd|ctfs|sharefs|objfs|mnttab|devices|proc|sharetab)/ {print $1}'`; do echo "======== $i ========"; echo "Objects in folder: $(ls -la $i | wc -l)"; echo "rw check" > $i/$FILE; ls -la $i/$FILE; rm -f $i/$FILE; echo; done
 

Leave a Reply

Your email address will not be published. Required fields are marked *

Write numbers u see, eg. 365 *