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
Question

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>
Example:
smb://192.168.0.1/DATA
smb://192.168.0.1/

Mount samba folder from terminal via shell command

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

Example 1:
sudo mount -t cifs //192.168.0.1/DATA -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 //192.168.0.1/DATA -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 :
//192.168.0.1/DATA /media/DATA/ cifs nofail,rw 0 0
Example 2 :
//192.168.0.1/DATA /media/DATA/ cifs nofail,rw,guest,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm 0 0
Example 3 : with User and Password via
//192.168.0.1/DATA /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 :

username=me
password=myPassword
domain=WORKGROUP

Tags

Add new comment