Date: Fri, 6 Dec 2013 08:47:45 -0800 From: Freddie Cash <fjwcash@gmail.com> To: =?UTF-8?Q?Trond_Endrest=C3=B8l?= <Trond.Endrestol@fagskolen.gjovik.no> Cc: FreeBSD stable <freebsd-stable@freebsd.org> Subject: Re: Does FreeBSD's ZFS reserve 1/64 of the capacity for COW? Message-ID: <CAOjFWZ6fd0dGCgcbvV6T=nw=VFUfdcRCu4DcMiQxZxyt4E=vrg@mail.gmail.com> In-Reply-To: <alpine.BSF.2.00.1312061325420.75198@mail.fig.ol.no> References: <alpine.BSF.2.00.1312061325420.75198@mail.fig.ol.no>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 6, 2013 at 4:46 AM, Trond Endrest=C3=B8l < Trond.Endrestol@fagskolen.gjovik.no> wrote: > Hi, > > Today I came across "Becoming a ZFS Ninja Part 1" > http://www.youtube.com/watch?v=3DtPsV_8k-aVU featuring Ben Rockwood who > stated that ZFS reserves 1/64 of the capacity for COW safe-guarding. > Fast forward to 00:49:44. Thus, one should take this fact into account > when planning the storage capacity of your (larger) zpools. > > Does FreeBSD's ZFS also reserve 1/64 of the capacity for COW? > > If it's true, then I guess this should be noted in zpool(8) and in the > Handbook. > > Any comments or insights? > Do you think I should file a PR? > > Have a nice weekend! ;-) > Based on the experience I went through a week or so ago, I would have to say, no. (Unless this is an unrelated issue.) I filled a 75 TB pool 100% full, 0 bytes left. Was unable to delete files, was unable to "cp /dev/null" files, was unable to truncate files.=E2=80=8B= =E2=80=8B Mostly due to snapshots and "deleting" a file actually marks the blocks as part of the previous snapshot and updates a bunch of metadata. And, was unable to destroy any snapshots as there was 0 space to write out metadata. Thankfully, I had 1 ZFS filesystem without any snapshots, and I was able to successfully delete files from that dataset. Once a few MB of free space was made available, then I was able to start deleting snapshots =E2=80=8BI now have a dataset on each ZFS pool called "do-not-delete" with = a 1 GB reservation (and no snapshots). This way, if the pool ever gets filled to 100% (and it did a few days later), it's a simple matter to "create" free space: # zfs set reservation=3D512M storage/do-not-delete =E2=80=8B Then delete some snapshots, and set the reservation back to 1 GB. I've now hit the 100% full issue 3 times. Twice, the do-not-delete reservation saved me. --=20 Freddie Cash fjwcash@gmail.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOjFWZ6fd0dGCgcbvV6T=nw=VFUfdcRCu4DcMiQxZxyt4E=vrg>