I have a cifs share connectin a windows folder to a debian machine, however I cannot get it to mount on boot using fstab. I have the credentials stored in a file with 600 permissions.

//     /root/wowcher   cifs    credentials=/root/.smbcredentials,iocharset=utf8,sec=ntlm      0       0

The credentials are saved like this:


Is there anything obvious I am doing wrong? The share works if I manually mount it.

  • "Manually" means without fstab? or just sudo mount /root/wowcher? If the latter works then your problem may be because network is unavailable when this fstab entry is parsed. Does your Debian use systemd? Aside from this: have you considered autofs? – Kamil Maciorowski Aug 25 '17 at 15:44
  • Manually is either: mount -t cifs // /root/wowcher -o username=user,password=pass. Or if i just run mount -a – Edward144 Aug 25 '17 at 15:46
  • What does the appropriate fstab line read? I postulate the 4th field is wrong (does it say auto,defaults or something else?) – davidgo Aug 25 '17 at 15:50
  • @davidgo The fstab line is what I have posted above in the code box. I don't have auto default or anything else – Edward144 Aug 25 '17 at 15:52
  • If mount -a works then I think the entry is OK. I suspect you should delay mounting until your network is up. Are you sure this is not the issue? – Kamil Maciorowski Aug 25 '17 at 15:55

The issue is you do not have "auto" in the options field of fstab, so it's not automatically mounting. Add",auto" to the end of the 4th field and that should fix it.

Mount -a will mount files without this flag, but they won't mount during startup.


You must add those two options:

  • auto (as stated by @davidgo) for this mount point to be loaded upon startup
  • _netdev for boot script to wait network before loading it

You can also add few more speed and safety options like relatime,nodev and maybe nosuid,noexec.

See man mount for available options.

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.