Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 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.

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

 
discard

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.