Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

Disclaimer: I am very new to Linux :)

Anyway, onward:

I have a fresh instance of Ubuntu Server (12.04.1 LTS) running on my network and I want to mount a network drive to the server so I can access the contents. The network drive is a SAMBA compatible drive running Darwin OS.

If I run the following command:

smbclient -L // -U myuser

It prompts me for the password and then displays output similar to:

Domain=[SERVER01] OS=[Darwin] Server=[@(#)PROGRAM:smbd  PROJECT:smbx-105.4.0]

Sharename       Type      Comment
---------       ----      -------
Comp Staff's Public Folder Disk
CompRaid03      Disk
Dropbox         Disk
Groups          Disk
IPC$            IPC
Public          Disk
Users           Disk
compstaff       Disk

However, when I try and mount the CompRaid03 share, using this command:

sudo mount -t cifs // /mnt/myshare -o username=myuser

I get the same password prompt, but after putting the correct password in, I received this error:

mount error(22): Invalid argument

dmesg | tail returns:

[23576.037373] CIFS VFS: cifs_mount failed w/return code = -22

I don't understand what is wrong with this command. I've managed to mount a share on my current (Windows 8) machine using basically the same command but with a different IP address and share name (obviously). I've spent a good few hours trying to solve this and got no where. Any help or pointers would be greatly appreciated.

Thanks Steve


As suggested I've also trued using "user=" instead of "username=":

sudo mount -t cifs // /mnt/svnrepo -o user=myuser

This results in the same "Invalid argument" error.


I feel I should add to the question that in the end I couldn't figure out what the problem was, but, I used the exact same command to mount a share on a different shared drive that was running Debian and it worked fine - I can only assume it's therefore a flaw or idiosyncrasy of the SAMBA implementation that Darwin OS is using.

share|improve this question
I think it is user=myuser, not username=myuser See – bodhi.zazen Feb 4 '13 at 17:53
Thanks for response, please see edit, cheers. – Steve Whitfield Feb 4 '13 at 18:12
My only other advice is to put the user before the mount ` sudo mount -t cifs -o user=myuser // /mnt/svnrepo ` , although I am not sure why order would matter. – bodhi.zazen Feb 4 '13 at 18:20
Could you test this answer on SO? It suggests installing cifs-utils. – lgarzo Jun 26 '13 at 16:03

0 down vote

I have found a solution. Add the option sec=ntlm - this works both in a manual mount and from fstab

The fstab entry is now - Network USB Drive - ie the USB Flash Drive connected to the Modem

// /home/user/USB cifs sec=ntlm,uid=1000,gid=1000,guest,_netdev 0 0

Based with Thanks from

share|improve this answer

On RHEL I had to edit file /etc/request-key.conf and add these 2 rows at the end of the file.

create       cifs.spnego    * * /usr/sbin/cifs.upcall -c %k
create       dns_resolver   * * /usr/sbin/cifs.upcall %k
share|improve this answer

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.