# Space in Samba sharename



## balanga (Feb 9, 2018)

I'm having a problem trying to mount a samba sharename which has an embedded space...

I can mount it from the command line by using quotes, ie

`mount_smbfs -I 192.168.1.100 'user@//SAMBASERVER/share name/'   /mnt`

but I'm trying to mount the share at boot time by adding an entry to /etc/fstab and using quotes does not work. 

Any suggestions?


----------



## rigoletto@ (Feb 9, 2018)

Try using %20 for the space.


----------



## usdmatt (Feb 9, 2018)

The suggestions for Linux from a quick Google seem to work, at least for the mount path.

https://stackoverflow.com/questions/15316017/how-do-i-specify-a-label-path-with-spaces-in-etc-fstab


```
root@test:/home/matt/vm-bhyve # cat /etc/fstab
/dev/md0        /test\040dir    ufs     rw      0       0
root@test:/home/matt/vm-bhyve # mount /dev/md0
root@test:/home/matt/vm-bhyve # mount |grep md0
/dev/md0 on /test dir (ufs, local)
root@test:/home/matt/vm-bhyve #
```


----------



## balanga (Feb 9, 2018)

lebarondemerde said:


> Try using %20 for the space.


I get Authentication error... which is an improvement on syntax error, so I guess that problem is fixed...

The share was supposed to be accessible by guest, so I didn't think it needed a password.


----------



## rigoletto@ (Feb 9, 2018)

I've not used samba since years but IIRC there were some changes making it more "difficult" (or more specialized) to mount without password.

The Arch Linux WIKI should have something about that.


----------



## aragats (Feb 9, 2018)

IMO it's easier to setup your password in /etc/nsmb.conf instead of fighting with samba for passwordless access.
Here what I have (to access my BlackBerry phone, but that doesn't matter):
/etc/nsmb.conf:
	
	



```
....
[BB-SM]
addr=<IP address or host name>

[BB-SM:myusername]
password=<mypassword>
```
/etc/fstab:
	
	



```
....
//MYUSERNAME@BB-SM/REMOVABLE_SDCARD    /mnt/bb   smbfs   rw,noauto   0 0
```
AFAICR the capitalization is important, maybe I'm wrong, but don't want to touch something which perfectly works for years.


----------

