# ZFS per user not per dataset in jail.



## bryn1u (Feb 6, 2018)

Hello,

Im trying set quota for users in home directory. 
The only way for me which work is create dataset directly to the user for example:

```
root# zfs create zroot/jails/Jail1/home/user1
```
and then

```
root# zfs set quota=10MB zroot/jails/Jail1/home/user1
```
And yes it's working. But i have read about something like global quota for user.


> *zfs set userquota@joe=50G*


But it doen't work. Im getting list with zfs features. Has someone done it before and can share with me ? I would be graceful.


----------



## tobik@ (Feb 6, 2018)

bryn1u said:


> And yes it's working. But i have read about something like global quota for user.


It's not global. It's still local to a dataset. I think you're getting a "list of zfs features" (not exactly sure what you mean by that) because you haven't given `zfs set` a dataset to apply the property to and it prints a usage message with some useful properties.

```
zfs set userquota@joe=50G zroot/jails/Jail1/home/user1
```


----------



## bryn1u (Feb 6, 2018)

tobik@ said:


> It's not global. It's still local to a dataset. I think you're getting a "list of zfs features" (not exactly sure what you mean by that) because you haven't given `zfs set` a dataset to apply the property to and it prints a usage message with some useful properties.
> 
> ```
> zfs set userquota@joe=50G zroot/jails/Jail1/home/user1
> ```



@tobik
So, the only way to set properly user quota is create dataset per user ? 3x users = 3x dataset ?


----------



## Maxnix (Feb 6, 2018)

You are able to choose between setting a quota for each user on the *zroot/jails/Jail1/home* dataset

```
zfs set userquota@user1=50G zroot/jails/Jail1/home
zfs set userquota@user2=50G zroot/jails/Jail1/home
zfs set userquota@user3=50G zroot/jails/Jail1/home
```
or, as you said, create three dataset, one for each user, and assign quotas individually

```
zfs set quota=50G zroot/jails/Jail1/home/user1
zfs set quota=50G zroot/jails/Jail1/home/user2
zfs set quota=50G zroot/jails/Jail1/home/user3
```

HTH


----------

