[root@btrfs-testdrive] # btrfs qgroup create 1/100 /mnt/btrfs
[root@btrfs-testdrive] # btrfs qgroup assign 0/276 1/100 /mnt/btrfs
[root@btrfs-testdrive] # btrfs qgroup show /mnt/btrfs
qgroupid rfer excl
-------- ---- ----
0/5 16384 16384
0/256 2864136192 2864136192
0/258 833703936 833703936
0/259 52510720 52510720
0/260 733184 733184
0/270 360448 360448
0/271 3407872 3407872
0/272 364544 364544
0/273 3330048 3330048
0/274 0 0
0/275 16384 16384
0/276 16384 16384
0/277 16384 16384
1/100 0 0
[root@btrfs-testdrive] # btrfs qgroup show /mnt/btrfs -repc
qgroupid rfer excl max_rfer max_excl parent child
-------- ---- ---- -------- -------- ------ -----
0/5 16384 16384 0 0 --- ---
0/256 2864136192 2864136192 0 0 --- ---
0/258 833703936 833703936 0 0 --- ---
0/259 52510720 52510720 0 0 --- ---
0/260 733184 733184 0 0 --- ---
0/270 360448 360448 0 10485760 --- ---
0/271 3407872 3407872 0 104857600 --- ---
0/272 364544 364544 0 10485760 --- ---
0/273 3330048 3330048 0 104857600 --- ---
0/274 0 0 0 0 --- ---
0/275 16384 16384 0 0 --- ---
0/276 16384 16384 0 0 1/100 ---
0/277 16384 16384 0 0 --- ---
1/100 0 0 0 0 --- 0/276
[root@btrfs-testdrive] # btrfs qgroup limit -e 200m 1/200 /mnt/btrfs
[root@btrfs-testdrive] # btrfs qgroup limit 10m 1/100 /mnt/btrfs
[root@btrfs-testdrive] # btrfs qgroup show /mnt/btrfs -repc
qgroupid rfer excl max_rfer max_excl parent child
-------- ---- ---- -------- -------- ------ -----
0/5 16384 16384 0 0 --- ---
0/256 2864140288 2864140288 0 0 --- ---
0/258 833703936 833703936 0 0 --- ---
0/259 52510720 52510720 0 0 --- ---
0/260 733184 733184 0 0 --- ---
0/270 360448 360448 0 10485760 --- ---
0/271 3407872 3407872 0 104857600 --- ---
0/272 364544 364544 0 10485760 --- ---
0/273 3330048 3330048 0 104857600 --- ---
0/274 0 0 0 0 --- ---
0/275 16384 16384 0 0 --- ---
0/276 16384 16384 0 0 1/100,1/200 ---
0/277 16384 16384 0 0 1/200 ---
1/100 0 0 10485760 0 --- 0/276
1/200 0 0 0 209715200 --- 0/276,0/277
[root@btrfs-testdrive] # for i in {00..24}
do
btrfs quota rescan /mnt/btrfs -w > /dev/null
sleep 30
dd if=/dev/zero of=/mnt/btrfs/parent/child01/zero.${i}.img bs=10k count=2048
done
dd: error writing ‘/mnt/btrfs/parent/child01/zero.00.img’: Disk quota exceeded
956+0 records in
955+0 records out
9779200 bytes (9.8 MB) copied, 0.0117364 s, 833 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.01.img’: Disk quota exceeded
926+0 records in
925+0 records out
9472000 bytes (9.5 MB) copied, 0.0102403 s, 925 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.02.img’: Disk quota exceeded
891+0 records in
890+0 records out
9113600 bytes (9.1 MB) copied, 0.0102027 s, 893 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.03.img’: Disk quota exceeded
860+0 records in
859+0 records out
8796160 bytes (8.8 MB) copied, 0.0103407 s, 851 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.04.img’: Disk quota exceeded
829+0 records in
828+0 records out
8478720 bytes (8.5 MB) copied, 0.00930198 s, 911 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.05.img’: Disk quota exceeded
798+0 records in
797+0 records out
8161280 bytes (8.2 MB) copied, 0.00901611 s, 905 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.06.img’: Disk quota exceeded
768+0 records in
767+0 records out
7854080 bytes (7.9 MB) copied, 0.00886019 s, 886 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.07.img’: Disk quota exceeded
741+0 records in
740+0 records out
7577600 bytes (7.6 MB) copied, 0.00890008 s, 851 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.08.img’: Disk quota exceeded
715+0 records in
714+0 records out
7311360 bytes (7.3 MB) copied, 0.00810682 s, 902 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.09.img’: Disk quota exceeded
689+0 records in
688+0 records out
7045120 bytes (7.0 MB) copied, 0.00811421 s, 868 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.10.img’: Disk quota exceeded
663+0 records in
662+0 records out
6778880 bytes (6.8 MB) copied, 0.00780635 s, 868 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.11.img’: Disk quota exceeded
639+0 records in
638+0 records out
6533120 bytes (6.5 MB) copied, 0.00752098 s, 869 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.12.img’: Disk quota exceeded
616+0 records in
615+0 records out
6297600 bytes (6.3 MB) copied, 0.00743855 s, 847 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.13.img’: Disk quota exceeded
593+0 records in
592+0 records out
6062080 bytes (6.1 MB) copied, 0.00669214 s, 906 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.14.img’: Disk quota exceeded
569+0 records in
568+0 records out
5816320 bytes (5.8 MB) copied, 0.00893952 s, 651 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.15.img’: Disk quota exceeded
548+0 records in
547+0 records out
5601280 bytes (5.6 MB) copied, 0.00625001 s, 896 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.16.img’: Disk quota exceeded
528+0 records in
527+0 records out
5396480 bytes (5.4 MB) copied, 0.00598858 s, 901 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.17.img’: Disk quota exceeded
539+0 records in
538+0 records out
5509120 bytes (5.5 MB) copied, 0.00727839 s, 757 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.18.img’: Disk quota exceeded
81+0 records in
80+0 records out
819200 bytes (819 kB) copied, 0.00111382 s, 735 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.19.img’: Disk quota exceeded
78+0 records in
77+0 records out
788480 bytes (788 kB) copied, 0.00101193 s, 779 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.20.img’: Disk quota exceeded
72+0 records in
71+0 records out
727040 bytes (727 kB) copied, 0.00119237 s, 610 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.21.img’: Disk quota exceeded
65+0 records in
64+0 records out
655360 bytes (655 kB) copied, 0.00100051 s, 655 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.22.img’: Disk quota exceeded
60+0 records in
59+0 records out
604160 bytes (604 kB) copied, 0.000885687 s, 682 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.23.img’: Disk quota exceeded
55+0 records in
54+0 records out
552960 bytes (553 kB) copied, 0.000874137 s, 633 MB/s
dd: error writing ‘/mnt/btrfs/parent/child01/zero.24.img’: Disk quota exceeded
50+0 records in
49+0 records out
501760 bytes (502 kB) copied, 0.000816612 s, 614 MB/s
[root@btrfs-testdrive] # ls -lh /mnt/btrfs/parent/child01
total 130M
-rw-r--r-- 1 root root 9.4M Aug 21 23:55 zero.00.img
-rw-r--r-- 1 root root 9.1M Aug 21 23:55 zero.01.img
-rw-r--r-- 1 root root 8.7M Aug 21 23:56 zero.02.img
-rw-r--r-- 1 root root 8.4M Aug 21 23:56 zero.03.img
-rw-r--r-- 1 root root 8.1M Aug 21 23:57 zero.04.img
-rw-r--r-- 1 root root 7.8M Aug 21 23:57 zero.05.img
-rw-r--r-- 1 root root 7.5M Aug 21 23:58 zero.06.img
-rw-r--r-- 1 root root 7.3M Aug 21 23:58 zero.07.img
-rw-r--r-- 1 root root 7.0M Aug 21 23:59 zero.08.img
-rw-r--r-- 1 root root 6.8M Aug 21 23:59 zero.09.img
-rw-r--r-- 1 root root 6.5M Aug 22 00:00 zero.10.img
-rw-r--r-- 1 root root 6.3M Aug 22 00:00 zero.11.img
-rw-r--r-- 1 root root 6.1M Aug 22 00:01 zero.12.img
-rw-r--r-- 1 root root 5.8M Aug 22 00:01 zero.13.img
-rw-r--r-- 1 root root 5.6M Aug 22 00:02 zero.14.img
-rw-r--r-- 1 root root 5.4M Aug 22 00:03 zero.15.img
-rw-r--r-- 1 root root 5.2M Aug 22 00:03 zero.16.img
-rw-r--r-- 1 root root 5.3M Aug 22 00:04 zero.17.img
-rw-r--r-- 1 root root 800K Aug 22 00:04 zero.18.img
-rw-r--r-- 1 root root 770K Aug 22 00:05 zero.19.img
-rw-r--r-- 1 root root 710K Aug 22 00:05 zero.20.img
-rw-r--r-- 1 root root 640K Aug 22 00:06 zero.21.img
-rw-r--r-- 1 root root 590K Aug 22 00:06 zero.22.img
-rw-r--r-- 1 root root 540K Aug 22 00:07 zero.23.img
-rw-r--r-- 1 root root 490K Aug 22 00:07 zero.24.img