From owner-freebsd-stable@FreeBSD.ORG Fri Dec 6 16:47:46 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB148179 for ; Fri, 6 Dec 2013 16:47:46 +0000 (UTC) Received: from mail-oa0-x22b.google.com (mail-oa0-x22b.google.com [IPv6:2607:f8b0:4003:c02::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 90D1C1DEA for ; Fri, 6 Dec 2013 16:47:46 +0000 (UTC) Received: by mail-oa0-f43.google.com with SMTP id i7so1066663oag.16 for ; Fri, 06 Dec 2013 08:47:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=YzqDUyYhBzxdCxy2uMYDVOBC7EGRSw4w50yUZwotGKY=; b=f+ahWoifEkLpFOJW8y0HWwtdFfZLJoG+jkqhcwoZCX51hLEEn2jx/YJbJcGBQKMSHU L98aTCSy1ARrcYzlqyldkPIbe7SP9ijMQYJSQfa6M1MyZ1bO9y+N988ohp78pFkiXkDh PC1Q8FmGIJla1su4YeYxjWQDOIpxylZfNYopCYCAvODTLPHQ28tTCS2VJqXr/4EK0f68 tt/cy1csE2kemqr9/p431P69uDJ7opoTDNLQBO0I1lkeeiduiS9LnxJ1TECMyf+YWhou LaccS8FDYuPkuRPsit8Xk+jqx+qJa06WcNHABHIaqavXVaB52VTD39fCZlzNvNvfFyV6 KbjQ== MIME-Version: 1.0 X-Received: by 10.60.136.132 with SMTP id qa4mr3212214oeb.68.1386348465278; Fri, 06 Dec 2013 08:47:45 -0800 (PST) Received: by 10.76.132.9 with HTTP; Fri, 6 Dec 2013 08:47:45 -0800 (PST) In-Reply-To: References: Date: Fri, 6 Dec 2013 08:47:45 -0800 Message-ID: Subject: Re: Does FreeBSD's ZFS reserve 1/64 of the capacity for COW? From: Freddie Cash To: =?UTF-8?Q?Trond_Endrest=C3=B8l?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: FreeBSD stable X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Dec 2013 16:47:47 -0000 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