Mount Samba share at boot

On Linux Mint 22 I can use the file manager to mount a samba share directory, adding the username and password which are different to my machine user. When I access that share I can read / write.

Now when I try to automount this boot by editing the fstab file, it comes up but I can only read and not write. In Linux Mint the owner of the share comes up as root.

There are solutions all over the internet, however, I haven’t identified what I’m doing wrong.

My entry in the fstab file look like this:
//192.168.20.201/tray01 /media/tray01 cifs credentials=/home/websurfer/.smbcredentials, uid=websurfer 0 0

Any ideas ?

can user websurfer write to /media? (perms of /media)

I have both uid and gid, my username is user, I created a dir called share in my home dir.

//truenas/share /home/user/share cifs guest,uid=user,gid=user,auto 0 0

That’s a good point, the owner of /media is root, tried creating a directory with websurfer as the owner but the samba share won’t mount.

create a dir, tray in your home dir and adjust your fstab as
//192.168.20.201/tray01 /home/websurfer/tray cifs guest,uid=websurfer,gid=websurfer,auto 0 0

sudo mount -a should mount tray with rw perms.

If you want to use /media, give it 777 so that everyone including websurfer can rw.

Finally got the following to work:

//192.168.20.201/tray01 /media/tray01 cifs credentials=/home/websurfer/.smbcredentials,_netdev,uid=websurfer 0 0

thanks for the steer :smile:

the flag _netdev waits until network is up, then executes fstab. Well done.

haha it has taken me literally years to get this to work !

Judging by the internet many are in the same position.

Thanks @pavlos for your help. I had been struggling to get smb shares mounted r/w on Linux Mint. Now working thanks to your tip.