I'm trying to mount a smb network share in fstab on FreeBSD, which works fine for a share without spaces, but fails if a space is in the name. I have replaced the space with \040 which is what everything on google has said, but that didn't help.

Share name I'm trying to mount is "Data Backups".

Share name as written in fstab that doesn't work: //USERNAME@COMPUTER/Data\040Backups

Any suggestions?

  • May be semicolons? – TiFFolk Nov 18 '09 at 14:16
  • 1
    Have you tried backslash followed with a space, instead of Octal? – kmarsh Mar 9 '10 at 14:03


"//\040Movies" <- Did Work for mounting // Movies

  • Ubuntu != freeBSD ... in fact they arn't really the same family of *nix. – Zypher Jun 22 '10 at 1:03

Mmh, shouldn't that be something like the following in fstab? I cannot imagine Samba works much different on BSD's than it does on Linux:

//COMPUTER/"Data Backups" /mnt/share smbfs username=username,password=password 0 0

I'm not sure the "Data Backups" would work: you might just need to escape the space.

  • Man for mount_smbfs says to mount in fstab using the following example: //guest@samba/public /smb/public smbfs rw,noauto 0 0 So thats what I based it on. The username and mounting works when I use a different share name that has no space, so the syntax is good. The space is just what kills it. I've tried the following with no luck: "//USER@COMPUTER/Data Backups" //USER@COMPUTER/"Data Backups" //USER@COMPUTER/Data\ Backups //USER@COMPUTER/Data\040Backups I just can't think of anymore combinations to try out. – Blake Nov 18 '09 at 14:32
  • Create a share without space =). That share will link(make it) to "Data Backups". Users won't see any difference =). – TiFFolk Nov 18 '09 at 15:07
  • No access to the server itself, I can only work through the share as is. For now, I'm making a startup script to invoke "mount_smbfs" which does work with the space. If anyone knows of a way to make fstab work though, please feel free to share. – Blake Nov 18 '09 at 15:11

I don't think you can have spaces within a field of fstab. The format of the file is pretty simplistic, and its manpage mentions:

Each file system is described on a separate line; fields on each line are separated by tabs or spaces.

So you are pretty much stuck with a non-fstab solution if the name of the share is out of your control.


You should use %20 in place of spaces:


I don't really know if this works on all BSDs out there, as it was only tested on Mac OS 10.7.4. Hopefully it is close enough to use the same syntax.

I know I'm a little late to the party but it may be useful for someone in the future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy