ZFS Zpool and jail

zader

Member

Reaction score: 3
Messages: 51

Hi guys,

Just windering what the best practice is (and maybe a sample or walk though) on setting up a jail and passing either a pool or vol to a vsftp or samba share within a jail?

I guess the part thats not real clear is how to read/write to a volume/vdev thats on the host from a jail.

Thanks
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,388
Messages: 29,953

You can "assign" a dataset to a jail using zfs jail. The host will then ignore it and the jail can take full control of it. Most of the time however you don't really need it as you can make cleaver use of nullfs(5) to mount additional data directories from the host to one or more jails.
 
OP
OP
Z

zader

Member

Reaction score: 3
Messages: 51

Just to clarify
The jail is on its own zvol, the volume/pool to be used for the nas should be seperate from the host and jail but accessable from both.

Ie
Host is on main zpool
Jail is a vdev on /usr/jails/nas

Should the nas be a few volumes in /dev/zfs.. then create a secondary pool on the host.. ? Or just create a secondary pool on the host? Etc

Thanks
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,388
Messages: 29,953

the volume/pool to be used for the nas should be seperate from the host and jail but accessible from both.
That's not possible with zfs jail. If you want this use nullfs(5).
 
OP
OP
Z

zader

Member

Reaction score: 3
Messages: 51

gosh lol so fast, I didn't even have time to re-post my thought to make it more clear.. haha but nether the less thanks.
this nas is a poc that I'm trying to replicate via VM...

the real nas will be a hardware host with 2 primary drives and 12storage drives.

my thought was

install os (use the 2 drives as a mirror) zpool 1
create and install jail
from the host, create the raid : 12x 4TB, raidz3 (raid7) aka zpool 2
set the zfs jail flag on zpool2

then access the pool from the jail.

and for my vm.. an acceptable replication of the hardware poc would be
create vm with 14 virtual hard drives and configure as above..?


given my use case, would it be better to just stick with zfs jail? or use it as a nullfs? is there any pros vs cons or perfomrance / security issues between them?

thanks again for your help.
 
Top