Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

Mount SAMBA NFS share folder on linux

By editor , 11 May, 2018
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

  • Shell
  • Linux
Create a CIFS - SAMBA Network Share on Linux
Mount and fstab on Linux

Comments

Plain text

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

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer