From owner-freebsd-current@freebsd.org Sat Mar 28 15:36:42 2020 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 542612A58C2 for ; Sat, 28 Mar 2020 15:36:42 +0000 (UTC) (envelope-from grahamperrin@gmail.com) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48qN9t0Bk3z3J1Q; Sat, 28 Mar 2020 15:36:32 +0000 (UTC) (envelope-from grahamperrin@gmail.com) Received: by mail-wr1-x42a.google.com with SMTP id t7so15326184wrw.12; Sat, 28 Mar 2020 08:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=Qlw9PMpkzyEeQUoV5wPKk2XRtrCsd5dAfZp9s7oj1r8=; b=pFO47l7oP+dNqb5Bwpx64wI3zzGYIdHnqOT4I4treyc+CUhBExK0wXUGDrzY8puVag ODNnSsbac4AhCgtXuBBi2xQLsQzSJ63XsuFGEAosgHZ6YREQwyLwJA6WmHeQCxzXEq1o 6WrLaEX795rVjGQC9REC7udyWkmZqqxpx8THX2bn7LbC44CyronjItyLMlQYKfod5dHE D7cT4f77jtNP55miRn1vc/gfznVupxcr5vyMR8VOj9DIgPkL8EKU9O4hSTiz8USMCKtQ 3zvsOBMKRmMBH03sll5qdcRrcWxntCoU+wsON+7BTzmw8XSb1eygNNrQuRJ4euTCdiIx okow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Qlw9PMpkzyEeQUoV5wPKk2XRtrCsd5dAfZp9s7oj1r8=; b=hmYFlVqWGAqOaxJKVvY6p7jw/cc13RyLJihgwvmrpqaOA5Ee8SNuNTSZEqfMsuYQS6 RQ98FR70Ou54YGG21xKOZPXdijNVflh5WMYH1pLXbkiVsRJ2kFoU/q7MdBKI/tf+VzfO 6spuoPuoUDeFkVacaX+/x16VGRG6MNi7f2eX80KKW7L1yKUpzjuX2hU65o+6kaf37vGt wWgcbxNdsVkxor8aq5Bcni+VSvrNWsrURwQh6Fx3n04zXa5LpgUQqmZuGm1cpCUwbBNn F7SysAnlONP1GD9CVP5r7FkD55764YPz7KaolN1MH0ddtiUKVxSpFx95Ig9KZqnf760T GITw== X-Gm-Message-State: ANhLgQ1KoBGO2HcsnIeSgBZujj9i5d/oIhUjOhtsDdMCI3es/K3/TZDK THqDSmC2IPyb8IVLKQluWCzOFL8cpdY= X-Google-Smtp-Source: ADFU+vs+nB1LMfFbkp55Mv96wOHS1EurSt09tASq5+5K1sLILZdyGbFE2M7ma7kayj+v3bDuWvOBRQ== X-Received: by 2002:adf:9dca:: with SMTP id q10mr5212348wre.11.1585409781972; Sat, 28 Mar 2020 08:36:21 -0700 (PDT) Received: from [192.168.1.7] (79-66-147-78.dynamic.dsl.as9105.com. [79.66.147.78]) by smtp.gmail.com with ESMTPSA id g127sm13181519wmf.10.2020.03.28.08.36.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 28 Mar 2020 08:36:21 -0700 (PDT) Subject: Re: ZFS: destroying snapshots without compromising boot environments To: Allan Jude References: <14266e74-e2cc-ec14-187a-4bc9c9e6c32a@gmail.com> <1c2b71fa-b25c-21d4-2115-ddb3d7b129b2@freebsd.org> Cc: freebsd-current@freebsd.org From: Graham Perrin Message-ID: <01524fd0-ae7b-028b-6259-5da485b48886@gmail.com> Date: Sat, 28 Mar 2020 15:36:20 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <1c2b71fa-b25c-21d4-2115-ddb3d7b129b2@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Rspamd-Queue-Id: 48qN9t0Bk3z3J1Q X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=pFO47l7o; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of grahamperrin@gmail.com designates 2a00:1450:4864:20::42a as permitted sender) smtp.mailfrom=grahamperrin@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[78.147.66.79.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.00)[ip: (-9.26), ipnet: 2a00:1450::/32(-2.38), asn: 15169(-0.47), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[a.2.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Mar 2020 15:36:42 -0000 On 28/03/2020 15:19, Allan Jude wrote: > You can try to destroy the snapshot, if it is the basis of a clone, then > you will get an error, that you'd need to destroy the BE first, so you > might decide to keep that snapshot. As long as you don't use the -R flag > to zfs destroy dataset@snapshot, it will not destroy the clones. > > You can also use 'zfs promote' to make the clone into the parent, making > the original parent into the clone. This allows you to destroy that > original and the snapshot while keeping the clone. Perfect, thank you. I was nervous about destruction without warning. Below, are the differences (in measurement) between beadm and bectl to be expected? ---- root@momh167-gjp4-8570p:~ # beadm list BE       Active Mountpoint  Space Created Waterfox -      -           15.9G 2020-03-10 18:24 r357746f -      -            1.3G 2020-03-20 06:19 r359249b NR     /           74.7G 2020-03-28 01:19 root@momh167-gjp4-8570p:~ # beadm list -aDs BE/Dataset/Snapshot                            Active Mountpoint Space Created Waterfox   copperbowl/ROOT/Waterfox                     -      - 137.0M 2020-03-10 18:24     r359249b@2020-03-17-21:57:17               -      - 59.2G 2020-03-17 21:57   copperbowl/ROOT/Waterfox@2020-03-20-06:19:45 -      - 67.0M 2020-03-20 06:19 r357746f   copperbowl/ROOT/r357746f                     -      - 1.2G 2020-03-20 06:19     Waterfox@2020-03-20-06:19:45               -      - 59.2G 2020-03-20 06:19 r359249b   copperbowl/ROOT/r359249b@2020-03-17-21:57:17 -      - 15.7G 2020-03-17 21:57   copperbowl/ROOT/r359249b                     NR     / 59.0G 2020-03-28 01:19 root@momh167-gjp4-8570p:~ # bectl list BE       Active Mountpoint Space Created Waterfox -      -          204M  2020-03-10 18:24 r357746f -      -          1.21G 2020-03-20 06:19 r359249b NR     /          74.7G 2020-03-28 01:19 root@momh167-gjp4-8570p:~ # bectl list -aDs BE/Dataset/Snapshot                              Active Mountpoint Space Created Waterfox   copperbowl/ROOT/Waterfox                       -      - 204M  2020-03-10 18:24   Waterfox@2020-03-20-06:19:45                   -      - 67.0M 2020-03-20 06:19 r357746f   copperbowl/ROOT/r357746f                       -      - 1.21G 2020-03-20 06:19 r359249b   copperbowl/ROOT/r359249b                       NR     / 74.7G 2020-03-28 01:19   r359249b@2020-03-17-21:57:17                   -      - 15.7G 2020-03-17 21:57 root@momh167-gjp4-8570p:~ # zfs list -t snapshot NAME                                                     USED AVAIL  REFER  MOUNTPOINT copperbowl/ROOT/Waterfox@2020-03-20-06:19:45            67.0M -  59.2G  - copperbowl/ROOT/r359249b@2020-03-17-21:57:17            15.7G -  59.2G  - copperbowl/iocage/releases/12.0-RELEASE/root@jbrowsers     8K -  1.24G  - copperbowl/poudriere/jails/head@clean                    328K -  1.89G  - root@momh167-gjp4-8570p:~ # zfs destroy copperbowl/ROOT/r359249b@2020-03-17-21:57:17 cannot destroy 'copperbowl/ROOT/r359249b@2020-03-17-21:57:17': snapshot has dependent clones use '-R' to destroy the following datasets: copperbowl/ROOT/r357746f copperbowl/ROOT/Waterfox@2020-03-20-06:19:45 copperbowl/ROOT/Waterfox root@momh167-gjp4-8570p:~ # date ; uname -v Sat Mar 28 15:30:57 GMT 2020 FreeBSD 13.0-CURRENT #1 r359249: Tue Mar 24 00:12:27 GMT 2020 root@momh167-gjp4-8570p:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG root@momh167-gjp4-8570p:~ #