Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Mount windows share in gnome, smbclient, but not in fstab

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
dtannheim
Posts: 6
Joined: 2011-06-18 19:17

Mount windows share in gnome, smbclient, but not in fstab

#1 Post by dtannheim »

I'm using Debian Squeeze and I'm trying to connect to a corporate share on a server called (for illustration purposes) adserver and the share is called shares. Using nautilus I am successfully able to connect. This can be proven with the output of gvfs-mount -l

Code: Select all

Drive(0): 250 GB Hard Disk
  Type: GProxyDrive (GProxyVolumeMonitorGdu)
  Volume(0): 140 MB Filesystem
    Type: GProxyVolume (GProxyVolumeMonitorGdu)
  Volume(1): 145 GB Filesystem
    Type: GProxyVolume (GProxyVolumeMonitorGdu)
Drive(1): CD/DVD Drive
  Type: GProxyDrive (GProxyVolumeMonitorGdu)
Mount(0): shares on adserver -> smb://CORP;littleoldme@adserver/shares/
  Type: GDaemonMount
So now I want to make this a permenant mount point that is always there and connected. So I create an entry in /etc/fstab and try to connect.

Code: Select all

root@myhost:~# mount -v /mnt/shares
domain=corp.mydomain.com
mount.cifs kernel mount options: ip=10.52.156.11,unc=\\10.52.156.11\shares,credentials=/root/.smbcredentials,ver=1,user=littleoldme,domain=corp.mydomain.com,prefixpath=IT,pass=********
Retrying with upper case share name
mount.cifs kernel mount options: ip=10.52.156.11,unc=\\10.52.156.11\SHARES,credentials=/root/.smbcredentials,ver=1,user=littleoldme,domain=corp.mydomain.com,prefixpath=IT,pass=********
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
And in syslog I can see this ...

Code: Select all

Dec  7 16:01:01 myhost kernel: [85073.459913]  CIFS VFS: cifs_mount failed w/return code = -6
Dec  7 16:01:01 myhost kernel: [85074.013580]  CIFS VFS: cifs_mount failed w/return code = -6
Things start getting interesting here as it is basically saying the share does not exist. But when I use smbclient I can successfully connect and list the contents of the share.

Code: Select all

root@myhost:~# smbclient //adserver/shares -U CORP/littleoldme
Enter CORP/littleoldme's password: 
Domain=[CORP] OS=[Windows Server 2008 R2 Enterprise 7601 Service Pack 1] Server=[Windows Server 2008 R2 Enterprise 6.1]
smb: \> ls
  .                                   D        0  Thu Oct  6 14:15:09 2011
  ..                                  D        0  Thu Oct  6 14:15:09 2011
  .DS_Store                          AH    12292  Thu Oct  6 14:15:51 2011
  Archives                            D        0  Mon Oct  3 17:30:09 2011
  Homes                               D        0  Sat Jul 16 00:07:52 2011
  IT                                  D        0  Thu Sep 29 17:14:34 2011
  Operations                          D        0  Sat Oct  1 16:09:42 2011
  Sales                               D        0  Fri Jul 15 23:38:49 2011

		40857 blocks of size 1048576. 4319 blocks available
smb: \> 
Ok, so I can connect with smbclient, but not using mount.cifs. Even according to smbclient the share is not there (notice "shares" is not in the following list).

Code: Select all

root@myhost:~# smbclient -L //adserver -U CORP/littleoldme
Enter CORP/littleoldme's password: 
Domain=[CORP] OS=[Windows Server 2008 R2 Enterprise 7601 Service Pack 1] Server=[Windows Server 2008 R2 Enterprise 6.1]

	Sharename       Type      Comment
	---------       ----      -------
	ADMIN$          Disk      Remote Admin
	C$              Disk      Default share
	IPC$            IPC       Remote IPC
	NETLOGON        Disk      Logon server share 
	SYSVOL          Disk      Logon server share 
Domain=[CORP] OS=[Windows Server 2008 R2 Enterprise 7601 Service Pack 1] Server=[Windows Server 2008 R2 Enterprise 6.1]

	Server               Comment
	---------            -------

	Workgroup            Master
	---------            -------
So how does it connect and how can I translate it to an appropriate entry in /etc/fstab so that I can mount it normally. What windows hocus pocus is going on here? This is what I currently have in fstab (please note using username and password in place of the options file has no impact on the original output from mount included above.

Code: Select all

//adserver.corp.mydomain.com/shares	/mnt/shares	cifs credentials=/root/.smbcredentials 0 0
All help appreciated as thrawling through the web has not helped me out.
Thanks in advance.

User avatar
mslinux
Posts: 942
Joined: 2010-12-24 05:14

Re: Mount windows share in gnome, smbclient, but not in fsta

#2 Post by mslinux »

cifs-utils installed?
MsLinux-

forums.debian.net - where facepalm is the default answer :D

© 2012
║▌║│█║▌│█│║▌║█║▌│█│║▌║│

dtannheim
Posts: 6
Joined: 2011-06-18 19:17

Re: Mount windows share in gnome, smbclient, but not in fsta

#3 Post by dtannheim »

Yup. I have tried using mount.cifs in place of mount also. Same result error -6.

I think the interesting thing is to work out why I can connect to a share that does not appear to exist (depending on what palates you use). It is just unclear to me how to add it to fstab when it appears not to be there.

User avatar
mslinux
Posts: 942
Joined: 2010-12-24 05:14

Re: Mount windows share in gnome, smbclient, but not in fsta

#4 Post by mslinux »

Maybe it's worth a try to redo sharing the said folder on the Windows machine and try to access it via another Windows machine if available, as comparison.
As per you log, it said the //adserver/shares is not a valid share.
MsLinux-

forums.debian.net - where facepalm is the default answer :D

© 2012
║▌║│█║▌│█│║▌║█║▌│█│║▌║│

dtannheim
Posts: 6
Joined: 2011-06-18 19:17

Re: Mount windows share in gnome, smbclient, but not in fsta

#5 Post by dtannheim »

Unfortunately I do not own the machine or share. Typical corporate setup here, project shares and user dirs available. In windows these are auto mounted for me. My understanding is this is something managed via Active Directory. But I think it is significant that using Places > Connect to server and using smbclient I can connect.

I am not familiar with samba logs etc. but if there it's some output I can capture that might help please advise.

damgaard
Posts: 31
Joined: 2010-03-16 22:13

Re: Mount windows share in gnome, smbclient, but not in fsta

#6 Post by damgaard »

What's the output of mount -a? You could try using the IP address rather than FQDN in /etc/fstab.
Something in the lines of this:

Code: Select all

//ipaddress/share    /mount/point    cifs    _netdev,credentials=/root/.smbcredentials    0    0
normally works.

dtannheim
Posts: 6
Joined: 2011-06-18 19:17

Re: Mount windows share in gnome, smbclient, but not in fsta

#7 Post by dtannheim »

Already tried with IP - no joy using either. Weird or what?

Code: Select all

root@myhost:~# mount -a /mnt/shares --verbose
domain=CORP
mount.cifs kernel mount options: ip=10.52.156.11,unc=\\10.52.156.11\shares,_netdev,credentials=/root/.smbcredentials,ver=1,user=littleoldme,domain=CORP,pass=********
Retrying with upper case share name
mount.cifs kernel mount options: ip=10.52.156.11,unc=\\10.52.156.11\SHARES,_netdev,credentials=/root/.smbcredentials,ver=1,user=littleoldme,domain=CORP,pass=********
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
root@myhost:~# smbmount //10.52.156.11/shares /mnt/shares --verbose -o credentials=/root/.smbcredentials
domain=CORP
mount.cifs kernel mount options: ip=10.52.156.11,unc=\\10.52.156.11\shares,credentials=/root/.smbcredentials,ver=1,user=littleoldme,domain=CORP,pass=********
Retrying with upper case share name
mount.cifs kernel mount options: ip=10.52.156.11,unc=\\10.52.156.11\SHARES,credentials=/root/.smbcredentials,ver=1,user=littleoldme,domain=CORP,pass=********
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

dtannheim
Posts: 6
Joined: 2011-06-18 19:17

[Solved] Connect to windows share using smbclient and mount

#8 Post by dtannheim »

Ah ha ... Windows trickery ... I said it. It appears that adserver is really an Active Directory server that somehow proxies the shares from the real file server. Don't claim to understand the detail, but figured it out using the following command:

Code: Select all

root@myhost:~# smbclient //10.52.156.11/shares -A /root/.smbcredentials --debuglevel=4
This gives a lot of output, the crucial output lines are included here:

Code: Select all

Domain=[CORP] OS=[Windows Server 2008 R2 Enterprise 7601 Service Pack 1] Server=[Windows Server 2008 R2 Enterprise 6.1]
 session setup ok
Connecting to 10.52.166.2 at port 445
 session request ok
Doing spnego session setup (blob length=136)
Notice the new magic IP that appeared in the "Connecting to real_file_server at port 445" statement. When I go back to basics using smbclient -L on that server I can see the share which eluded me for so long.

Thanks all for your input.

Post Reply