SvennD
November 9, 2016

cifs mounts with spaces in /etc/fstab on Centos 6

Posted on November 9, 2016  •  1 minutes  • 83 words  •  Suggest Changes

Quick hack, when adding cifs to /etc/fstab you can’t use quotes to bridge a space in Linux; this will fail :

"//SERVER/NAME WITH SPACE/" /local_share/  cifs  username=user,password=paswd,iocharset=utf8,sec=ntlm  0  0

that tricks works in shares from cmd :

mount -t cifs -o user=user,pass=pasw "//SERVER/SHARE WITH SPACE/" /local/share

so for /etc/fstab, you have to use \040 which unsurprisingly maps to space in octal. Well another thing learned! Here is what should work in /etc/fstab

//SERVER/SHARE\040WITH\040SPACES/ /local/share/  cifs  username=user,password=paswd,iocharset=utf8,sec=ntlm  0  0

Happy mounting Windows shares 🙂

 

Support

If you enjoyed this website, consider buying me a Dr. Pepper

Buy me a Dr PepperBuy me a Dr Pepper