Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 //192.168.0.2 -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 //192.168.0.2/CompRaid03 /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

EDIT

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

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

This results in the same "Invalid argument" error.

EDIT 2

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
1  
I think it is user=myuser, not username=myuser See manpages.ubuntu.com/manpages/precise/en/man8/mount.cifs.8.html –  bodhi.zazen Feb 4 '13 at 17:53
    
Thanks for response, please see edit, cheers. –  Steve_ 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 //192.168.0.2/CompRaid03 /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
add comment

1 Answer

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

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

Based with Thanks from http://ubuntuforums.org/showthread.php?t=2139090

share|improve this answer
add comment

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.