# Jails - Creating Virtual Drive On Host System



## Xrsus (Dec 13, 2010)

Here is my issue:

I have a server (running FreeBSD 7.3R 64bit) which has been pre-configured on a 500GB drive, 1 partition, and most of the space in the /usr slice.

I have since created multiple jails on the system which act as virtual servers (each jail runs web, db, e-mail) in the base folder /usr/jail (each "cell" is /usr/jail/cell01, /usr/jail/cell02, etc.).

Now, I'm running into what appears to be a time-old problem of setting quotas for the jails.  I want to make sure that each jail ("cell") only has 50GB of space.  Apparently the proper easy way of doing this would be to create 50GB slices, one for each cell, but, that didn't happen in the inital setup.

My question (loaded as it may be):  Is there either a way to shrink a live filesystem (ie. shrink my /usr slice so that I can create 50GB slices for the cells)? Failing that, is there a way to create a "virtual" drive of 50GB size in the /usr slice for each jail?  Or, as an alternative, has anyone come up with a way to limit the growth of a folder or institute quotas for jails?

Any help, hints, ideas, pointers, RTFM directions welcome! : )


----------



## Galactic_Dominator (Dec 13, 2010)

You can use ZFS or sparse/raw image files to accomplish this easily.  The  	sysutils/ezjail jail managment framework makes handling this easy.

Also technically speaking, in FreeBSD terms I assume you mean you have 1 slice with the bulk allocated to the /usr partition.


----------

