Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 04-21-2004, 07:43 AM   #1
LQ Newbie
Registered: Apr 2004
Distribution: Slackware 9.1
Posts: 24

Rep: Reputation: 15
Can't automount smb with spaces

7 day newbie here. Spent ages searching the web, can't find an answer.

I have a small home network, my Linux box and a Win XP box. Some of the shared folders have spaces, some do not e.g.:
//XPComputer/My folder

From the Linux box I can see the shared folders on the Win box in several ways:
- I can use smbclient (with spaces, use "" around folder name)
- I can use smbmount (with spaces, use \ before space)
- I can use mount (in fstab, use \040 in place of space)
- I can use autofs, as long as the folder name has no spaces

Example of fstab, with spaces, that works with mount:
//XPComputer/My\040folder  /mnt/xpmyfolder   smbfs   noauto,user,guest 0   0
Example of map file, that works with autofs, without spaces
xpmyfold	-fstype=smbfs,username=guest,guest  ://XPComputer/Myfolder
But 'My folder' does not work in the last example.
I have tried:
- plain spaces
- Double quotes around the folder name
- Single quotes around the folder name
- Escaping the spaces i.e. \ then a space
- \040
In these cases there is a pause indicating that automounter is trying to do it's stuff, then it comes back with No such file or directory, which seems to be its generic error message.

If I do worse things, then it fails faster e.g. putting double quotes around the whole string "//XPComputer/My folder" causes a fast failure, with the same error message. From this I infer that at least in the other cases it is parsing the line and getting some sort of folder name (probably 'My'?).

Any ideas what I should do?
Old 04-21-2004, 09:32 AM   #2
Senior Member
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
mount -t smbfs //xpcomputer/My\ folder /mnt/xpmyfolder
Old 04-21-2004, 10:19 AM   #3
LQ Newbie
Registered: Apr 2004
Distribution: Slackware 9.1
Posts: 24

Original Poster
Rep: Reputation: 15
Originally posted by maxut
mount -t smbfs //xpcomputer/My\ folder /mnt/xpmyfolder
No, I can manually 'mount' OK, I have an fstab entry so I don't need the options on the mount command, but if I do, then I can use double quotes around the folder name (I'm sure escaping the space, as you suggest, would also work).

The problem is getting it to automount, which is a problem with spaces in the map file (in this example auto.myfolder) - and as I said in the post, I've tried escaping the space and that doesn't work.
Old 07-04-2006, 08:52 AM   #4
Registered: Oct 2005
Distribution: Urubu
Posts: 161

Rep: Reputation: 15
Same problem here. Any idea?
Old 09-27-2011, 10:45 AM   #5
LQ Newbie
Registered: Mar 2004
Location: belgium
Posts: 1

Rep: Reputation: 0
Lightbulb Use \ to quote the space

I hit this page having the same question unfortunately there was no answer here. After a lot of trial and error I found the solution.

You need to quote the space by adding a \ in front of it.
Simple really, it's a pity that it's different from /etc/fstab where you use \040 to represent a space.

On RedHat you can turn on debug logging to see what automount makes of your config by changing the LOGGING setting in /etc/sysconfig/autofs and a restart of autofs.

Look for a line like
automount[19389]: parse_mount: parse(sun): dequote("://hostname/a\ share\ name") -> ://hostname/a share name
in /var/log/messages

Looking back at the thread maxut already mentions this with a mount command


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
SMB: More then one Windows user/ smb account? 1veedo Linux - Networking 2 03-15-2005 05:16 PM
Automount network smb share with fstab phatboyz Linux - Networking 2 11-03-2004 01:05 PM
Creating a SSL connection from smb clients to a smb server scottpioso General 0 11-17-2003 03:33 PM
making smb shares viewable from smb client via web browser scottpioso General 3 11-10-2003 05:25 PM
automount nfs and smb al_erola Linux - Networking 2 04-27-2003 12:33 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:17 PM.

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