LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-10-2013, 01:05 PM   #1
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Rep: Reputation: 7
Unable to mount Windows share containing whitespace


Hey all, I'm trying to mount a Windows share that contains white space and I'm not having any luck. Here's my mount command:

Code:
 mount -t cifs //Server1/Shares/Not Shared -o username=jobee,password=MyPass /mnt/Windows
I can mount my Shared share so permissions and such are all ok. I've tried enclosing the entire UNC path in quotes and worked my way down to just Not Shared. I've even used \040 instead of the white space but no joy. Googling this tells me people are using quotes or the \040 but they aren't working for me. Any ideas, suggestions or recommendations?

Thanks,

Joe B
 
Old 07-10-2013, 01:14 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
Quotes should work. Is your share actually called "Not Shared"? Because that's the default text in Windows for folders that are, well, not shared at all.

Does name resolution work? Does host server1 return server1's IP address?

Does ping server1 work?

What's the exact error message you're seeing? Are there any CIFS-related errors in the logs? (Try dmesg | tail)
 
Old 07-10-2013, 04:41 PM   #3
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Original Poster
Rep: Reputation: 7
Hi Ser Olmy, here's what I'm seeing with your suggestions:

Quote:
Originally Posted by Ser Olmy View Post
Quotes should work. Is your share actually called "Not Shared"? Because that's the default text in Windows for folders that are, well, not shared at all.
Yes, it's actually called "Not Shared." Mount can see it because if I remove "Shares" from the path I get a "No such device or address" error message.

Quote:
Originally Posted by Ser Olmy View Post
Does name resolution work? Does host server1 return server1's IP address?
Name resolution works fine; host returns the IP address.

Quote:
Originally Posted by Ser Olmy View Post
Does ping server1 work?
Pinging the server works just fine too.

Quote:
Originally Posted by Ser Olmy View Post
What's the exact error message you're seeing?
That's part of my problem -- there are no error messages. I type in the mount string, hit ENTER and all I see is a carriage return. When I pull an ls -l on the mounted share there's nothing there.

Quote:
Originally Posted by Ser Olmy View Post
Are there any CIFS-related errors in the logs? (Try dmesg | tail)
Ah yes, here's the error:

Code:
[ 4614.787833]  CIFS VFS: cifs_mount failed w/return code = -6
I checked and that error message is related to incorrect syntax. I kinda figured that part out.

Any other ideas?

Thanks,

Joe B
 
Old 07-10-2013, 04:59 PM   #4
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 912

Rep: Reputation: 174Reputation: 174
The \040 is an ASCII space character in octal (32 in decimal, 20 in hexadecimal). I haven't tried it, but I found mention of it on a google search. It was for a mount in fstab.


EDIT:
I figured it out. For a command line mount, just escape the space normally. In other words, just put a backslash in front of the space:

Code:
 mount -t cifs //Server1/Shares/Not\ Shared -o username=jobee,password=MyPass /mnt/Windows

Last edited by Z038; 07-10-2013 at 05:16 PM. Reason: figured out how to do it
 
Old 07-10-2013, 05:15 PM   #5
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
I actually asked a rather stupid question about the share name in my last post, since you're not actually mounting a share called "Not Shared", but a subfolder under a share called "Shares". And it does not matter one iota whether that folder is shared or not, as long as the parent folder is.

I've just done a little testing, and I can confirm that:
  • the cifs subsystem is capable of mounting subfolders (at least in kernel 3.9.9 with a reasonably new cifs-utils package)
  • you can have spaces in the mount path as long as you use quotes ("\\Server\Share\name with whitespace") or escape it with a backslash
So, given that name resolution works and the correct permissions are set on the share and the folder, this most definitely should work:
Code:
mount -t cifs "//Server1/Shares/Not Shared" -o username=jobee,password=MyPass /mnt/Windows
What does mount.cifs -V report? And which kernel version are you running?

Last edited by Ser Olmy; 07-10-2013 at 05:16 PM.
 
Old 07-10-2013, 06:19 PM   #6
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Original Poster
Rep: Reputation: 7
Z038, thanks but escaping the space with the backslash didn't work.

Ser Olmy, mount.cifs -V give me:

Code:
root@srvBackup:/home/jobee# mount.cifs -V
mount.cifs version: 4.5
Thanks,

Joe B
 
Old 07-10-2013, 06:20 PM   #7
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Original Poster
Rep: Reputation: 7
Oh yeah, the kernel version:

Code:
root@srvBackup:/home/jobee# uname -a Linux srvBackup 2.6.32-5-686 #1 SMP Fri May 10 08:33:48 UTC 2013 i686 GNU/Linux
Thanks,

Joe B
 
Old 07-10-2013, 06:33 PM   #8
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
That's a slightly old kernel, and your cifs-utils (mount.cifs et al) package is a major version behind the one I'm using, 5.5.

I can't say definitely that either the kernel or cifs-utils are causing this problem, but I can say that I'm not having any trouble mounting a subfolder with a name containing spaces using version 5.5 of cifs-utils and a recent kernel.

The syntax-related error message in the log seems to point in the direction of cifs-utils. If a more recent package is available for your distribution, you could try upgrading.
 
1 members found this post helpful.
Old 07-11-2013, 01:30 PM   #9
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Original Poster
Rep: Reputation: 7
Thanks Ser Olmy, I'll give it a shot and see what happens.

Thanks,

Joe B
 
Old 07-11-2013, 02:50 PM   #10
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Original Poster
Rep: Reputation: 7
Thank you Ser Olmy! I did your recommended upgrades for my cifs.utils and my kernel and my mount command (using quotes) is working fine now.

Thanks for the help,

Joe B
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to mount Windows share using cifs to my virtual instance of SUSE nick[GEGN] Linux - Desktop 3 08-26-2010 10:29 AM
Unable to mount Windows share to SUSE 11.3 nick[GEGN] Linux - Newbie 1 08-13-2010 05:39 PM
NFS mount of smb mount of windows share: permission denied problem :( Bagatur Linux - Networking 4 07-07-2009 11:34 AM
unable to mount windows share when i try to access files vinaytp Linux - Newbie 5 04-27-2009 11:35 PM
mount windows share export to samba share -> improve network performance tuning newuser77 Linux - Server 1 07-23-2008 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration