1

I want to mount share with /etc/systemd/system
File : mnt-win7_docs.mount

Content :

[Unit]
Description=Mount docs

[Mount]
What=//192.168.1.5/docs/
Where=/mnt/win7_docs/
Type=cifs
Options=user,username=<user>,password='<passwd>',iocharset=utf8

[Install]
WantedBy = multi-user.target

When I try systemctl start mnt-win7_docs.mount

I have the following error :

mnt-win7_docs.mount - Mount docs
   Loaded: loaded (/etc/systemd/system/mnt-win7_docs.mount; enabled)
   Active: failed (Result: exit-code) since mar. 2016-09-06 14:59:00 CEST; 2s ago
    Where: /mnt/win7_docs
     What: //192.168.1.5/docs/
  Process: 36306 ExecMount=/bin/mount -n //192.168.1.5/docs/ /mnt/win7_docs -t cifs -o user,username=<user>,password='<passwd>',iocharset=utf8 (code=exited, status=32)

sept. 06 14:59:00 dtools mount[36306]: mount error(13): Permission denied
sept. 06 14:59:00 dtools mount[36306]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
sept. 06 14:59:00 dtools systemd[1]: mnt-win7_docs.mount mount process exited, code=exited status=32
sept. 06 14:59:00 dtools systemd[1]: Failed to mount Mount docs
sept. 06 14:59:00 dtools systemd[1]: Unit mnt-win7_docs.mount entered failed state.

But when I try : /bin/mount -n //192.168.1.5/docs/ /mnt/win7_docs -t cifs -o user,username=<user>,password='<passwd>',iocharset=utf8.
It's ok ...

Do you have some ideas ?

migrated from stackoverflow.com Sep 7 '16 at 14:18

This question came from our site for professional and enthusiast programmers.

1

Finally, it's works.
The problem should come from special characters in the password.

Now I have :

[Unit]
Description=Mount docs

[Mount]
What=//192.168.1.5/docs/
Where=/mnt/win7_docs/
Type=cifs
Options=user,credentials=/root/.credentials,iocharset=utf8

[Install]
WantedBy = multi-user.target

/root/.credentials

username=<user>
password=<password>

So, password without simple quote.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.