Mount Data in Jail as Read Only

Status
Not open for further replies.

leepfrog

Cadet
Joined
Mar 21, 2013
Messages
5
Hi Forum,

I just got started with Freenas and the Jail System.

I got Air Video Server running in a Jail and everything is working as expected. Now I want to mount my existing data inside the jail which also works like a charm with the web interface. However I have the reqiurement to mount it as read only.
I tried editing /etc/fstab on the host but it changed back after restaring plugins.

How can I persistantly change that mount command?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Hi Forum,

I tried editing /etc/fstab on the host but it changed back after restaring plugins.

Just curious, was this actually restarting the plugins or was it rebooting the system? Or was the /etc/fstab within the jail that you edited?

If this was /etc/fstab outside the jail you would need to edit it in the /conf/base/etc location. There are special commands before you can edit and save that file.
1) mount -uw /
2) Make your changes to /conf/base/etc/fstab
3) mount -r /
4) Reboot to see if it worked.

If the file was within the jail, I have no idea why that file would revert back to it's original file after restarting the plugins. That doesn't make sense to me.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Just curious, was this actually restarting the plugins or was it rebooting the system? Or was the /etc/fstab within the jail that you edited?

Either way, the only way to mount a directory outside the jail to inside is using Mount Points.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Either way, the only way to mount a directory outside the jail to inside is using Mount Points.
I agree but he's trying to make it read only and retain it after reboot. I'm not sure how fstab works but if he made the volume mounted as read only outside the jail and then a reboot caused it to no longer work, I suspect it's because he didn't update the conf/base/etc/fstab file which is restored when the system boots. He still needs the mount point to share that data into the jail. I don't even think fstab could be used inside the jail for this since mount points really only link an external directory location to an internal directory location, it's not really mounting a drive.

Am I missing something?
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Jails don't use the standard fstab, they normally have a separate one which also contains the mountpoints, but the way the plugin jail is implemented, it gets created dynamically from the database, so editing the /conf/base version won't work. I suppose we should request some extra fields for jail parameters in the GUI so this kind of stuff can be configured.
 

leepfrog

Cadet
Joined
Mar 21, 2013
Messages
5
Thank you both for your answers.
I wasn't aware of the fact that default fstab is not used with jails.

My requirement would be that outside the jail the files in the folder in question can be read by the guest account (cifs) to be available without login, however inside the jail only read only as the jail will be exposed to the internet and I want to add some additional security.

Would that be possible with the approach you suggested ProtoSD? If yes can you give me a rough overview how this would have to be configured?

Apart from my issue I'd suggest to add a checkbox to the jail mount points to allow read only mount. Jails in general serve the purpose to increase security so this is a rather obvious feature ;)
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Status
Not open for further replies.
Top