From nobody Wed Oct 20 10:51:18 2021 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 180A61809F71 for ; Wed, 20 Oct 2021 10:50:49 +0000 (UTC) (envelope-from henrix@camandro.org) Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) (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 4HZ6pc0ZF8z4qL1 for ; Wed, 20 Oct 2021 10:50:48 +0000 (UTC) (envelope-from henrix@camandro.org) Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:105:465:1:3:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4HZ6pS0YxNzQkgs for ; Wed, 20 Oct 2021 12:50:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Date: Wed, 20 Oct 2021 11:51:18 +0100 From: =?iso-8859-1?Q?Lu=EDs?= Henriques To: freebsd-questions@freebsd.org Subject: zfs: backup unencrypted datasets into encrypted datasets Message-ID: List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4HZ6pc0ZF8z4qL1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of henrix@camandro.org designates 80.241.56.172 as permitted sender) smtp.mailfrom=henrix@camandro.org X-Spamd-Result: default: False [-2.84 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:80.241.56.0/21]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.99)[-0.995]; RCVD_IN_DNSWL_LOW(-0.10)[80.241.56.172:from]; DMARC_NA(0.00)[camandro.org]; NEURAL_HAM_SHORT(-1.00)[-0.999]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:199118, ipnet:80.241.56.0/21, country:DE]; RCVD_COUNT_TWO(0.00)[2]; R_MIXED_CHARSET(0.56)[subject]; RWL_MAILSPIKE_POSSIBLE(0.00)[80.241.56.172:from] X-ThisMailContainsUnwantedMimeParts: N Hi! I'm sending this question to this mailing-list after not getting any feedback on the freebsd forums. Hopefully I'll have more lucky here. This is probably a trivial question, but I'm failing to figure it out myself after reading a lot of documentation. I've my laptop running an up-to-date 13.0-RELEASE, with zfs on top of geli. So, datasets are *not* encrypted, but encryption is done on the lower level. I've a single snapshot in my home dataset: # zfs list -t snapshot zroot/usr/home NAME USED AVAIL REFER MOUNTPOINT zroot/usr/home@2021-10-19_13h50 2.87M - 13.3G which I'd like to backup into my external USB drive, which is zfs as well, but not using geli (as I'd like to share it with other non-freebsd computer). Thus, I've create the following in my external drive: # zfs create -o encryption=on -o keyformat=passphrase backups/root # zfs create -o encryption=on backups/root/orpheus-home When I try to send my snapshot, here's what I see: # zfs send -v -R zroot/usr/home@2021-10-19_13h50 | zfs recv -x encryption backups/root/orpheus-home full send of zroot/usr/home@2021-10-19_13h50 estimated size is XXXG total estimated size is XXXG cannot receive new filesystem stream: destination 'backups/root/orpheus-home' exists must specify -F to overwrite it warning: cannot send 'zroot/usr/home@2021-10-19_13h50': signal received Ok, let me try to use the suggested option: # zfs send -v -R zroot/usr/home@2021-10-19_13h50 | zfs recv -F -x encryption backups/root/orpheus-home full send of zroot/usr/home@2021-10-19_13h50 estimated size is XXXG total estimated size is XXXG cannot receive new filesystem stream: zfs receive -F cannot be used to destroy an encrypted filesystem or overwrite an unencrypted one with an encrypted one warning: cannot send 'zroot/usr/home@2021-10-19_13h50': signal received I've tried to use "-o keyformat=raw -o keylocation=file://..." instead of "-x encryption" on the received size (after changing the key format, of course), but the result is exactly the same. And I'm puzzled, with no idea where to go from here. Is this a limitation of zfs, or is this zfs just telling me I'm doing something really stupid? Thanks for any hint that would help me sorting this out. Cheers, -- Luís