mounting cifs

Upon returning to openSUSE a short while ago, I was pretty impressed with most things. I find it to be a tad more stable and reasonably paced than my other main system (Fedora).

And then I tried to mount a cifs drive and… “boom goes the dynamite.”

Off and on I’ve booted back into openSUSE to try and resolve the problems I’ve had. I’ve googled, followed some instructions, all to no avail.

First of all, I think an important distinction should be made here: my one and only goal is to mount a Windows share; this has absolutely nothing to do with samba shares. As I understand it, Samba would be useful for sharing Linux files with my Windows network, and that is something I have no interest in doing. I emphasize this because it seems that everything I find has something to do with samba.

Anyway, I’ve enabled every service I can think of - winbind, nmb, smb, cifs. I’ve reinstalled them all. I’ve added winbind and wins to the /etc/nsswitch.conf file. None of this has been necessary in any other Linux distro I’ve used. All I’ve ever had to do is install cifs-utils and fuse-smb. Then simply run this command:

mount -t cifs //[share].[domain] /mnt -o username=[username]

But with openSUSE all I ever get in return is an unresolvable host name (apparently this requires an IP) or a 115: Operation now in progress error.

Anybody know why? Is there some hoop I’ve failed to jump through? What’s with the unnecessary complications for such a simple and routine task?

Hi Riddlah,

In order to help you the best, can you tell us which version of openSUSE and Samba are you using?

In fact, it has something to do with Samba because you need it to access SMB shares from your Linux box. So don’t be shocked if we ask you what your configuration of Samba on your client is.

You CIFS mount command can fail for a lot of reasons… First, the syntax for mount.cifs (or mount -t cifs) is mount.cifs {service} {mount-point} where service uses the //server/share syntax (c.f. man mount.cifs). From my point of view, this is different from //share.domain.

From your error messages, a simple question comes next: can you ping your SMB server with its hostname from your openSUSE box?

On 9/14/2013 6:16 PM, Riddlah wrote:
>
> Upon returning to openSUSE a short while ago, I was pretty impressed
> with most things. I find it to be a tad more stable and reasonably paced
> than my other main system (Fedora).
>
> And then I tried to mount a cifs drive and… “boom goes the
> dynamite.”
>
> Off and on I’ve booted back into openSUSE to try and resolve the
> problems I’ve had. I’ve googled, followed some instructions, all to no
> avail.
>
> First of all, I think an important distinction should be made here: my
> one and only goal is to mount a Windows share; -this has absolutely
> nothing to do with samba shares-
. As I understand it, Samba would be
> useful for sharing Linux files with my Windows network, and that is
> something I have no interest in doing. I emphasize this because it seems
> that everything I find has something to do with samba.
>
> Anyway, I’ve enabled every service I can think of - winbind, nmb, smb,
> cifs. I’ve reinstalled them all. I’ve added winbind and wins to the
> /etc/nsswitch.conf file. None of this has been necessary in any other
> Linux distro I’ve used. All I’ve ever had to do is install cifs-utils
> and fuse-smb. Then simply run this command:
>
>
> Code:
> --------------------
> mount -t cifs //[share].[domain] /mnt -o username=[username]
> --------------------
>
>
> But with openSUSE all I ever get in return is an unresolvable host name
> (apparently this requires an IP) or a 115: Operation now in progress
> error.
>
> Anybody know why? Is there some hoop I’ve failed to jump through? What’s
> with the unnecessary complications for such a simple and routine task?
>
>
Riddlah;

If the server name is not in the DNS server, you need to add “wins” to the hosts line of /etc/nsswitch.conf. For example:


hosts:  	files mdns_minimal [NOTFOUND=return] dns wins

This allows the mount command to use Windows network name resolution methods.

Alternatively add the server to /etc/hosts or just use its IP in the mount command.

The mount command should specify the server and share name. Since mount is carried out as root, you should add the Linux user and
group to own the files. Here is an example:


Hal2:~ # mount -t cifs //val/pictures /mnt/Samba -o user="John Doe",password=bigsecret,uid=jdoe,gid=users,rw

Here the share, pictures, lies on the machine val. In this case the Windows user, John Doe, is enclosed in quotes("s) to allow the
space in the name to be parsed, the quotes would not be needed if the windows user had no spaces. The Linux user to own the files
is jdoe and the share is mounted read/write. Of course the mount point, /mnt/Samba, was created before the mount command was
executed.

While testing, turn off the Firewall so there is no question of its involvement.


P.V.
“We’re all in this together, I’m pulling for you” Red Green

You have my sympathies concerning mounting via cifs and not making any used of Samba. Samba always seems to be assumed when it needn’t be used at all from a linux machine.

I’m at a loss though as my use of mount.cifs relates to a nas box set to run the cifs protocol. Mount cifs does assume a drive is accessed via a network link.and that there is some form of cifs server at the other end. Neither mount cifs or nfs relate to local drives but maybe it is possible to do that in some strange way.

The commands I used were as follows.


john@linux-pk0k:~> /sbin/mount.cifs //192.168.10.153/Volume_1 /home/john/Desktop/NAS -o user=john,rw
: 
john@linux-pk0k:~> /sbin/umount.cifs //home/john/Desktop/NAS
john@linux-pk0k:~> 

This mounted the drive to a directory I created on my desktop called NAS. To get this to work I had to edit the mount.cifs source file as Samba had placed some limitations on what users could do with it. The changes needed are indicated in the source file. I haven’t sorted this out on 12.3 yet but believe it’s simpler now. There was a post fairly recently where I detailed the mods made to mount.cifs and also details other methods of doing it. Unfortunately I didn’t book mark it and my post history on here doesn’t go back far enough but a search should find it. I quickly found 2 posts that may help but I recollect that there should be another one as well. From memory one should include details of additions to fstab.

https://forums.opensuse.org/english/get-technical-help-here/network-internet/488071-problems-mounting-nas-device-open-suse-12-3-a.html

https://forums.opensuse.org/english/get-technical-help-here/network-internet/488281-home-built-nas.html

John

FWIW, I have to access remote windows shares (for work-related purposes). I prefer casual access via my ifle manger (Dolphin).

I use something like this to access

smb://my-name@192.168.X.Y/Shared

where ‘my-name’ is the user name and I’m asked for my password to authenticate with. After that, I can browse, read, and write to the shared directories with no problems at all.

I did play with using Samba after a fashion at my end by setting the connection up via kde system settings. There were several problems from my point of view. KDE boot time was extended dramatically. Not much of a problem really. It’s probably trying to discover all available services or something like that. Navigation of any remote directories was irritatingly slow. I assume that this is down to the way it re reads the content of directories as they are entered however I have seen this sort of behaviour on other sharing systems. Using mount cifs directly was no different to using a local disc. In fact given the discs in the NAS I had the impression that some aspects were faster. More seriously I found that I couldn’t read modify write to the nas via several applications. Kate was ok but that was about it. Initially this looked to be down to the content of the desktop files but I couldn’t sort it out. I also use a number of none KDE applications there seemed to be no hope of getting these to work.

I should add that file locking worked in much the same way as it does on a local disks. I set up exclusive user directories anyway so that doesn’t really matter. I also added a drop box for file sharing etc. There a refresh may be needed if a file has just been put there and doesn’t show. Never happened but as it turned out little use was made of it.

The NAS was a small D-Link box. D-Link make the code available and it does include Samba but they provide no details at all of the code they have added just the lib files. Some of this will be down to the amazingly simple to use web interface that allows the box to be set up with the usual full user rights control but some of it may be substituting some aspects of Samba itself. I wonder about that aspect from previous use of sharing systems - slow to connect and slow navigate once connected.

John

Thanks for all the responses.

If you can believe this…

The entire problem was caused by the way I was connecting to my work network through openconnect cli.

I noticed that even though I got the banner telling me I was connected, there was one thing missing - the very last output is usually “Established DTLS connection” or something similar. When I noticed that wasn’t there, I decided to install NetworkManager-openconnect and try connecting that way.

And it worked. I have all the functionality I’m supposed to have.

Now I’m no networking expert, but through observation I can tell there’s something wrong with (or unusual about) the openconnect package in 12.3 stable repos.

Another point worth repeating is that this had nothing to do with Samba. I haven’t done anything to samba configuration files.

Ah, you connect over a VPN. That might have been useful to disclose in the opening post. (I do similar for work-related server access, but use the Network Manager for managing internet and PPTP VPN connectivity.)