![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script to check solaris system performance | jayaramanit | Shell Programming and Scripting | 3 | 06-06-2008 04:28 AM |
| fsck! How to run Full File System Check | hungevntelecom | HP-UX | 3 | 09-12-2007 04:30 PM |
| Have a shell script check for a file to exist before processing another file | heprox | Shell Programming and Scripting | 3 | 11-14-2006 03:26 AM |
| Script to check for a file, check for 2hrs. then quit | mmarsh | UNIX for Dummies Questions & Answers | 2 | 09-16-2005 02:46 PM |
| File System Check (fsck) | mawalton | UNIX for Dummies Questions & Answers | 1 | 09-17-2004 03:54 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
|||||
|
Hi All
After some research, I have developed this script ... Guys - Pls let me know how doest this sounds like? cat /etc/fstab | awk '{ print $2 }' | grep -v swap > /tmp/fs-list for i in `cat /tmp/fs-list` do echo " =================== Printing File System $i ===================== " ls -ltr $i done rm /tmp/fs-list Thanks a lot |
|
||||
|
Even if the filesystem isn't mounted your check of it (ls -ltr) will succeed. In other words, the mount *point* probably exists regardless of whether the filesystem is mounted or not.
If you want to find out whether all the filesystems in fstab are mounted, compare the output of df with the filesystems in fstab. Depending on which OS you are using you can use a 'readonly' fsck to check the filesystem itself. |
|
|||||
|
Generally you can find what filesystems are mounted on what mount-point on your system by going through the /etc/mnttab file. The format for the file differs between systems, so go through the man page of your mnttab file to get the exact format. Once you get this list, you can do your tests (disk usage, touch, etc.)
One point to note is that you can mount a filesystem without making an entry in the /etc/mnttab file. But I dont think that those will be that common. One question though, why cann't you use the df or similar command to find the mounted filesystems on your system? |
|
|||||
|
Quote:
And if some how I get some errors while mounting any file system then what kind of messages I should look for ( need to incorporate in the script ) so that at the time of problem it can grep for that kind of errors .... Thanks a lot Chirantan |
|
||||
|
Quote:
#Change your mountpoint according to your requirement if [ $COUNT = 0 ]; then date >> /var/log/messages echo NFS MOUNTS ARE dead echo NFS is dead >> /var/log/messages echo Remounting Mounts sleep 2 /bin/mount -a sleep 1 else echo NFS MOUNTS are fine echo nothing >> /dev/null fi Note:- Mount -a read /etc/fstab so make sure you have proper entry for the same. Cheers!!! Tushar Last edited by vbe; 03-17-2009 at 11:49 AM.. Reason: rules conformance (rm URL) |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|