Results 1 to 3 of 3

Thread: Struggling to automounting a network drive

  1. #1
    Join Date
    Apr 2008
    Beans
    100

    Struggling to automounting a network drive

    So I've followed the instructions for mounting for auto mounting my network drive in fstab, that i found https://wiki.ubuntu.com/MountWindowsSharesPermanently

    However I keep getting an error
    mount: /etc/fstab: parse error at line 11 -- ignored

    And im guessing that is because the Window share im trying to automount has a space in it, the fstab entry is as below
    //192.168.0.115/Media PC /media/share cifs credentials=/home/laptop/.smbcredentials,iocharset=utf8,sec=ntlm 0 0

    I have created the credentials, but on the odd chance i didn't I also tried to enter this entry into fstab but still get the same error
    //192.168.0.115/Media PC /media/share cifs username=Media,password=*********,iocharset=utf8,s ec=ntlm 0 0
    (obviously i've blanked my real password)

    I can access the share perfectly through Caja but who wouldn't want it all just to work automatically.

    Anyone have any ideas where im going wrong?
    Last edited by yusuo85; 4 Weeks Ago at 11:05 AM.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Struggling to automounting a network drive

    Your guess is correct. Don't allow spaces anywhere in mounts. Use an '_' instead. Spaces are always troublesome in file systems, so the simple answer is DON'T USE THEM.

    Also, I really hope that the remote mount doesn't need sec=ntlm - that is a security failure for the last few years.
    I use these options to access Win7 shares:
    Code:
    iocharset=utf8,rw,vers=2.1,uid=thefu,gid=thefu,file_mode=0660,dir_mode=0770
    in addition to having a credentials file.
    Win8 and later can support newer, faster, CIFS mounts.

  3. #3
    Join Date
    Dec 2009
    Beans
    6,530

    Re: Struggling to automounting a network drive

    Spaces in the name of things in fstab need to be replaced with the following characters:
    Code:
    \040
    That is a zero4zero

    So the line would look like this:
    //192.168.0.115/Media\040PC /media/share cifs credentials=/home/laptop/.smbcredentials,iocharset=utf8,sec=ntlm 0 0
    And what version of Ubuntu are you using because by default the Linux kernel in 20.04 for example starts with a version of the smb dialect that is incompatible with sec=ntlm.

    Either add vers=1.0 to your list of options together with sec=ntlm or just remove sec=ntlm. So possible options would be:
    //192.168.0.115/Media\040PC /media/share cifs credentials=/home/laptop/.smbcredentials,iocharset=utf8,vers=1.0,sec=ntlm 0 0
    OR:
    //192.168.0.115/Media\040PC /media/share cifs credentials=/home/laptop/.smbcredentials,iocharset=utf8 0 0
    And I agree that unless you only want read access to this share you will need to - at a minimum - take possession of the mount by adding a uid=your-linux-user-name whatever that is.
    Last edited by Morbius1; 4 Weeks Ago at 10:12 PM.

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
  •