Hello,

> I'm trying to use this feature of qgroup:
> 
> btrfs qgroup assign <srcid> <destid> <path>
>    Assigns the lower level qgroup src to the higher level qgroup dest
>    in the btrfs found in <path>. It is used to build qgroup
>    hierarchies.
> 
> 
> However, I fail to understand how this feature should work, and I'm
> getting "ERROR: bad relation requested":
> 
> # btrfs sub create test1
> Create subvolume './test1'
> 
> # btrfs sub create test2
> Create subvolume './test2'
> 
> # btrfs sub list /mnt/lxc2 | grep test
> ID 1177 gen 85131 top level 5 path test1
> ID 1178 gen 85132 top level 5 path test2
> 
> # btrfs qgroup show /mnt/lxc2
> 0/1177 4096 4096
> 0/1178 4096 4096
> 
> # btrfs qgroup assign 1177 1178 /mnt/lx2
> ERROR: bad relation requested '/mnt/lx2'
> 
> 
> Could anyone give examples of proper usage of this feature?
> 

Now qgroup require strict hierarchy. Every qgroup can be divided into
two parts:
                <level>/id

Btrfs group assign requires parent's level > children's level, For your example
below, you can do like:

btrfs qgroup create 1/1 <mnt>
btrfs qgroup assign  1177 1/1 <mnt>
btrfs qgroup assign  1178 1/1  <mnt>

And if you want to limit subvol(1177), you can do

btrfs qgroup limit  size 1177 <mnt>

Also, if you want to limit total size of 1177 and 1178, you
can set limit on qgroup 1/1.

Thanks,
Wang

> This is Linux 3.10.m
> 
> 
> -- 
> Tomasz Chmielewski
> http://wpkg.org
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to