How to allow Plex ánd Nextcloud access to external HDD

It’s been quite an undertaking but I’m almost finished: a raspberry pi 3 with VPN, webserver with Nextcloud and Plex. There’s a few things that I still wanted to edit and one of them is the following:

To my WD-Pi set-up, I have attached an external HDD, that holds all my media (photos, homevideos, our CD-rips, etc). The issue is: I want both Nextcloud and Plex to have access. I don’t seem to get this combination working.

Following this answer on I created the group mediausers and added the users plex and www-data:

sudo groupadd mediausers
sudo usermod -a -G mediausers plex
sudo usermod -a -G mediausers www-data

The drive was (already before connecting it to my Pi) formated as vfat (or so it appears on the Pi). With the following line on /etc/fstab I mounted the drive (partly based on this post) with mediausers as the group:

UUID=1B1C-14D8  /CloudMEDIA/    vfat    nofail,uid=pi,gid=mediausers,umask=003         0       0

Without umask Plex happily serves my pictures but I get a ‘you don’t have permission to create or upload in this folder’-error in Nextcloud. With the umask Nextcloud is happy and allows me to do what I want, but Plex doesn’t serve any media anymore (‘Unavailable; please check the necessary drive is mounted’).

How can I make both Plex, Nextcloud and myself happy? How do I get file/mount permisssions right? Any help much appreciated! :slight_smile:

Nextcloud version (eg, 10.0.2): 11.0.3 (stable)
Operating system and version (eg, Ubuntu 16.04): Raspbian Jessie
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 5.6): 7.0.16
Is this the first time you’ve seen this error?: yup, changing umask values & mounting makes Plex & Nextcloud (not) work

What are the permissions on the /CloudMEDIA mount point ?

BTW, I would use NTFS or, better, a linux filesystem.

Hey there,
Thanks for your reply. vfat partitions cannot have permissions set in another way then describing them in fstab:


Totally agree. But the drive already holds all of my media files and I don’t feel like changing/migrating that atm. Will do at some point in future I guess.

I’ve never added these fstab options for fat drives but I use set proper permissions on the mount point and that just works. That is why I was asking about the permission you have on /CloudMEDIA.

Ok. I had already made pi the owner and set mediausers as the group:
sudo chown -R pi:mediausers /CloudMEDIA/
sudo chmod -R 775 /CloudMEDIA/
And consequently:
drwxr-xr-x 18 pi mediausers 32768 jan 1 1970 CloudMEDIA