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/Myfolder //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: Code:
//XPComputer/My\040folder /mnt/xpmyfolder smbfs noauto,user,guest 0 0 Code:
xpmyfold -fstype=smbfs,username=guest,guest ://XPComputer/Myfolder 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? |
try:
mount -t smbfs //xpcomputer/My\ folder /mnt/xpmyfolder |
Quote:
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. |
Same problem here. Any idea?
Thanks, |
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 Code:
automount[19389]: parse_mount: parse(sun): dequote("://hostname/a\ share\ name") -> ://hostname/a share name Looking back at the thread maxut already mentions this with a mount command |
All times are GMT -5. The time now is 09:14 AM. |