Mount SAMBA NFS share folder on linux | Drupal 8

Mount SAMBA NFS share folder on linux

Submitted by editor on Fri, 05/11/2018 - 09:51

How to access to a SAMBA shared folder from linux (ubuntu, debian, mint ...) ?
How to mount samba partition on linux ?

Access to a SAMBA file share from a file explorer

Juste enter the address of your share like:
smb://<IP or HOST>/<Folder>

Mount samba folder from terminal via shell command

Hear, for the example, we weill mount smb:// to /media/DATA
NOTE : The folder /media/DATA must exist (mkdir /media/DATA)

Example 1:
sudo mount -t cifs // -o username=USER,password=SAMBA-PASSWORD,iocharset=utf8,file_mode=0777,dir_mode=0777, /media/DATA
Example 2: mount as user=me
sudo mount -t cifs // -o username=USER,password=SAMBA-PASSWORD,uid=me,gid=me,iocharset=utf8,file_mode=0777,dir_mode=0777, /media/DATA

Mount samba share automatically on boot of linux (CIFS)

Edit the file /etc/fstab and add your share (nano /etc/fstab)

Example 1 :
// /media/DATA/ cifs nofail,rw 0 0
Example 2 :
// /media/DATA/ cifs nofail,rw,guest,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm 0 0
Example 3 : with User and Password via
// /media/DATA/ cifs nofail,rw,guest,iocharset=utf8,file_mode=0777,dir_mode=0777,auto,users,credentials=/root/data/.smbcred 0 0

Then create file /root/data/.smbcred and enter the user name/Password like :



Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.