[systemd-devel] systemd automounter does not mount Window share containing a space

André Weidemann Andre.Weidemann at web.de
Wed Jun 16 11:12:48 UTC 2021


Hi,
I've been trying to mount a Windows share containing a space using 
mount.cifs via systemd automounter without success.
I placed mnt-data.mount and mnt-data.automount under 
/etc/systemd/system/ and put the Windows share path behind "What=" in 
the .mount file. Single or double quotes do not seem to work here, 
neither does escaping the space with a single backslash. Man page 
suggest replacing the space with its octal expression, which is \040. 
Using systemd-escape did not work either, which replaced the space by 
its hex expression \x20.
Mounting always fails like this:

Jun 16 09:16:49 client kernel: [ 8128.551627] CIFS: Attempting to mount 
//server.private.domain/path1/path\x20with\x20spaces
Jun 16 09:16:49 client mount[101952]: mount error(2): No such file or 
directory

If I mount the share by hand our put it into the fstab, it is working as 
long as the share path is enclosed in double quotes.

I'm working on Ubuntu 20.04 with systemd 245.4-4ubuntu3.6.

Here are my config files:

/etc/systemd/system/mnt-data.mount:
[Unit]
Description=dlsrc-00053

[Mount]
What=//server.private.domain/path1/path\x20with\x20spaces
Where=/mnt/data
Type=cifs
Options=vers=3.0,credentials=/root/.cifscredentials_User1


[Install]
WantedBy=multi-user.target


/etc/systemd/system/mnt-data.automount:
[Unit]
Description=Automount data
Before=remote-fs.target

[Automount]
Where=/mnt/data

[Install]
WantedBy=multi-user.target


Is this a bug, or am just doing it wrong?

Any help is greatly appreciated.

   André


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4496 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20210616/3eed43e4/attachment.bin>


More information about the systemd-devel mailing list