Proper CIFS Share Permissions

Status
Not open for further replies.

Jath

Explorer
Joined
Jan 4, 2014
Messages
56
Hello,

I am trying to setup proper CIFS share permissions and would like to make sure I am doing it correctly in FreeNAS.

Now I know for my user account, I want to have it set to 0777, but how I did it supposedly breaks my jail, as per another user.

Basically I'm trying to setup a Plex server and created a share to browse to the media folder for Plex. When I setup the share, I could browse to it but I could not write to the folder, creating new folders or moving media over. So I went to Storage, clicked "View Volumes", selected the jail folder, then clicked the "Change Permissions" button at the bottom left.

The user in the other thread said that I shouldn't set permissions to the jail itself because it breaks the jail. Now I can't stop/start the Plex plugin unless I delete the plugin and redo it.

So before I delete the plugin and redo it, I wanted to ask how to properly setup these permissions.

Thank you.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Make a dataset for jails and more datasets for your media. Then share your media datasets over cifs but never your jail dataset. Give full permissions or use root to browse the cifs share.
 

Jath

Explorer
Joined
Jan 4, 2014
Messages
56
Before I do it, just to make sure. What if the media folder is inside the jail? Or should I make it so that it is Not in there purposely?

It's dumb, I had this working perfectly before I reformatted this thing. Shouldn't have reformatted it.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Your media shouldn't be in the jail. You should mount the media in the jail per the manuals instructions. Also when you reformat you should save your configuration database and just upload it to the new system and everything will be like it was.
 

Jath

Explorer
Joined
Jan 4, 2014
Messages
56
Thanks to you it looks like I finally got it going! I was able to get a dataset shared properly it looks like.

So one question before I go messing things up. I want to add a file to a different folder of the plex jail. I tried adding storage to the plex jail, source of the folder inside the jail, and destination of a dataset outside of the jail. I then shared it through CIFS, and accessed that share, however it is coming up completely blank even though I know for a fact it has files and folders inside of it.

Any idea?

Thank you.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
I tried adding storage to the plex jail, source of the folder inside the jail, and destination of a dataset outside of the jail.
It sounds like you may have done it backwards. The way to add storage to a jail is to take storage from outside, i.e. source, and make it available inside, i.e. destination.
 

Jath

Explorer
Joined
Jan 4, 2014
Messages
56
It sounds like you may have done it backwards. The way to add storage to a jail is to take storage from outside, i.e. source, and make it available inside, i.e. destination.
I greatly apologize. That's what I did, I just worded it wrongly. The source is the outside folder, and the destination is the folder inside the jail. Destination I can't even move outside of the jail, so I know I misspoke.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
That's what I did, I just worded it wrongly.
OK, no worries.

I then shared it through CIFS, and accessed that share, however it is coming up completely blank even though I know for a fact it has files and folders inside of it.
Please clarify "it has files and folders inside of it."

Were the files and folders previously in the dataset, or in the jail?

If the files and folders were previously in the jail, then adding the dataset is hiding them. This is the way *nix mounts work (which is what adding storage to a jail is built on).
 

Jath

Explorer
Joined
Jan 4, 2014
Messages
56
OK, no worries.


Please clarify "it has files and folders inside of it."

Were the files and folders previously in the dataset, or in the jail?

If the files and folders were previously in the jail, then adding the dataset is hiding them. This is the way *nix mounts work (which is what adding storage to a jail is built on).

Okay, so basically I was trying to add storage to the jail so that the source went to a folder like "/mnt/Plex/Plex Data", with the destination as a folder in the jail similar to "bin" as shown in the screenshot. When I shared that dataset of /mnt/Plex/Plex Data" and browsed to that share, I didn't see any files inside "bin".

I think it has to do with what you said, the dataset is hiding them. Hmmm. I'm going to have to figure out a way to get this file in the jail then.

upload_2015-5-10_16-9-28.png
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
Okay, so basically I was trying to add storage to the jail so that the source went to a folder like "/mnt/Plex/Plex Data", with the destination as a folder in the jail similar to "bin" as shown in the screenshot. When I shared that dataset of /mnt/Plex/Plex Data" and browsed to that share, I didn't see any files inside "bin".
  1. Right, when you mount storage in a folder in a jail, it hides whatever was in that folder. If this is the issue, the simplest fix is to move the data from the jail to the dataset first.
  2. I assume you're just using it as an example, but /bin would be a bad choice of mount point, since it's one of the places where FreeBSD expects to find executables. The conventional place to mount storage in a jail is /media. On a standalone system this is where removable devices show up, so there's a kind of logic to it, and in a jail it starts out empty. You can also create a new folder in the jail someplace and use that.
Now, are you saying you already have data in /mnt/Plex/Plex Data, but you can't see it in the share?
 

Jath

Explorer
Joined
Jan 4, 2014
Messages
56
  1. Right, when you mount storage in a folder in a jail, it hides whatever was in that folder. If this is the issue, the simplest fix is to move the data from the jail to the dataset first.
  2. bin is a bad choice of mount point, since it's one of the places where FreeBSD will expect to find executables. The conventional place to mount storage in a jail is media. On a standalone system this is where removable devices show up, so there's a kind of logic to it, and in a jail it starts out empty. You can also create a new folder in the jail someplace and use that.

Okay, I'll see what I can do.

Also, bin was just as an example. The area I actually wanted it to show was /usr. The reason is because through the path of usr is a folder I need to add a file to for Plex. An agent, so that it can scan different files more appropriately.

Thanks sir!
 

Jath

Explorer
Joined
Jan 4, 2014
Messages
56
I edited my reply while you were posting...
Oh, I see. Not that I put in there. When I do what I mentioned, set the destination to /usr, then browse to that share, it shows up blank.

What I do is I add the storage to the jail, source is a dataset, "Plex Data", destination is "/usr" of the Plex jail (which has other folders and files inside it). I then share through CIFS the dataset, "Plex Data". Once I browse that share, it will show up nothing.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
What I do is I add the storage to the jail, source is a dataset, "Plex Data", destination is "/usr" of the Plex jail (which has other folders and files inside it). I then share through CIFS the dataset, "Plex Data". Once I browse that share, it will show up nothing.
Yes, you can't do it that way. Mounting the dataset to /usr hides the current contents of /usr.
The area I actually wanted it to show was /usr. The reason is because through the path of usr is a folder I need to add a file to for Plex. An agent, so that it can scan different files more appropriately.
If this is a temporary share just to copy something into the jail, it may be easier to use something like FileZilla to connect to your FreeNAS and copy the file directly where you want it. You could even just copy it to some existing share, then move it wherever you want using the command line. You could also use scp or rsync. In your example, it looks like the full path to the jail's /usr folder would be /mnt/Plex/jails/plexmediaserver_1/usr

There are so many options, none of which will work if you've hidden the destination by mounting storage to it.
 

Jath

Explorer
Joined
Jan 4, 2014
Messages
56
Yes, you can't do it that way. Mounting the dataset to /usr hides the current contents of /usr.

If this is a temporary share just to copy something into the jail, it may be easier to use something like FileZilla to connect to your FreeNAS and copy the file directly where you want it. You could even just copy it to some existing share, then move it wherever you want using the command line. You could also use scp or rsync. In your example, it looks like the full path to the jail's /usr folder would be /mnt/Plex/jails/plexmediaserver_1/usr

There are so many options, none of which will work if you've hidden the destination by mounting storage to it.
Yup, that's what I figured I would have to do. I can do it via the shell. Shouldn't be too hard to copy the file from a location like the media folder of it to the usr folder.

Thank you very much for your help. I greatly appreciate your assistance.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
One more thing ... it seems really odd to me to have your jails dataset inside your Plex dataset, since Plex is only one of many possible plugins and jails.

EDIT: never mind, I guess Plex is a volume?
 

Jath

Explorer
Joined
Jan 4, 2014
Messages
56
One more thing ... it seems really odd to me to have your jails dataset inside your Plex dataset, since Plex is only one of many possible plugins and jails.
This isn't going to be a permanent server for me. More of a temporary until I can get a server dedicated to plex. Currently this is running on ESXi 5.5 in which the host only has 1TB of space. I plan on upgrading considerably once I actually have the money to a ixsystems server that is dedicated completely to Plex. And that's all I really need FreeNAS for at this exact moment is Plex.

What do you use yours for out of curiosity?
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
Currently this is running on ESXi 5.5 in which the host only has 1TB of space.
Don't let you-know-who see this ;)
What do you use yours for out of curiosity?
  • backup destination for 3 Macs (using Arq Backup over SSH)
  • backup destination for 1 PC (using Windows Backup to a CIFS share)
  • a few DVD images and some compressed media (served to Plex via an NFS share - Plex Server runs on the HTPC, aka Mac mini)
  • VirtualBox jail running a few small Ubuntu Server VMs for website development, and one Ubuntu Server VM running AeroFS Team Server
 
Status
Not open for further replies.
Top