Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
144
rated 0 times [  144] [ 0]  / answers: 1 / hits: 330908  / 1 Year ago, sat, april 1, 2023, 3:26:36

I am a little confused on the proper fstab entry for a samba share in Ubuntu 12.04




  • I can get the drive to mount manually by using:



    sudo mount -t cifs //192.168.2.2/raid_drive /mnt/homeserver -o username=jon,password=password

  • So I tried putting this in fstab:



    //192.168.2.2/raid_drive /mnt/homeserver cifs username=jon,password=password,iocharset=utf8,mode=0777,dir_mode=07‌​77 0 0

  • Which gives me this error in syslog:



    kernel: [ 2217.925354] CIFS: Unknown mount option mode
    kernel: [ 2217.936345] CIFS VFS: default security mechanism requested. The default security mechanism will be upgraded from ntlm to ntlmv2 in kernel release 3.3

  • This guide says to use smbfs although I believe smbfs is deprecated?




What is a common fstab configuration for a samba share in Ubuntu 12.04?



EDIT:



Using the accepted answer below I was initially getting this error message (from dmesg):



[   45.520883] CIFS VFS: Error connecting to socket. Aborting operation
[ 45.520990] CIFS VFS: cifs_mount failed w/return code = -115


although it turns out this was due to network connectivity issues, and not related to improper fstab entry.


More From » mount

 Answers
3

I've been through exactly this same issue this morning with 12.04 and here's how I got it working:



Install cifs-utils Install smbfs (even if you already have Samba and related packages installed):



sudo apt-get install cifs-utils


Edit /etc/fstab and add your entry:



//server/share /pathto/mountpoint cifs credentials=/home/username/.smbcredentials,uid=shareuser,gid=sharegroup 0 0


Create the .smbcredentials file in your home directory:



username=shareuser
password=sharepassword
domain=domain_or_workgroupname


Make sure you secure your ~/.smbcredentials file:



chmod 0600 ~/.smbcredentials


Finally, test the mount with:



sudo mount -a


...and you should be good to go!


[#37217] Sunday, April 2, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tionpromoti

Total Points: 14
Total Questions: 112
Total Answers: 113

Location: Tonga
Member since Tue, Nov 30, 2021
2 Years ago
;