# Using shared storage in multiple Jail instances



## Oko (Jun 7, 2014)

Is there an elagant way to share the storage space among multiple Jail instances? I working on creating multiple Red Hat KVM guests on Red Hat host which will share the same storage so I am reading about  iSCSI right now. But it would be really cool to be able do that in FreeBSD using jails, ZFS, and "shared jail storage". Unfortunatelly guests have to use Oracle Java and I am also worried about ZFS degredation with large data bases so we will probably stick to Linux with this one.


----------



## SirDice (Jun 7, 2014)

Create the storage on the host and use nullfs(5) to mount it on one or more jails.


----------



## Oko (Jun 7, 2014)

SirDice said:
			
		

> Create the storage on the host and use nullfs(5) to mount it on one or more jails.


Damn. That is really, really cool! I was completely ignorant of nullfs.


----------



## scottro (Jun 8, 2014)

I have a page on it, http://www.srobb.net/nullfsjail.html, that works pretty well for FreeBSD-9x.  With 10x, I haven't yet gotten it working properly, and was told by someone who seems to know a great deal about it that the page had errors.   (The problem for me at least, with FreeBSD-10.0, is that devfs doesn't mount properly on the jails. The workaround that I've used is to create an /etc/rc.local entry that mounts devfs.)

The same person who mentioned the errors (and I should add that they did it in a kind and helpful way--I haven't followed their suggestions because I haven't gotten it working that way either) suggested using qjail as a very quick and easy way of making use of nullfs.


----------

