Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Problems mounting samba share with fstab

  1. #1
    Join Date
    Mar 2009
    Beans
    36
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Problems with samba credentials= in fstab

    I am trying to set it up so that my samba share is automatically mounted when I log in.

    I added this to my /etc/fstab:

    Code:
    //192.168.1.2/media /home/rj/Server/media cifs credentials=/root/smb/credentials,rw,iocharset=utf8,uid=1000,gid=1000 0 0
    When I type :

    Code:
    sudo mount -a
    I get :

    Code:
    wrong fs type, bad option, bad superblock on //192.168.1.2/media,
           missing codepage or helper program, or other error
           (for several filesystems (e.g. nfs, cifs) you might
           need a /sbin/mount.<type> helper program)
           In some cases useful info is found in syslog - try
           dmesg | tail  or so
    dmesg | tail gives me :

    Code:
    [ 1603.542098] CIFS VFS: No username specified
    [ 1603.542113] CIFS VFS: cifs_mount failed w/return code = -22
    my /root/smb/credentials file looks like :

    Code:
    username=(myusername)
    password=(mypassword)
    Where (myusername) and (mypassword) are my actual username and password

    However if I replace the credentials=/root/smb/credentials line in /etc/fstab with username=(myusername),password=(mypassword) it will mount the share. So something with the /root/smb/credentials file isn't right.

    Thanks for the help.
    Last edited by rodney757; March 13th, 2011 at 09:13 PM.

  2. #2
    Join Date
    Mar 2009
    Beans
    36
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Problems mounting samba share with fstab

    Anyone know how I can go about fixing this? Thanks

  3. #3
    Join Date
    Mar 2009
    Beans
    36
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Problems mounting samba share with fstab

    Has anyone had this problem before?

  4. #4
    Join Date
    May 2007
    Location
    NY's first capital
    Beans
    2,711
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Problems mounting samba share with fstab

    Well I have been wanting to do this..

    I'm gonna work through it with you to see if we get any differences.

    I noticed some how to's use .credentials for file name..... are you missing the "." for file name?

    What are the permissions for /root/smb/credentials?

    Most how to's put the .credentials directly in /root... any reason why you added the sub directory smb?

    Do you have your domain/workgroup listed in the credentials file?

    According to man page credentials can be listed like..
    Code:
    username=value
          password=value
          domain=value
    are we running same version?
    Code:
    mount.cifs -V
    mount.cifs version: 1.12-3.4.7


    EDIT; I had no problem using this setup "credentials=/root/smb/credentials", with the file formatted like above.
    Last edited by volkswagner; March 14th, 2011 at 01:50 AM.
    Nothing is ever easy, but if it is difficult you must be doing it wrong.

  5. #5
    Join Date
    Mar 2009
    Beans
    36
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Problems mounting samba share with fstab

    Quote Originally Posted by volkswagner View Post
    Well I have been wanting to do this..

    I'm gonna work through it with you to see if we get any differences.

    I noticed some how to's use .credentials for file name..... are you missing the "." for file name?

    What are the permissions for /root/smb/credentials?

    Most how to's put the .credentials directly in /root... any reason why you added the sub directory smb?

    Do you have your domain/workgroup listed in the credentials file?

    According to man page credentials can be listed like..
    Code:
    username=value
          password=value
          domain=value
    are we running same version?
    Code:
    mount.cifs -V
    mount.cifs version: 1.12-3.4.7


    EDIT; I had no problem using this setup "credentials=/root/smb/credentials", with the file formatted like above.
    I tried checking mount.cifs -V and it wasn't installed. I installed it and now it will mount using credentials= in the /etc/fstab file.

    I actually have my credentials file in /root/smb/credentials now. The reason it was there was because I was testing to see if it would work if it were in my home folder, since it wasn't working in the /root/smb/ dir.

    Its interesting that everything would mount fine before installing mount.cifs if I replaced:

    Code:
    credential=/path/to/credentials_file
    in /etc/fstab with:

    Code:
    username=<username>,password=<password>
    .

    I guess mount.cifs has to do with using a credentials file?

    Anyway's thanks for the help.

  6. #6
    Join Date
    Apr 2007
    Beans
    9

    Re: Problems mounting samba share with fstab

    Thanks for posting this. I was having the same problem and this fixed it as well. Not sure why cifs-utils is not automatically bundled with the rest of the cifs support.

  7. #7
    Join Date
    Jul 2008
    Beans
    45

    Re: Problems mounting samba share with fstab

    I had the same problem with the same error. I found that even if you have Samba installed you need to install smbfs.

    sudo apt-get install smbfs

    That did the trick. No more errors on sudo mount -a and my drive is mounted.

    This is a very good document:
    https://help.ubuntu.com/community/Mo...resPermanently

  8. #8
    Join Date
    Nov 2005
    Location
    Sydney, Australia
    Beans
    218
    Distro
    Ubuntu Studio 12.04 Precise Pangolin

    Re: Problems mounting samba share with fstab

    Thanks for that. I can now mount my Samba share in Ubuntu. However I cannot write to it?? Any ideas?
    Just think how boring life would be without Ubuntu

  9. #9
    Join Date
    May 2007
    Location
    NY's first capital
    Beans
    2,711
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Problems mounting samba share with fstab

    Quote Originally Posted by bayvista View Post
    Thanks for that. I can now mount my Samba share in Ubuntu. However I cannot write to it?? Any ideas?

    Did you copy the mount command from the original post? Perhaps your userID is not the same. If you are not the first installed user, you wont have uid=1000 as in the OP.

    Code:
    uid=1000,gid=1000
    You can find your UID from /etc/group

    Code:
    cat /etc/group | grep yourusername:
    Where is the share located, on a windows machine or a Linux box?

    What are the permissions and the owner:group for the share?

    Code:
    ls -l /share/mountoint
    Nothing is ever easy, but if it is difficult you must be doing it wrong.

  10. #10
    Join Date
    Nov 2005
    Location
    Sydney, Australia
    Beans
    218
    Distro
    Ubuntu Studio 12.04 Precise Pangolin

    Re: Problems mounting samba share with fstab

    Thanks for your prompt reply. My Windows machine is a WD MyBookWorld NAS storage. I can talk to it from a Windows PC running their proprietary software called WD Discovery. I have installed it on my home network and can attach it to my 2 Ubuntu PCs using both Places/Network and fstab. I can read and write to the 'Shared' folders and have successfully used rsync to copy folders from both PCs.

    I have always used rsync for backup and want to continue doing this. I can rsync my home folder OK but cannot rsync my wife's home folder. She is user 'pam'. I have tried using Webmin to setup a shared 'backups' folder. This works OK but only I can access it. When I try to copy her folders, I get 'Error while copying. You do not have permissions'

    I tried following your notes. My UID is 1000, Pam's is 1001. Our GID is 1000. Confirmed by the cat command. Could not understand the 'ls' command. If the share is called 'Shared Pictures' and it is mounted on /media/hp-nas, surely the command is "ls -l /media/hp-nas/'Shared Pictures'?". This works fine. I have pasted the output fo your comments.

    drwxrwxrwx 5 99 david 0 Mar 7 2012 acting
    drwxr-xr-x 3 99 david 0 Dec 5 17:00 Albert
    drwx------ 3 99 david 0 Dec 5 17:05 Books
    drwx------ 2 99 david 0 Dec 9 16:37 Concord houses
    drwx------ 4 99 david 0 Dec 5 16:53 Condoblin
    drwx------ 2 99 david 0 Dec 9 16:52 council
    drwxrwxrwx 3 99 david 0 May 7 2009 davids 60th
    drwx------ 5 99 david 0 Dec 5 16:39 dilys
    drwx------ 3 99 david 0 Feb 22 2011 Downloaded Albums
    drwxrwxrwx 8 99 david 0 Dec 9 16:38 Family Days
    drwx------ 33 99 david 0 Dec 5 17:17 Family History - Pam
    drwx------ 2 99 david 0 Oct 4 2011 For filing
    drwx------ 3 99 david 0 Dec 5 16:52 Groups
    drwxrwxrwx 11 99 david 0 Dec 5 17:24 Holidays & Outings
    drwxr-xr-x 3 99 david 0 Jul 13 2011 Important Documents
    drwxrwxrwx 4 99 david 0 Mar 7 2012 Norman St
    drwx------ 2 99 david 0 Mar 7 2012 Pam's 70th
    drwx------ 21 99 david 0 Aug 28 16:12 Picasa Exports
    -rwx------ 1 99 david 18569 Feb 12 2010 Picasa.ini
    drwx------ 5 99 david 0 Dec 5 17:21 Scrolls and Bushcare
    drwxrwxrwx 3 99 david 0 Mar 7 2012 Wildlife
    david@hp-desktop ~ $


    Many thanks. I'll keep plugging away.
    Just think how boring life would be without Ubuntu

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •