Samba Sharing -Folder Permissions issue - Raspbian

Navigate to either /disks/plex1 or plex2, run ls -l and show the output here, please. The last commands (chown -R …) should have taken care of ownership recursively, but it’s possible I missed something. Or that the sub-directories’ permissions are different.

[Edit]
Also, do you mean you can write to those directories locally on the Pi, or from the Mac via SMB? Or both?

So in both cases (locally on the Pi and Mac via SMB), I can only write to /disks.
I cannot write to any subfolders (plex1, plex2 or any of the other subfolders within plex1 or plex2).

Here is the output of ls -l from /disks/plex1

drwxr-xr-x 1 99 99 10 Sep 28 17:52 ‘Live Shows’
drwxr-xr-x 1 99 99 180 Dec 29 22:46 Movies
drwxr-xr-x 1 99 99 6 Dec 18 21:02 ‘TV Shows’

and /disks/plex2.

drwxr-xr-x 1 99 99 3 Jan 15 2017 Documentaries
drwxr-xr-x 1 99 99 438 Dec 29 22:40 Movies
drwxr-xr-x 1 99 99 5 Dec 27 20:54 ‘TV Shows’

It doesn’t look as though ownership was set to ‘pi’ for those directories. Did these commands complete successfully?

sudo chown -R pi:pi /disks/plex1
sudo chown -R pi:pi /disks/plex2

Perhaps run them again, and then provide the output of running ls -1 in:
/disks
/disks/plex1
/disks/plex2

It should show ‘pi’ in all the places it currently shows ‘99’ above.

I re-ran the commands and they seem to have completedfine. It lists all of the files and there were no errors.
Here’s an example of one line of output:

chown: changing ownership of ‘/disks/plex2/Movies/Robin.Hood.1973.1080p.BluRay.H264.AAC-RARBG.mp4’: Read-only file system

Here is what is outputted when I run ls -l in each folder
They are still showing 99. However, the /disks folder shows root

/disks/

drwxrwxr-x 1 root root 16 Dec 18 19:52 plex1
drwxrwxr-x 1 root root 16 Jan 5 16:59 plex2

/disks/plex1

drwxr-xr-x 1 99 99 10 Sep 28 17:52 ‘Live Shows’
drwxr-xr-x 1 99 99 180 Dec 29 22:46 Movies
drwxr-xr-x 1 99 99 6 Dec 18 21:02 ‘TV Shows’

/disks/plex2

drwxr-xr-x 1 99 99 3 Jan 15 2017 Documentaries
drwxr-xr-x 1 99 99 438 Dec 29 22:40 Movies
drwxr-xr-x 1 99 99 5 Dec 27 20:54 ‘TV Shows’

It’s this bit which is the issue, and is caused by hfsplus being mounted read-only. This is one of the issues I was referring to earlier. If you don’t add ‘force’ to your mount options, hfsplus file systems will be mounted read-only even if you include ‘rw’. Also, any errors with the volume can cause it to mount read-only as well (e.g. it was not unmounted cleanly).

So:

  1. Ensure you have added ‘force’ to your mount options for the disks in /etc/fstab.
  2. Run sudo fsck.hfsplus /dev/sdXY on the disks to check for errors. Replace X and y with the disk and partition of the volume in question (this can be found by running lsblk). If it finds issues, run it again with the -f flag to repair them: sudo fsck.hfsplus -f /dev/sdXY

These disks must be mounted writeable before any of the suggestions earlier in this thread will work correctly.

For reference, here’s the fstab line from my working hfsplus volume running on my Linux system:

/dev/sda2     /mnt/hfsplus     hfsplus     auto,rw,force,user     0     0

This was just for testing; for a permanent config I’d use the UUID (as you are) instead of the device name.

It worked! Thank you so much!!

One scare though - One of the disks was showing no subfolders after all of the commands. I went into a minor panic but rebooted and all is well.

THANK YOU!

2 Likes

No problem, glad you got it working.

2 Likes

Hello so I am complete on my Plex Server but I am assisting a friend and I have made it to the sudo fsck.hfsplus /dev/sda2 command but I keep getting an error message that the command is not found. Here is a screenshot of the lsblk command and results, as well as the error message.
I have also ran this command non as a superuser. Same result.
Any ideas?

I believe that fsck.hfsplus is included in the hfsprogs package in Ubuntu. Try installing that package and run the command again:

sudo apt update && sudo apt install hfsprogs

That seems to have worked, very strange how it was in my install but not his. I did the exact same steps.
Thanks!

This topic was automatically closed after 90 days. New replies are no longer allowed.