To answer your question, yes this is possible on FreeBSD. On FreeNAS it is very likely possible. However, I am not too familiar with FreeNAS, specifically which files are rewritten on boot and what needs to be configured via GUI for changes to persist across reboots. The solutions below can be translated to work on FreeNAS but I will leave that to you.
If the media files are on the physical host, then I would recommend using a nullfs() mounts instead. nullfs mounts allow a directory to be mounted in another location. This method is compatible with jails where symlinks/hardlinks are not. I recommend
buying this book for a better explanation (no affiliation).
Test it by:
mount_nullfs /host/media /jail/root/media
Make it permanent
/etc/fstab
Code:
/host/media /jail/root/media nullfs ro 0 0
You will notice the
ro
flag being used, Plex does not need to write access to the media files and it is better security. Jails are a form of process separation [think chroot at the application level] however root access in a jail can allow files on the host to be rewritten, writable nullfs mounts are an easy vector for that attack.
You will need to configure the jail to "allow mounts" and to "allow nullfs mounts", this is dependent on the jail manager. In iocage it would be:
iocage set allow_mount=1 jailname
iocage set allow_mount_nullfs=1 jailname
Using a nullfs mount is a much better way of achieving your goal if the files are hosted on the same physical hardware. It involves less layers than Samba, should have better file/folder updates/notifications so that Plex notices and updates it's library, and does not involve keeping a password in clear text.
If the media files are being hosted on a different physical machine and you wanted to use Samba/CIFS/SMB, then I would configure nmbd to auto mount the directory at boot.
Add to
/etc/nsmb.conf
Code:
[FREENAS-HOSTNAME:USERNAME]
password=pass1234
The hostname and user
must be in all capital letters in this file. I can not stress this enough, it will not work otherwise.
Add a layer of security because storing a password in plain text is insecure. Please use a Samba user with limited or read only permissions.
chmod 600 /etc/nsmb.conf
Add to
/etc/fstab
//USERNAME@FREENAS-HOSTNAME/shareNAME /jail/root/media smbfs rw,-N,-I10.0.0.110 0 0
I have used both methods for Plex setups. Both work, the nullfs works a little better for the reasons mentioned above.
I would also recommend using a tmpfs mount for your transcode folder, the reason is due to how COW filesystems work. With the transcode folder, you have files constantly written to and deleted. This creates a lot of blocks being used for no good reason, this leads to fragmentation of contiguous blocks. Data integrity for a transcoded file is unnecessary due to the file's short and insignificant existence. A corrupted bit in a transcoded file will look the same as a blip in the video stream from packet loss due to a wireless connection. To configure a tmpfs mount:
/etc/fstab
Code:
tmpfs /jail/root/transcode tmpfs rw,mode=1777,size=32G 0 0
Then in the Server advanced section for transcoding you would set the folder to
/transcode.
EDIT: Updated to reflect my notes. nmbd_enable is not required as I falsely remembered.