Results 1 to 7 of 7
Hi , In this case what is the return value of mount . I want to run e2fsck only when
either mount fails or mount succeeded but with errors . ...
- 11-25-2010 #1Just Joined!
- Join Date
- Nov 2010
- Posts
- 3
e2fsck reports no problems, but mount warns of errors
Hi , In this case what is the return value of mount . I want to run e2fsck only when
either mount fails or mount succeeded but with errors . Is there some way to detect
this situatin "mounting fs with errors" in code/script . Thanx
- 11-25-2010 #2
Hello and Welcome.
I moved your thread here because we generally lock threads older than 6 months. Feel free to continue here.I do not respond to private messages asking for Linux help, Please keep it on the forums only.
All new users please read this.** Forum FAQS. ** Adopt an unanswered post.
- 11-26-2010 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
From the mount man page:
So, you can test the return code from mount in the system initialization scripts. Usually that would be /etc/rc.d/rc.sysinit, though it depends on the distribution+version of Linux that you are using. That is the case for Red Hat and RH derived systems such as CentOS. One thing however, is that this may not be simple to do. I just finished reviewing the file and am concerned that it would be very easy for you to fubar the system if you did it wrong - caveat administrator!Code:RETURN CODES mount has the following return codes (the bits can be ORed): 0 success 1 incorrect invocation or permissions 2 system error (out of memory, cannot fork, no more loop devices) 4 internal mount bug or missing nfs support in mount 8 user interrupt 16 problems writing or locking /etc/mtab 32 mount failure 64 some mount succeededSometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 11-26-2010 #4Just Joined!
- Join Date
- Nov 2010
- Posts
- 3
Thanx for replying . I checked the return value of mount in script , it returning success independent of whether it mounting with errors or without errors . Is there
any option available with mount so that i can diffrentiate between two .
- 11-26-2010 #5Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Need more information about what is going on - what errors you are seeing and where/when. What happens if you manually remount the device. Etc.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 11-26-2010 #6Just Joined!
- Join Date
- Nov 2010
- Posts
- 3
Message i am getting is
EXT2-fs warning: mounting fs with errors, running e2fsck is recommended .
Its not an error so device get mounted . I want to run e2fsck here , when i get this situation automatically . As for now i m running e2fsck every time before mounting device which in turn increases the boot time .
- 11-26-2010 #7Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Do you see anything regarding the errors that are occuring in the system logs (/var/log/messages, etc)?
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
