Mounting samba share in using fstab

17,534

The entry in fstab is not a command; don't include the sudo mount portion.

Instead, make the line look something like

//192.168.1.5/my/folder /home/mounts/localmount cifs rw

A similar thread over at UbuntuForums has more good information about further options, if you need login credentials, special encoding, or other permissions settings.

Share:
17,534

Related videos on Youtube

Sparky
Author by

Sparky

Hakuna Matata

Updated on September 18, 2022

Comments

  • Sparky
    Sparky over 1 year

    I tried to mount a samba share from the local network to a folder in my PC. I added the following line in fstab

    sudo mount -t cifs //192.168.1.5/my/folder/ /home/mounts/localmount/
    

    But when I do sudo mount -a, it gives the following error:-

    [mntent]: line 13 in /etc/fstab is bad
    

    Can anyone tell me what I did wrong? I'm on Ubuntu 12.10, so sudo smbmount //hostname/sharename ~/mounts/sharename -o user=username wont work [source]

  • Sparky
    Sparky over 11 years
    Thanks :) I added the following line and it worked //192.168.1.5/my/folder /home/mounts/localmount cifs user=admin,password=123,rw,iocharset=utf8,uid=1000,gid=1000 0 0