# jail and zfs



## redixin (Jul 13, 2010)

I got zfs within the jail, can create FSs, snapshots and so on, bu I can't set quota for filesystems:


```
# zfs set quota=8M tank/homes/test1
cannot set property for 'tank/homes/test1': permission denied
```

is this feature or bug?


----------



## Jaax (Jul 14, 2010)

Hi,

Is the jail running ?


----------



## redixin (Jul 14, 2010)

yep. I log in to jail via ssh, and creating/deleting filesystems ok:


```
storage# zfs create tank/homes/test2
storage# zfs list tank/homes/test2
NAME               USED  AVAIL  REFER  MOUNTPOINT
tank/homes/test2  24.0K   100G  24.0K  /homes/test2
storage# zfs set quota=10M tank/homes/test2
cannot set property for 'tank/homes/test2': permission denied
storage#
```


----------



## t1066 (Jul 14, 2010)

You need zfs version 15 to set quota. And, for the moment zfs is only at version 14 on 8.1.

However, a good news is that zfs version 15 was committed to head and patches will be released once 8.1 is available.


----------



## alp (Jul 15, 2010)

t1066 said:
			
		

> You need zfs version 15 to set quota. And, for the moment zfs is only at version 14 on 8.1.
> 
> However, a good news is that zfs version 15 was committed to head and patches will be released once 8.1 is available.



It seems to be wrong.

```
# zfs get quota tank/jails/diffs/openid
NAME                     PROPERTY  VALUE                    SOURCE
tank/jails/diffs/openid  quota     none                     default
# zfs set quota=100M tank/jails/diffs/openid
cannot set property for 'tank/jails/diffs/openid': size is less than current used or reserved space
# zfs set quota=2048M tank/jails/diffs/openid
# jls
   JID  IP Address      Hostname                      Path
     3  <ip> <hostname>      /jails/run/openid
// our jail is running
# zfs get quota tank/jails/diffs/openid
NAME                     PROPERTY  VALUE                    SOURCE
tank/jails/diffs/openid  quota     2G                       local
# zfs set quota=none tank/jails/diffs/openid
# zpool upgrade
This system is currently running ZFS pool version 14.

The following pools are out of date, and can be upgraded.  After being
upgraded, these pools will no longer be accessible by older software versions.

VER  POOL
---  ------------
13   tank
```
I'm running not very recent 8-STABLE...


----------



## t1066 (Jul 15, 2010)

Sorry, I got it wrong here. Version 15 introduced user quota and group quota.


----------



## redixin (Jul 18, 2010)

alp said:
			
		

> I'm running not very recent 8-STABLE...



I can change quotas from host machine too, but can you do the same from the jail?

something like

```
# hostname
host.domain.com
# jexec 1 sh
# hostname 
jail.host.domain.com
# zfs set quota ......
```


----------



## alp (Jul 19, 2010)

redixin said:
			
		

> I can change quotas from host machine too, but can you do the same from the jail?
> [/code]


AFAIK, this functionality is not implemented...


----------



## alp (Jul 19, 2010)

Oh, I was wrong. There is "jailed" property on zfs. You may try "zfs set jailed=on pool/fs". I've tried, but it seems to be broken in some way  on my box (possibly, related to this: http://svn.freebsd.org/viewvc/base?view=revision&revision=208684 )


----------



## paranormal (Aug 26, 2012)

From man:

The quota property canâ€not be changed from within a jail.



			
				redixin said:
			
		

> I can change quotas from host machine too, but can you do the same from the jail?
> 
> something like
> 
> ...


----------

