Mount Return Code for CIFS mount

Posted by laikadad101 on Server Fault See other posts from Server Fault or by laikadad101
Published on 2010-03-16T20:09:01Z Indexed on 2010/03/16 20:11 UTC
Read the original article Hit count: 770

Filed under:
|

When I run the following command (as root or via sudo) from a bash script I get an exit status (or return code in mount man page parlance) of 1:

mount -v -t cifs //nasbox/volume /tmpdir/ --verbose -o credentials=/root/cifsid &> /tmp/mylog

It outputs the following into the myflog file:

parsing options: rw,credentials=/root/cifsid

mount.cifs kernel mount options unc=//nasbox\volume,ip=192.168.1.1,user=root,pass=xxxx,ver=1,rw,credentials=/root/cifsid

It mounts the volume fine but returns the exit code (from the mount man page):

1 Incorrect invocation or permissions

The standard Linux log files don't contain any error information. Hence, all seems to go well but I get an exit code of 1 instead of 0. Any ideas?

The -v and --verbose options are just there for debugging this problem.

© Server Fault or respective owner

Related posts about mount

Related posts about cifs