OSMC Samba Permission Issue Mac - SOLVED

Hello,

I am having an issue with Samba on my Raspberry Pi and Mac, I can view files and open them but I cannot write I am being presented with this error message “Items can’t be copied to “Movies” because you don’t have permission to read them.”.

Any help would be greatly appreciated.

Many thanks,

Did you use omsc for username and password when you connected to the share ?

Thanks for getting back, I did use osmc for both. Cheers

try putting the following into the global section of smb.conf

map to guest = Bad Password
guest account = root

and restart the samba service

service samba restart

GNU nano 2.2.6 File: /etc/samba/smb.conf

[global]
workgroup = WORKGROUP
#usershare allow guests = yes
#security=share
map to guest = bad password
guest account = root
security=user
follow symlinks = yes
wide links = no
unix extensions = no
lock directory = /var/cache/samba
load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
log level = 1
[osmc]
browsable = yes
read only = no

^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos
^X Exit ^J Justify ^W Where Is ^V Next Page ^U UnCut Text^T To Spell

Like this? If so no luck I’m afraid, thank you.

[osmc]
browsable = yes
read only = no
#guest ok = yes
valid users = osmc
path = /home/osmc

does your OSMC section look like this ? Try removing the # from Guest ok =yes line

I actually share the root directory like this (which give access to the OSMC directory anyway)

[rootfs]
comment = Public Folder
path = /
public = Yes
guest ok = Yes
browsable = Yes
read only = No

Apologies its still not working, I failed to mention that I am trying to write to an external disc drive. Thanks for your help again!

Can you access and write to the the root directory on the sd card using the settings above?? If so how are you mounting the external drive on the Rpi ?

Yes I can write to the SD card, it is USB mounted

if you ssh in (no idea about mac so dont know what you use) can you access and write to the usb drive, is it mounted using fstab?

I have ssh in I’ve tried to scp a file over to the device but permission denied, is this the correct procedure? I’m not sure if its mounted using fstab, how could I find that out? Apologies I’m relatively new to this.

what format is the external usb disk? I would assume that OSMC is mounting it automatically if you havent mounted it you could try to ssh in as root, this should get rid of permissions problems.

If you want to do that ssh in as usual then type “sudo passwd root” (without the quotes), type in a new password (for the root user twice) this should set up the root user

exit and then ssh in using user root and password (whatever you typed in above) and try scp again

Note if OSMC is mounting it automatically it should appear when you type ls /media after you ssh in
what do you get if you type in ls /media -l (lowercase L), you should see something like drwx------

The disk is not in HFS format is it ?

Ssh in and post the output of the mount command so we can see.

/dev/mmcblk0p2 on / type ext4 (rw,noatime,stripe=1024,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=177320k,nr_inodes=44330,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
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 /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=21,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/mmcblk0p1 on /boot type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
sysfs on /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq type sysfs (rw,nosuid,nodev,noexec,relatime)
/dev/sda1 on /media/EFI type vfat (rw,nosuid,nodev,noatime,sync,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,errors=remount-ro,uhelper=udisks)
/dev/sda2 on /media/FREESPACE type vfat (rw,nosuid,nodev,noatime,sync,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,errors=remount-ro,uhelper=udisks)
/dev/sda3 on /media/Media type hfsplus (ro,nosuid,nodev,noatime,sync,umask=22,uid=0,gid=0,nls=utf8,uhelper=udisks)
/dev/sda4 on /media/BACKUP type hfsplus (ro,nosuid,nodev,noatime,sync,umask=22,uid=0,gid=0,nls=utf8,uhelper=udisks)
/dev/sda5 on /media/WINDOWS type hfsplus (ro,nosuid,nodev,noatime,sync,umask=22,uid=0,gid=0,nls=utf8,uhelper=udisks)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=36316k,mode=700)

Is this what you are looking for?

I tried the scp with both osmc and root accounts.

This is the output of that command.

Cheers!

root@osmc:/media# ls /media -l
total 16
drwxrwxr-x 1 root root 15 Apr 17 15:19 BACKUP
drwx------ 2 osmc osmc 4096 Jan 1 1970 EFI
drwx------ 5 osmc osmc 8192 Jan 1 1970 FREESPACE
drwxrwxr-x 1 root root 12 Apr 17 14:21 Media
-rw-r–r-- 1 root root 232 Mar 6 12:34 README
drwxrwxr-x 1 root root 9 Apr 17 14:19 WINDOWS

As I suspected - these partitions are HFS+ (Mac OS format) and the ro at the beginning means they are mounted read only. This is why you can’t write to them.

I’m not 100% sure but I think Linux does not have Read/Write support for HFS+ partitions, or if it is possible somehow (maybe with Fuse) we don’t have that enabled in OSMC.

cc @sam_nazarko

Ah okay, so I should format them to fat32? Thanks!

If you want a media drive you can plug into Mac, Linux and Windows machines exFAT might be a good choice.

FAT32 will work but file sizes are limited to 4GB which is an issue with ISO files (which are bigger than 4GB typically) or really big rips, some of which exceed 4GB.

It does, but it can be very finickity about this.

Try umounting and fscking the disk. For some reason, every time you insert the disk in to a Mac you must fsck it before you can mount it rw.

if you want to leave it as HFS+ then this is worth a try

  1. sudo fsck.hfsplus -f /dev/sda3 (may not need this step)
  2. sudo apt-get install hfsplus hfsutils hfsprogs
  3. sudo mount -o force /dev/sda3 /media

:smile: