From owner-freebsd-questions@freebsd.org Wed Jun 10 16:48:36 2020 Return-Path: Delivered-To: freebsd-questions@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 49A00339906 for ; Wed, 10 Jun 2020 16:48:36 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from bede.qeng-ho.org (bede.qeng-ho.org [217.155.128.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49htGq0tTRz4FwZ for ; Wed, 10 Jun 2020 16:48:34 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from arthur.home.qeng-ho.org (arthur.home.qeng-ho.org [172.23.1.2]) by bede.qeng-ho.org (Postfix) with ESMTP id 230D410193; Wed, 10 Jun 2020 17:48:28 +0100 (BST) Subject: Re: Q. re: zfs clones and promote To: byrnejb@harte-lyne.ca, freebsd-questions@freebsd.org References: <69ee92064444771e23d47418afad2f3e.squirrel@webmail.harte-lyne.ca> From: Arthur Chance Message-ID: <31daba1b-f340-d433-eca2-088fb676b7d8@qeng-ho.org> Date: Wed, 10 Jun 2020 17:48:27 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <69ee92064444771e23d47418afad2f3e.squirrel@webmail.harte-lyne.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49htGq0tTRz4FwZ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@qeng-ho.org designates 217.155.128.241 as permitted sender) smtp.mailfrom=freebsd@qeng-ho.org X-Spamd-Result: default: False [-2.64 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.003]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:217.155.128.240/29]; NEURAL_HAM_LONG(-0.99)[-0.995]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[qeng-ho.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.35)[-0.346]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:13037, ipnet:217.155.0.0/16, country:GB]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2020 16:48:36 -0000 On 10/06/2020 16:54, James B. Byrne via freebsd-questions wrote: > > I am working on a clone of a template jail in IOCAGE. My thoughts were tht if > things go horribly wrong then I can simply remove the clone and start again > from the template. If things work out then I can promote the clone. > > However, I am not clear on the implications of promote. I just want to go > thorugh this so that any misapprehension that I have can be corrected: > > 1. A thick jail (X) is created via iocage. > 2. Jail X is started, has a specific suit of packages installed, and is stopped. > 3. Jail Xc is cloned from X. > 4. Jail Xc is started, additional packages added and configured, setup as > desired for its intended purpose, and stopped. > > Now, I read this in the zfs man page: > > The clone parent-child dependency relationship can be reversed by using > the promote subcommand. This causes the "origin" file system to become a > clone of the specified file system, which makes it possible to destroy > the file system that the clone was created from. > > The way that this is worded can be interpreted that Xc becomes the file system > and X the clone of Xc, which can then be destroyed. What I wish to have is > both X and Xc as independent zfs file systems. Is this not possible using > promote or must I use zfs send to obtain this result? > > I read the manual entry as saying that after promote you *can* delete the original file system but you don't have to. What you have after a clone is two file systems with one (the clone) being a "side shoot" of the original that "borrows" the original data, so the original cannot be destroyed while the clone exists because of the borrowed data, whereas destroying the clone only deletes back to the fork. This only matters if you want to destroy one of the two file systems, and promote switches the original/side shoot relationship so you can choose which file system you want to delete. If you need to have two completely independent file systems with no sharing of data you'll need zfs send | zfs recv to create a copy. -- Fat Earther: One who believes the world is round but has put on too much weight round the middle.