Tag Archives: mount

Network drives without samba [cifs]

Samba is useful but many programs are not able to handle SMB protocol (eg notepadqq, geany, atom etc).

A more compatible way to use network drives is to map them with mount_cifs to a local path. Then all programs will be able to handle files from the network drives. However only root can mount file systems by default then the users may only use them in read only mode.

So what you have to do is mount it with sudo but define a specific user id

Method 1 – without fstab

This will only work for the current session.

Firstly, find the user id you are using via the command:

id

Then mount the filesystem with the following command:

sudo mount.cifs -o rw,username=bob,password=bobpass,uid=<id> //server.local/path /mnt/d

Method 2 – Using fstab

If you want to have the drives mapped after each reboot then:

  1. chmod +s /sbin/mount.cifs
  2. chmod +s /sbin/umount.cifs
  3. chmod 600 /etc/fstab

Now for each share do the following:

  1. mkdir localpath
  2. vim /etc/fstab
  3. add the following line:

//computer/share /localpath cifs user=sambausername,pass=sambapassword,rw,users 0 0

And you are ready.

reference: https://www.suse.com/communities/blog/mounting-windows-share-linux-file-system/