[solved] cifs mount suddenly changed to read only

[solved] cifs mount suddenly changed to read only

Postby magchris » Nov 30th, '21, 21:32

I use a Mageia 8 system to access a smb share. Suddenly the file system which is mounted using cifs is read only instead of read write for my normal user. I can still write files into the mounted file system if I use root.
The mount is defined in fstab. If I try to define a mount by the Mageia control center the server is shown but no further information and it is not possible to define something there.
The smb share is still writable by a Windows client.
I didn't any configuration changes and only applied the normal Mageia updates.
Does anybody have an idea what I can do to gain read write access again.
Last edited by magchris on Dec 1st, '21, 21:12, edited 2 times in total.
magchris
 
Posts: 20
Joined: Nov 19th, '17, 20:47

Re: cifs mount suddenly changed to read only

Postby doktor5000 » Nov 30th, '21, 23:21

And what is the output of e.g. mount command for that share? If you can write to it as root it's probably not mounted with the correct uid/gid.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: cifs mount suddenly changed to read only

Postby magchris » Dec 1st, '21, 08:54

Here the output of the mount command for this share (real names changed)
Code: Select all
//myserver/DataDir on /mnt/DataDir type cifs (rw,relatime,vers=1.0,cache=strict,username=myuser,uid=1000,noforceuid,gid=1000,noforcegid,addr=192.168.7.1,soft,unix,posixpaths,serverino,mapposix,acl,rsize=61440,wsize=65536,bsize=1048576,echo_interval=60,actimeo=1)


The entry in fstab:
Code: Select all
//myserver/DataDir /mnt/DataDir cifs credentials=/etc/samba/auth.myserver.myuser,uid=1000,gid=1000,vers=1.0 0 0


This has worked for years and now I "myuser" has only read access
magchris
 
Posts: 20
Joined: Nov 19th, '17, 20:47

Re: cifs mount suddenly changed to read only

Postby doktor5000 » Dec 1st, '21, 19:34

vers=1.0 ? That seems pretty ancient ... I'd remove that and try again. You could also check your journal logs for the parts where this share gets mounted, maybe that can provide some details.
You could also unmount it and mount it manually with mount -v /mnt/DataDir and see if that provides some more details on where it goes wrong.

I don't see any halfway recent bug reports about cifs, so this doesn't seem like some common issue.
Also, would be helpful if you could provide a partial ls -al output (anonymized) on the share contents to check the permissions, user and group on the mountpoint and what is inside.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: cifs mount suddenly changed to read only

Postby magchris » Dec 1st, '21, 21:11

If I remove vers=1.0 or change it to a higher version I get following error message:
Code: Select all
mount error: Server abruptly closed the connection.
This can happen if the server does not support the SMB version you are trying to use.
The default SMB version recently changed from SMB1 to SMB2.1 and above. Try mounting with vers=1.0.
mount error(112): Host is down
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

If I only use vers=1.0 the file system is mounted but user and group are always root for all files.

Finally I found the solution:
If I add the options
forceuid
and
forcegid
to the entry in fstab then user and group have the expected values.

Here the final entry in fstab which allows writing to the filesystem again
Code: Select all
//myserver/DataDir /mnt/DataDir cifs credentials=/etc/samba/auth.myserver.myuser,uid=1000,gid=1000,forceuid,forcegid,vers=1.0 0 0


@doktor5000 thank you for your hints :)
magchris
 
Posts: 20
Joined: Nov 19th, '17, 20:47


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest

cron