Cannot create snapshot: out of space

Status
Not open for further replies.

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
 

tmueko

Explorer
Joined
Jun 5, 2012
Messages
82

I have not found out, when this Problem happens: My actual guess is, thats this only happens in raidz. When time, I'll try to reproduce in a vm.

But this drives me crasy:
Code:
[root@babytillmann] ~# zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation daten
NAME          NAME          AVAIL  USED  USEDSNAP  USEDDS  USEDREFRESERV  USEDCHILD  RATIO  QUOTA  REFQUOTA  RESERV  REFRESERV
daten        daten          542G  2.06T        0    209K              0      2.06T  1.30x  none      none    none      none
daten/zvol01  daten/zvol01  881G  1.03T        0    717G          339G          0  1.34x      -        -    none      1.03T
daten/zvol02  daten/zvol02  929G  1.03T        0    670G          387G          0  1.26x      -        -    none      1.03T
 
 
[root@babytillmann] ~# zfs snapshot -r daten@1
cannot create snapshot 'daten/zvol02@1': out of space
cannot create snapshot 'daten/zvol01@1': out of space
no snapshots were created
 
D

dlavigne

Guest
Yeah, there seems to be lots of "out of space" threads with no clear answer. Perhaps opening an issue on that as well might get some clarification from the devs? It may turn out to be a doc bug rather than a software bug--either way a clear answer should be made available.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
Did you try removing the REFRESERVation?
I found this in the ZFS docs:
If refreservation is set, a snapshot is only allowed if there is
enough free pool space outside of this reservation to accommodate the
current number of "referenced" bytes in the dataset.
 

tmueko

Explorer
Joined
Jun 5, 2012
Messages
82
In the last example there are 542G outside of the reservation and removing it, would turn my zvols into "thin provisioned" zvols which i don't want...
But I have to give it a try. If you are right, we are back at dlavignes "doc bug" :-|
 

tmueko

Explorer
Joined
Jun 5, 2012
Messages
82
yyyiiiiiiihaaaaaa:

Code:
[root@babytillmann] ~# zfs set refreservation=none daten/zvol01
[root@babytillmann] ~# zfs set refreservation=none daten/zvol02
[root@babytillmann] ~# zfs snapshot -r daten@1
[root@babytillmann] ~# zfs list -t all -ro name,space,compressratio,quota,refquota,reservation,refreservation daten
NAME                                NAME                                AVAIL  USED  USEDSNAP  USEDDS  USEDREFRESERV  USEDCHILD  RATIO  QUOTA  REFQUOTA  RESERV  REFRESERV
daten                              daten                              1.24T  1.35T        0    209K              0      1.35T  1.30x  none      none    none      none
daten@1                            daten@1                                -      0        -      -              -          -  1.00x      -        -      -          -
daten@auto-20130919.2023-4w        daten@auto-20130919.2023-4w            -      0        -      -              -          -  1.00x      -        -      -          -
daten/zvol01                        daten/zvol01                        1.24T  717G    20.6M    717G              0          0  1.34x      -        -    none      none
daten/zvol01@1                      daten/zvol01@1                          -  8.46M        -      -              -          -  1.34x      -        -      -          -
daten/zvol01@auto-20130919.2023-4w  daten/zvol01@auto-20130919.2023-4w      -  3.54M        -      -              -          -  1.34x      -        -      -          -
daten/zvol02                        daten/zvol02                        1.24T  670G    33.6M    670G              0          0  1.26x      -        -    none      none
daten/zvol02@1                      daten/zvol02@1                          -  15.9M        -      -              -          -  1.26x      -        -      -          -
daten/zvol02@auto-20130919.2023-4w  daten/zvol02@auto-20130919.2023-4w      -  7.41M        -      -              -          -  1.26x      -        -      -          -

 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
;)
I think you can convert the REFRESERVATION to plain RESERVATION and the snapshots will work.
It's nicely explained here: nex7.blogspot.sk/2013/03/reservation-ref-reservation-explanation.html
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
The "problem" with REFRESERVation is that if your zvol has 500GB you need at least 500GB outside the reservation to create a snapshot. Yes, the snapshot consumes almost nothing when you create it, but the systems needs to make sure that there will be enough capacity even if you decide to completely overwrite the zvol with new data. In that case the size of the snapshot will grow to 500GB (to hold the previous zvol content) and that's why zfs refuses to create a snapshot even if you have plenty GBs of free space (but less than the data referenced by the zvol).
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403

Kostya Berger

Dabbler
Joined
Sep 10, 2013
Messages
10
So, I've unset the reservation to "0" and, lo and behold, snapshots get created without a single squeak. Reading documentation helps, too ;). What I actually need is "quota" (limit the space used by dataset) and not "reservation" (make sure certain minimum is available).
 
Status
Not open for further replies.
Top