This could be one of two issues:
1. The plex user does not have write access to the dataset you're trying to write to, as you mentioned
2. The dataset was mounted as read only in the fstab file
Before discussing a solution, there are a couple of things I should clarify. A plex user and group will have been automatically created for you, regardless of your installation method. If you used the plugin, this should have happened in plugin installation, and if you used the pkg install, they are also created automatically. I am assuming that your dvr directory is located within /mnt/media on the FreeNAS host. These solutions are presented from the command line interface, and assume you know how to SSH in and access your jails.
For the first issue, you can confirm whether this is the case by issuing the following command from within your plex jail:
ls -l /path/to/directory
i.e.:
ls -l /mnt/media
This will yield an output containing permission information similar to as follows:
drwxrwxr-- 8 root wheel 9 Aug 17 14:46 dvr
There are a few components to this. The
drwxrwxr--
component describes the permissions of the file/folder. The leading 'd' indicates that it's a directory. The following 'rwx' indicates the owning user has read, write and execute permissions. The 'rwx' following that indicates that the owning group has read, write and execute permissions, and the 'r--' following that indicates that the "other" set of users have only read permissions. The next components are 'root' and 'wheel'. In this case root refers to the owning user of the file/directory, and wheel is the owning group of that file/directory. The dvr component at the end is the name of the file/directory. If your folder has permissions that match this, this is likely why it's not working for you. The solution to this is one of three things:
1. You could change the owning user:
chown -R plex:wheel /mnt/media/dvr
2. You could change the owning group/add the plex user to the wheel group
To change the owning group to the *group* named plex:
chown -R root:plex /mnt/media/dvr
To add the *user* plex to the wheel group:
pw groupmod wheel -M plex
3. You could expand the permissions of the "other" users:
chmod -R 777 /mnt/media/dvr
My suggestion would be to do a combination of 1 and 2, and change both the owning user and owning group to the plex user and group:
chown -R plex:plex /mnt/media/dvr
Of course, if you have other daemons that might need access to this folder, it might be prudent to create a media_share group or something, and change ownership to plex:media_share or similar, where each of the daemons requiring access are members of this media_share group. Refer to the
user management and
permissions documentation for a fuller explanation, and the tools at your disposal.
The second possible issue is that the dataset was mounted as read only in your fstab file. To check if this is the case, log into your FreeNAS host console, and change the default editor from vi to nano:
setenv EDITOR nano
Then inspect the fstab file for your plex jail. Note: I'm assuming your plex jail is named "plex", if it's not, replace any instance of "plex" with the name of your jail:
iocage fstab -e plex
You should be presented with something similar to the following:
/mnt/media/dvr /mnt/iocage/jails/plex/root/mnt/media/dvr nullfs rw 0 0
If your entry looks similar to this, then this is likely not the issue. IF, however, the entry following 'nullfs' is 'ro' and not 'rw', you'll need to change this to 'rw'. Then to quit the editor, press Ctrl +X, y and enter. Hope this helps.