Manual mounting of cifs works fine, but not in fstab

8,052

Solution 1

Mine looks like this - with a credential file as mentioned above, but with some other explicit options.

//192.168.1.2/photos /media/photos cifs credentials=/home/[credentialfile],iocharset=utf8,sec=ntlm,file_mode=0777,dir_mode=0777,uid=[my userid],gid=[my groupid],nobootwait 0 0

Solution 2

Try it with a credential file. I had the same issue. Credential file worked like a charm.

Example for an fstab entry:

//192.168.1.100/music /media/Musik cifs credentials=/home/user/.smbcredentials 0 0

Solution 3

Try specifying your username and domain separately and without the single quotes:

domain=MYDOMAIN,user=myusername
Share:
8,052
Daniel Fischer
Author by

Daniel Fischer

Occasionally I try to twitter about my work and/or opinion @fischuu, otherwise, you can find me on GitHub. Other social media accounts from me are on LinkedIn, ResearchGate and my research output you can find at Google Scholar and Luke-webpage My ORCID is 0000-0002-7513-683X

Updated on September 18, 2022

Comments

  • Daniel Fischer
    Daniel Fischer over 1 year

    I have a mounting problem that drives me mad at the moment...

    Using the manual mounting command

    sudo mount -t cifs //192.168.1.1/shareName /media/shareName -o uid=1000,gid=1000,rw,username='domain/name',password=pw
    

    I am able to mount my network share without any problem. But then, when I include the line

    //192.168.1.1/shareName /media/shareName   cifs    uid=1000,gid=1000,rw,username='domain/name',password=pw   0   0
    

    into fstab and execute then the command

    sudo mount -a
    

    I receive the error message

    mount error(13): Permission denied
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
    

    When I restart the computer the boot process is as it should be without any errors, but the share isn't mounted.

    Does anybody know if this is a bug?! Or do I miss there something?

    Thanks for reading this...

    PS: I do not have any white spaces in the network share name or any 'weird' characters in the password. Also the cifs-utils are installed. The additional option users in the fstab didn't helped either. Of course I'll use later the credential file when the fstab entry works, at the moment I use the password in fstab just for testing purposes (and it didn't worked neither when I tried the credential file instead)...

    PPS: I use Kubuntu 12.10, but I hope this doesn't matter...

  • Daniel Fischer
    Daniel Fischer about 7 years
    My problem did not exist anymore (new installation), on the new computer I mounted them this way and it worked for me as well, so I accept this answer, to get this thread closed.