0

When I try to write to a network CIFS drive I consistently get

~/RetroPie/roms $ touch test
touch: cannot touch 'test': Permission denied

The network drive is an LVM volume mounted on one raspberry pi as so:

pi@Pi4:~$ cat /etc/fstab
/dev/mapper/mediaFiles-mediaFilesLV  /media/lvm       ext4    defaults          0        2 

With these permissions

pi@Pi4:~$ ls -lh /media/lvm/
drwxr-xr-x  32 pi pi 4.0K Sep  4 18:26 roms

It's shared via samba with the following /etc/samba/smb.conf:

[global]
# Basic Samba configuration
server role = standalone server
passdb backend = tdbsam
;obey pam restrictions = yes
security = user
;printcap name = /dev/null
;load printers = no
;socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=524288 SO_SNDBUF=524288                                              
server string = Samba Server %v
map to guest = bad user
;dns proxy = no
;wide links = yes
;follow symlinks = yes
;unix extensions = no
;acl allow execute always = yes
log file = /var/log/samba/%m.log
max log size = 1000
log level = 2
mdns name = mdns
ea support = yes

# Special configuration for Apple's Time Machine
vfs objects = catia fruit streams_xattr
fruit:aapl = yes
fruit:model = MacSamba
fruit:encoding = native

[PiMedia]
comment = Pi4 shared folder
path = /media/lvm
read only = no
guest ok = yes
only guest = yes

I then mount it on another raspberry pi with systemd

pi@RemotePi:~ $ cat /etc/systemd/system/home-pi-RetroPie-roms.mount 
[Unit]
Description=ROMs folder

[Mount]
What=//Pi4.local/PiMedia/roms
Where=/home/pi/RetroPie/roms
Type=cifs
Options=rw,file_mode=0777,dir_mode=0777,uid=1000,gid=1000,guest,noperm,noauto,x-systemd.automount,x-systemd.mount-timeout=30,_netdev

[Install]
WantedBy=multi-user.target

And it looks like the permissions are fine

pi@RemotePi:~ $ ls -lh /home/pi/RetroPie/roms/
total 0
drwxrwxrwx 2 pi pi 0 Sep  4 17:26 amstradcpc
drwxrwxrwx 2 pi pi 0 Sep  4 17:26 arcade
drwxrwxrwx 2 pi pi 0 Sep  4 17:26 atari2600
drwxrwxrwx 2 pi pi 0 Sep  4 17:26 atari5200
drwxrwxrwx 2 pi pi 0 Sep  4 17:26 atari7800
...

But when I try to write

pi@RemotePi:~ $ touch RetroPie/roms/test
touch: cannot touch 'RetroPie/roms/test': Permission denied

It won't let me.

Where have I gone wrong?

1
  • Not sure, but you could try to supply samba username and password for mounting the share. Commented Sep 5, 2021 at 18:12

1 Answer 1

0

I think you need to define what Unix user to use as the guest account. By default this is nobody. Add to the global section

 guest account = pi

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.