Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Under Linux (Ubuntu 12.04) I want to mount a windows share / windows partition named //winshared on the network. I do not know the IP or anything else.

On one Ubuntu system, I am able to mount a directory with

mount  //winshared/mypath /mnt/win

while on one other Ubuntu system the exact same command just gives

mount error: could not resolve address for winshared: Unknown error

Network settings seem to be same on both systems, and I installed smbfs and samba (the latter with errors). Do I need to instal something else? Do I need to configure something? How to find out the crucial differences between both systems to get the same mount work on both systems?

Additional information:

  1. When I use smbclient to connect to the windows partition/share/whatever, it works on the first system but not on the other system. The error is:

    Connection to winshared failed (Error NT_STATUS_BAD_NETWORK_NAME)
    
  2. Following this tutorial I installed smbfs and cifs-utils, but the mount command from above still gives the same error, which is NOT described in the tutorial.

  3. I also have an entry in /etc/fstab reading

    //winshared/mypath /mnt/win cifs uid=alexander,credentials=/etc/samba/wincred 0 0
    

    with the file /etc/samba/wincred identical to a same file on the system the mount works. The md5sum of both files are identical. Therefore, an error regarding credentials can be excluded.

share|improve this question
    
See the tutorial on the Ubuntu Wiki: wiki.ubuntu.com/MountWindowsSharesPermanently –  slm Nov 6 '13 at 13:03
    
I installed the two packages, but still get the same error! –  Alex Nov 6 '13 at 13:16
    
I have updated the question; I posted the line of fstab, and I have verified the credential file is correct. –  Alex Nov 6 '13 at 13:28
3  
I would get this working from the command line 1st, putting the line in /etc/fstab is just making it more complicated to debug it to start. If you can't mount from the command line then it's something else. I use this everyday: mount -t cifs -o rw,netbiosname=serv1,credentials=/etc/creds.txt //192.168.1.1/somedir /mnt –  slm Nov 6 '13 at 13:33
    
Nope, changing permission to 600 does not fix the problem. –  Alex Nov 6 '13 at 13:37
show 20 more comments

2 Answers

Either you have name resolver issue (which you can check by e.g. pinging the host winshared from your Ubuntu host) or smbfs module is not loaded.

You might have to install smbfs first with apt-get -y install smbfs and then insert the module with modprobe smbfs, but after that you should be good to go with mount -t smbs.

What you're looking for is mount -t smbfs -o username=<your_username>,password=<your_password> //server/share /mountpoint.

share|improve this answer
    
smbfs is installed, but a modprobe smbfs returns FATAL: Module smbfs not found. Do I need to start smbfs first? If so, how? How to make it start automatically after a reboot? –  Alex Nov 6 '13 at 12:58
    
@Alex - There is nothing to start. You're missing packages most likely. –  slm Nov 6 '13 at 13:00
    
@Alex - see this Ubuntu tutorial, it has everything you need: wiki.ubuntu.com/MountWindowsSharesPermanently –  slm Nov 6 '13 at 13:02
    
I followed this tutorial, but still get the same error! –  Alex Nov 6 '13 at 13:16
add comment

Check that winbind is installed; then, in your /etc/nsswitch.conf file, there must be wins listed in the hosts line.

Something like:

hosts: files wins dns

There may be other modules listed, depending on what packages are installed on your system.

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.