Linux, Samba Spaces in Share Names

Yesterday i had to reconfigure the samba server at the office. And at the same time change some of the share names we’ve been using. One of the new names contained a space. And while setting this up on all Windows boxes i noticed no problem.

After all was finished i went to edit my fstab file so i get the new shares at boot. And after making changes to fstab i always do a simple test

sudo mount -a

This resulted in a syntax error from the fstab file

mntent: line 13 in /etc/fstab is bad

That’s nice. So Linux doesn’t like spaces in the share names. How strange :) So i tried a few escaping sequences.

  • ‘samba share’
  • “samba share”
  • samba\ share

Non of that seemed to work. So after a bit of searching found the solution. You can use an octal number format to express the ASCII symbol. In this case that’s ‘040’. And escape it with a slash.


comments powered by Disqus