Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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=,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.

share|improve this question

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.

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.