tmueko
Explorer
- Joined
- Jun 5, 2012
- Messages
- 82
This looks like a FreeNAS-9 bug:
I created a 5G zvol, created an ufs filesystem and mounted it:
[root@tillmann] ~# zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation raid
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
raid raid 2.47T 5.16G 0 288K 0 5.16G 1.00x none none none none
raid/zetavol raid/zetavol 2.48T 5.16G 0 144K 5.16G 0 1.00x - - none 5.16G
[root@tillmann] ~# dd if=/dev/random of=/mnt/zetavol/1g bs=1g count=1
[root@tillmann] ~# zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation raid
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
raid raid 2.47T 5.16G 0 288K 0 5.16G 1.00x none none none none
raid/zetavol raid/zetavol 2.48T 5.16G 0 2.03G 3.13G 0 1.00x - - none 5.16G
[root@tillmann] ~# zfs snapshot -r raid@1
[root@tillmann] ~# zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation raid
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
raid raid 2.47T 7.19G 0 288K 0 7.19G 1.00x none none none none
raid@1 raid@1 - 0 - - - - 1.00x - - - -
raid/zetavol raid/zetavol 2.48T 7.19G 0 2.03G 5.16G 0 1.00x - - none 5.16G
raid/zetavol@1 raid/zetavol@1 - 0 - - - - 1.00x - - - -
This snapshot kosts 2GB!!
Again:
[root@tillmann] ~# dd if=/dev/random of=/mnt/zetavol/1g.1 bs=1g count=1
[root@tillmann] ~# zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation raid
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
raid raid 2.47T 7.19G 0 288K 0 7.19G 1.00x none none none none
raid@1 raid@1 - 0 - - - - 1.00x - - - -
raid/zetavol raid/zetavol 2.48T 7.19G 599K 4.06G 3.13G 0 1.00x - - none 5.16G
raid/zetavol@1 raid/zetavol@1 - 599K - - - - 1.00x - - - -
[root@tillmann] ~# zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation raid
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
raid raid 2.47T 9.22G 0 288K 0 9.22G 1.00x none none none none
raid@1 raid@1 - 0 - - - - 1.00x - - - -
raid@2 raid@2 - 0 - - - - 1.00x - - - -
raid/zetavol raid/zetavol 2.48T 9.22G 599K 4.06G 5.16G 0 1.00x - - none 5.16G
raid/zetavol@1 raid/zetavol@1 - 599K - - - - 1.00x - - - -
raid/zetavol@2 raid/zetavol@2 - 0 - - - - 1.00x - - - -
I testet the same thing with a FreeBSD 9.1-RELEASE-p3, where a snapshot just gives me 1GB additional in USEDCHILD and USEDREFRESERV:
baal3 /root # zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation ztank/test
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
ztank/test ztank/test 6.59T 5.16G 0 31K 0 5.16G 1.00x none none none none
ztank/test/vol ztank/test/vol 6.59T 5.16G 0 988M 4.19G 0 1.00x - - none 5.16G
baal3 /root # zfs snapshot -r ztank/test@1
baal3 /root # zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation ztank/test
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
ztank/test ztank/test 6.59T 6.12G 0 31K 0 6.12G 1.00x none none none none
ztank/test@1 ztank/test@1 - 0 - - - - 1.00x - - - -
ztank/test/vol ztank/test/vol 6.59T 6.12G 0 988M 5.16G 0 1.00x - - none 5.16G
ztank/test/vol@1 ztank/test/vol@1 - 0 - - - - 1.00x - - - -
baal3 /root # dd if=/dev/random of=/mnt/testvol/rand-1G.1 bs=1k count=1000000
1000000+0 records in
1000000+0 records out
1024000000 bytes transferred in 73.254043 secs (13978751 bytes/sec)
baal3 /root # zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation ztank/test
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
ztank/test ztank/test 6.59T 6.12G 0 31K 0 6.12G 1.00x none none none none
ztank/test@1 ztank/test@1 - 0 - - - - 1.00x - - - -
ztank/test/vol ztank/test/vol 6.59T 6.12G 208K 1.93G 4.19G 0 1.00x - - none 5.16G
ztank/test/vol@1 ztank/test/vol@1 - 208K - - - - 1.00x - - - -
baal3 /root # zfs snapshot -r ztank/test@2
baal3 /root # zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation ztank/test
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
ztank/test ztank/test 6.59T 7.09G 0 31K 0 7.09G 1.00x none none none none
ztank/test@1 ztank/test@1 - 0 - - - - 1.00x - - - -
ztank/test@2 ztank/test@2 - 0 - - - - 1.00x - - - -
ztank/test/vol ztank/test/vol 6.59T 7.09G 208K 1.93G 5.16G 0 1.00x - - none 5.16G
ztank/test/vol@1 ztank/test/vol@1 - 208K - - - - 1.00x - - - -
ztank/test/vol@2 ztank/test/vol@2 - 0 - - - - 1.00x - - - -
baal3 /root # dd if=/dev/random of=/mnt/testvol/rand-1G.2 bs=1k count=1000000
1000000+0 records in
1000000+0 records out
1024000000 bytes transferred in 68.651351 secs (14915948 bytes/sec)
baal3 /root # zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation ztank/test
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
ztank/test ztank/test 6.59T 7.09G 0 31K 0 7.09G 1.00x none none none none
ztank/test@1 ztank/test@1 - 0 - - - - 1.00x - - - -
ztank/test@2 ztank/test@2 - 0 - - - - 1.00x - - - -
ztank/test/vol ztank/test/vol 6.59T 7.09G 475K 2.89G 4.19G 0 1.00x - - none 5.16G
ztank/test/vol@1 ztank/test/vol@1 - 208K - - - - 1.00x - - - -
ztank/test/vol@2 ztank/test/vol@2 - 220K - - - - 1.00x - - - -
baal3 /root # zfs snapshot -r ztank/test@3
baal3 /root # zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation ztank/test
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
ztank/test ztank/test 6.59T 8.05G 0 31K 0 8.05G 1.00x none none none none
ztank/test@1 ztank/test@1 - 0 - - - - 1.00x - - - -
ztank/test@2 ztank/test@2 - 0 - - - - 1.00x - - - -
ztank/test@3 ztank/test@3 - 0 - - - - 1.00x - - - -
ztank/test/vol ztank/test/vol 6.59T 8.05G 475K 2.89G 5.16G 0 1.00x - - none 5.16G
ztank/test/vol@1 ztank/test/vol@1 - 208K - - - - 1.00x - - - -
ztank/test/vol@2 ztank/test/vol@2 - 220K - - - - 1.00x - - - -
ztank/test/vol@3 ztank/test/vol@3 - 0 - - - - 1.00x - - - -
baal3 /root # uname -a
FreeBSD baal3.kommunity.net 9.1-RELEASE-p3 FreeBSD 9.1-RELEASE-p3 #0: Mon Apr 29 18:27:25 UTC 2013 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
I created a 5G zvol, created an ufs filesystem and mounted it:
[root@tillmann] ~# zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation raid
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
raid raid 2.47T 5.16G 0 288K 0 5.16G 1.00x none none none none
raid/zetavol raid/zetavol 2.48T 5.16G 0 144K 5.16G 0 1.00x - - none 5.16G
[root@tillmann] ~# dd if=/dev/random of=/mnt/zetavol/1g bs=1g count=1
[root@tillmann] ~# zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation raid
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
raid raid 2.47T 5.16G 0 288K 0 5.16G 1.00x none none none none
raid/zetavol raid/zetavol 2.48T 5.16G 0 2.03G 3.13G 0 1.00x - - none 5.16G
[root@tillmann] ~# zfs snapshot -r raid@1
[root@tillmann] ~# zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation raid
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
raid raid 2.47T 7.19G 0 288K 0 7.19G 1.00x none none none none
raid@1 raid@1 - 0 - - - - 1.00x - - - -
raid/zetavol raid/zetavol 2.48T 7.19G 0 2.03G 5.16G 0 1.00x - - none 5.16G
raid/zetavol@1 raid/zetavol@1 - 0 - - - - 1.00x - - - -
This snapshot kosts 2GB!!
Again:
[root@tillmann] ~# dd if=/dev/random of=/mnt/zetavol/1g.1 bs=1g count=1
[root@tillmann] ~# zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation raid
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
raid raid 2.47T 7.19G 0 288K 0 7.19G 1.00x none none none none
raid@1 raid@1 - 0 - - - - 1.00x - - - -
raid/zetavol raid/zetavol 2.48T 7.19G 599K 4.06G 3.13G 0 1.00x - - none 5.16G
raid/zetavol@1 raid/zetavol@1 - 599K - - - - 1.00x - - - -
[root@tillmann] ~# zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation raid
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
raid raid 2.47T 9.22G 0 288K 0 9.22G 1.00x none none none none
raid@1 raid@1 - 0 - - - - 1.00x - - - -
raid@2 raid@2 - 0 - - - - 1.00x - - - -
raid/zetavol raid/zetavol 2.48T 9.22G 599K 4.06G 5.16G 0 1.00x - - none 5.16G
raid/zetavol@1 raid/zetavol@1 - 599K - - - - 1.00x - - - -
raid/zetavol@2 raid/zetavol@2 - 0 - - - - 1.00x - - - -
I testet the same thing with a FreeBSD 9.1-RELEASE-p3, where a snapshot just gives me 1GB additional in USEDCHILD and USEDREFRESERV:
baal3 /root # zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation ztank/test
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
ztank/test ztank/test 6.59T 5.16G 0 31K 0 5.16G 1.00x none none none none
ztank/test/vol ztank/test/vol 6.59T 5.16G 0 988M 4.19G 0 1.00x - - none 5.16G
baal3 /root # zfs snapshot -r ztank/test@1
baal3 /root # zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation ztank/test
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
ztank/test ztank/test 6.59T 6.12G 0 31K 0 6.12G 1.00x none none none none
ztank/test@1 ztank/test@1 - 0 - - - - 1.00x - - - -
ztank/test/vol ztank/test/vol 6.59T 6.12G 0 988M 5.16G 0 1.00x - - none 5.16G
ztank/test/vol@1 ztank/test/vol@1 - 0 - - - - 1.00x - - - -
baal3 /root # dd if=/dev/random of=/mnt/testvol/rand-1G.1 bs=1k count=1000000
1000000+0 records in
1000000+0 records out
1024000000 bytes transferred in 73.254043 secs (13978751 bytes/sec)
baal3 /root # zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation ztank/test
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
ztank/test ztank/test 6.59T 6.12G 0 31K 0 6.12G 1.00x none none none none
ztank/test@1 ztank/test@1 - 0 - - - - 1.00x - - - -
ztank/test/vol ztank/test/vol 6.59T 6.12G 208K 1.93G 4.19G 0 1.00x - - none 5.16G
ztank/test/vol@1 ztank/test/vol@1 - 208K - - - - 1.00x - - - -
baal3 /root # zfs snapshot -r ztank/test@2
baal3 /root # zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation ztank/test
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
ztank/test ztank/test 6.59T 7.09G 0 31K 0 7.09G 1.00x none none none none
ztank/test@1 ztank/test@1 - 0 - - - - 1.00x - - - -
ztank/test@2 ztank/test@2 - 0 - - - - 1.00x - - - -
ztank/test/vol ztank/test/vol 6.59T 7.09G 208K 1.93G 5.16G 0 1.00x - - none 5.16G
ztank/test/vol@1 ztank/test/vol@1 - 208K - - - - 1.00x - - - -
ztank/test/vol@2 ztank/test/vol@2 - 0 - - - - 1.00x - - - -
baal3 /root # dd if=/dev/random of=/mnt/testvol/rand-1G.2 bs=1k count=1000000
1000000+0 records in
1000000+0 records out
1024000000 bytes transferred in 68.651351 secs (14915948 bytes/sec)
baal3 /root # zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation ztank/test
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
ztank/test ztank/test 6.59T 7.09G 0 31K 0 7.09G 1.00x none none none none
ztank/test@1 ztank/test@1 - 0 - - - - 1.00x - - - -
ztank/test@2 ztank/test@2 - 0 - - - - 1.00x - - - -
ztank/test/vol ztank/test/vol 6.59T 7.09G 475K 2.89G 4.19G 0 1.00x - - none 5.16G
ztank/test/vol@1 ztank/test/vol@1 - 208K - - - - 1.00x - - - -
ztank/test/vol@2 ztank/test/vol@2 - 220K - - - - 1.00x - - - -
baal3 /root # zfs snapshot -r ztank/test@3
baal3 /root # zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation ztank/test
NAME NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD RATIO QUOTA REFQUOTA RESERV REFRESERV
ztank/test ztank/test 6.59T 8.05G 0 31K 0 8.05G 1.00x none none none none
ztank/test@1 ztank/test@1 - 0 - - - - 1.00x - - - -
ztank/test@2 ztank/test@2 - 0 - - - - 1.00x - - - -
ztank/test@3 ztank/test@3 - 0 - - - - 1.00x - - - -
ztank/test/vol ztank/test/vol 6.59T 8.05G 475K 2.89G 5.16G 0 1.00x - - none 5.16G
ztank/test/vol@1 ztank/test/vol@1 - 208K - - - - 1.00x - - - -
ztank/test/vol@2 ztank/test/vol@2 - 220K - - - - 1.00x - - - -
ztank/test/vol@3 ztank/test/vol@3 - 0 - - - - 1.00x - - - -
baal3 /root # uname -a
FreeBSD baal3.kommunity.net 9.1-RELEASE-p3 FreeBSD 9.1-RELEASE-p3 #0: Mon Apr 29 18:27:25 UTC 2013 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64