1

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.

1 Answer 1

1

I cannot find anywhere in the source code where it exits with exit code of 1 without printing an error message first.

If you are getting any error messages, you need to add them to your question.

This is probably a bug but I have not been able to find a likely bug report for it.

What operating system are you running, and version of mount.cifs.

EDIT: Can you check the permissions are set so only root can read /root/cifsid as incorrect permissions may be causing this error.

7
  • I'm runing Samba (mount.cifs) 3.0.33 on Fedora 8.
    – user3146
    Commented Mar 17, 2010 at 15:36
  • Have not been able to find a relevant bug report so have stopped that line of investigation. Commented Mar 17, 2010 at 16:58
  • laikadad101, Was it a file permissions problem? Commented Mar 18, 2010 at 22:05
  • Permissions are set to 0600 and UID/GID set to 0 (root).
    – user3146
    Commented Mar 22, 2010 at 6:09
  • Try the command again and then check dmesg | tail to see if there is anything meaningful there. Commented Mar 22, 2010 at 22:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .