You are not logged in.

#1 2018-01-09 09:56:37

djipey
Member
Registered: 2011-07-30
Posts: 159

Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

Hi,

I have a problem with a Samba drive. I have this line in my fstab (it was working just fine before christmas holidays):

//scapa4.chem.gla.ac.uk/scapa4 /run/media/djipey/scapa4 cifs username=<login>,password=<password>,iocharset=utf8,sec=ntlm,x-systemd.automount,vers=1.0 0 3

When I run the mount command (sudo mount /run/media/djipey/scapa4), the drive is mounted correctly but I can access it only in read mode, I can't write on the drive.

When I mount the drive in nemo (https://wiki.archlinux.org/index.php/sa … nd_PCManFM), I have read and write access.

Could you please help me to sort this out ? I sometimes need to mount this drive when I'm connected by ssh on my machine.


Cheers

Last edited by djipey (2018-01-11 13:24:57)

Offline

#2 2018-01-09 15:16:06

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,056

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

nemo will use gvfs.
Compare the outputs of "mount" for each case. The difference should be telling.

Offline

#3 2018-01-09 15:28:51

djipey
Member
Registered: 2011-07-30
Posts: 159

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

Here is the ouput for "traditional" mount:

sudo mount -v /run/media/djipey/scapa4                                                                                                                                                                                                             
mount.cifs kernel mount options: ip=some.numbers,unc=\\scapa4.chem.gla.ac.uk\scapa4,iocharset=utf8,sec=ntlm,vers=1.0,user=user_name,pass=********

How do I mount it with gvfs ?

Offline

#4 2018-01-09 15:38:24

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,056

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

No, the output of literally "mount" - it prints mtab.

Offline

#5 2018-01-10 13:39:14

djipey
Member
Registered: 2011-07-30
Posts: 159

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

Ah ! Sorry.

Here you are:

proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=8150520k,nr_inodes=2037630,mode=755)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
/dev/sda5 on / type ext4 (rw,relatime,data=ordered)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
/dev/sda6 on /home type ext4 (rw,relatime,stripe=32745,data=ordered)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1631260k,mode=700,uid=1000,gid=1000)
//scapa4.chem.gla.ac.uk/scapa4 on /run/media/djipey/scapa4 type cifs (rw,relatime,vers=1.0,sec=ntlm,cache=strict,username=<username>,uid=0,noforceuid,gid=0,noforcegid,addr=130.209.221.109,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1,x-systemd.automount)

The drive is mounted with fstab, and also with nemo. But I don't see nay trace of "gvfs".

Offline

#6 2018-01-10 14:03:18

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,056

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

There's no difference?
That mount should be rw, you should be able to write on it. Sure it's not just a file permission issue? Can you "sudo touch /run/media/djipey/scapa4/touch.test"?

Offline

#7 2018-01-10 14:27:44

djipey
Member
Registered: 2011-07-30
Posts: 159

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

Ok this is weird. With sudo I can write on the disk, but not from my current user.

This is really weird because it wasn't like that before christmas, and I didn't change anything (but the NAS running the Samba drive did change though).

We are two Archlinux users in my lab and we both have the same problem.

The right of the directory is:

drwxr-xr-x 755 scapa4

should it be 775 ?

Offline

#8 2018-01-10 14:34:33

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,056

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

stat /run/media/djipey/scapa4
id

Offline

#9 2018-01-10 14:39:51

djipey
Member
Registered: 2011-07-30
Posts: 159

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

Stat:

  Fichier : /run/media/djipey/scapa4
   Taille : 0         	Blocs : 0          Blocs d'E/S : 16384  répertoire
Périphérique : 19h/25d	Inœud : 256         Liens : 2
Accès : (0755/drwxr-xr-x)  UID : (    0/    root)   GID : (    0/    root)
 Accès : 2017-12-20 20:12:20.652180200 +0000
Modif. : 2018-01-10 14:23:34.480854900 +0000
Changt : 2018-01-10 14:23:34.480854900 +0000
  Créé : -

id

uid=1000(djipey) gid=1000(djipey) groupes=1000(djipey),10(wheel),14(uucp),54(lock)

Offline

#10 2018-01-10 14:44:48

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,056

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

This is on the mounted path?
As you can see, only root may write there.
You could re-own it to eg. the wheel group (or any other group you add you and your co-worker to) and set it 775

Of course if you want to only write into a subdirectory of that path, fix permissions of that directory.
This is indeed about the NAS  (the permissions are mapped to your local system).

Offline

#11 2018-01-10 15:35:44

djipey
Member
Registered: 2011-07-30
Posts: 159

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

I did a "sudo chown :wheel /run/media/djipey/scapa4"

and a "sudo chmod 775 /run/media/djipey/scapa"

but it seems the right on this directory is still 755. What am I missing ?

Last edited by djipey (2018-01-10 15:59:37)

Offline

#12 2018-01-10 19:53:34

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,056

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

file_mode=0755,dir_mode=0755

dir_mode=arg
           If the server does not support the CIFS Unix extensions this overrides the default mode for directories

It would seem the NAS got limited here with its update? Can you chmod subdirs? Chown works?

Offline

#13 2018-01-11 10:27:52

djipey
Member
Registered: 2011-07-30
Posts: 159

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

I can't chmod 777 subdirs (well the command returns no error, but the permissions don't change), and chown doesn't work. Can I use something else than cifs in fstab to mount this drive ?

Offline

#14 2018-01-11 10:36:45

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,399

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

You could just specify the UID and GID of your user in the mount options, if you don't need more fine grained control.

Last edited by V1del (2018-01-11 10:42:26)

Offline

#15 2018-01-11 10:52:06

djipey
Member
Registered: 2011-07-30
Posts: 159

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

Yep, that works. Does it mean it will only be mounted for me (one gid/uid) ?

Offline

#16 2018-01-11 12:57:36

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,056

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

It especially means the server doesn't support file permissions.
You can use the uid/gid config to assign ONE user/group combination to everything and the file_mode/dir_mode parameter to control how that user and that group can access *every* file/directory on the share.

What exactly happened with the NAS? Do you have access to the SMB server config? Is the underlying filesystem NTFS (or FAT)?

Offline

#17 2018-01-11 13:24:31

djipey
Member
Registered: 2011-07-30
Posts: 159

Re: Fstab mount samba drive in read-only, nemo mounts it r/w (solved)

ok thanks for the explanation.

What happened to the NAS, I have no idea. I don't administrate it. I just know that it was changed during the holidays, but I don't know who did it or what he did hmm
I just know that its messy: we still use Samba 1.0 hmm

Offline

Board footer

Powered by FluxBB