From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WIUXFQNr8l8DLQAA0tVLHw (envelope-from ) for ; Mon, 04 Jan 2021 01:10:27 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KGfiEANr8l/aEgAAB5/wlQ (envelope-from ) for ; Mon, 04 Jan 2021 01:10:27 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C17DF940367 for ; Mon, 4 Jan 2021 01:10:26 +0000 (UTC) Received: from localhost ([::1]:58966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwEO9-0001jB-PY for larch@yhetil.org; Sun, 03 Jan 2021 20:10:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwENm-0001id-Us for guix-patches@gnu.org; Sun, 03 Jan 2021 20:10:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55695) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kwENm-00028w-NK for guix-patches@gnu.org; Sun, 03 Jan 2021 20:10:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kwENm-0003jg-Ie for guix-patches@gnu.org; Sun, 03 Jan 2021 20:10:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45643] [PATCH 3/3] gnu, guix: Support mounting legacy-mounted ZFS in operating-system form. References: In-Reply-To: Resent-From: raid5atemyhomework Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 04 Jan 2021 01:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45643 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "45643@debbugs.gnu.org" <45643@debbugs.gnu.org> Received: via spool by 45643-submit@debbugs.gnu.org id=B45643.160972259114339 (code B ref 45643); Mon, 04 Jan 2021 01:10:02 +0000 Received: (at 45643) by debbugs.gnu.org; 4 Jan 2021 01:09:51 +0000 Received: from localhost ([127.0.0.1]:39008 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwENb-0003jD-7w for submit@debbugs.gnu.org; Sun, 03 Jan 2021 20:09:51 -0500 Received: from mail4.protonmail.ch ([185.70.40.27]:35108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwENY-0003iz-R8 for 45643@debbugs.gnu.org; Sun, 03 Jan 2021 20:09:49 -0500 Date: Mon, 04 Jan 2021 01:09:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1609722582; bh=H87PBleY3IgFM5yRiyzugIx+XG1IQXiF0pwTOlb2BPU=; h=Date:To:From:Reply-To:Subject:From; b=DYcRs2p++7LkvChB4nv4XDIZcBCQ53Uox3EVoahAWFRlon83aHMjL3FLYczFwGRva 1u9SClxJkjhZ8PoRmIFYlB4LJfXeMbwB0F5NStpyJlchJTRMVR2K/LMUg5A4UsE/WS R4RTlYtyDOPBlNJqZdIjNoofNXh92WTiQRLcx6LU= Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: raid5atemyhomework , raid5atemyhomework via Guix-patches From: raid5atemyhomework via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.33 Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=protonmail.com header.s=protonmail header.b=DYcRs2p+; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: C17DF940367 X-Spam-Score: -1.33 X-Migadu-Scanner: scn1.migadu.com X-TUID: VMJHowv3PWx1 >From 59c9bd5642e33962798c01f4dcf30be38ead4ab8 Mon Sep 17 00:00:00 2001 From: raid5atemyhomework Date: Mon, 4 Jan 2021 08:22:01 +0800 Subject: [PATCH 3/3] gnu, guix: Support mounting legacy-mounted ZFS in operating-system form. --- doc/guix.texi | 18 ++++++++++++++++++ gnu/build/file-systems.scm | 2 ++ gnu/machine/ssh.scm | 3 +++ gnu/services/base.scm | 5 ++++- guix/scripts/system.scm | 3 +++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 4544b481b0..2909674302 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13982,6 +13982,24 @@ mount ZFS pools that have a non-@code{legacy} moun= tpoint. If ZFS finds mountable ZFS filesystems that are encrypted by passphrase, it will prompt for passphrases on the console. +You should @emph{not} put ZFS datasets with a non-@code{legacy} mountpoint +into the @code{file-systems} field of your @code{operating-sstem}. However= , +if you want to declare them in your @code{file-systems} field, you can +set their ZFS mountpoints to @code{legacy} and add a @code{file-system} +declaration for them, using the ZFS pool dataset name as the @code{device} +field: + +@example +zfs set mountpoint=3Dlegacy pool/filesystem +@end example + +@lisp +(file-system + (device "pool/filesystem") + (mount-point "/path/to/mountpoint") + (type "zfs")) +@end lisp + You can put @code{/home} on a ZFS filesystem by setting it as the mountpoint of some ZFS filesystem. However, ZFS will refuse to mount onto a non-empty directory, so if you already have an existing diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index ddf6117b67..af75aee2b6 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm @@ -828,6 +828,8 @@ containing ':/')." ((string-prefix? "f2fs" type) check-f2fs-file-system) ((string-prefix? "ntfs" type) check-ntfs-file-system) ((string-prefix? "nfs" type) (const 'pass)) + ;; "ZFS doesn't need fsck." + ((string-prefix? "zfs" type) (const 'pass)) (else #f))) (if check-procedure diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm index 08c653ba17..cdd8913a00 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -175,6 +175,9 @@ exist on the machine." %pseudo-file-system-types)) ;; Don't try to validate network file systems. (not (string-prefix? "nfs" (file-system-type fs))) + ;; Don't try to validate ZFS file systems. + ;; XXX We should validate these by 'zfs status'. + (not (string-prefix? "zfs" (file-system-type fs))) (not (memq 'bind-mount (file-system-flags fs))))) (operating-system-file-systems (machine-operating-system machi= ne)))) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index deffd49154..dcacc5b4b8 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -322,7 +322,10 @@ FILE-SYSTEM." (shepherd-service (provision (list (file-system->shepherd-service-name file-syst= em))) (requirement `(root-file-system udev - ,@(map dependency->shepherd-service-name depend= encies))) + ,@(map dependency->shepherd-service-name depend= encies) + ,@(if (string-prefix? "zfs" (file-system-type f= ile-system)) + '(zfs-loader) + '()))) (documentation "Check, mount, and unmount the given file syste= m.") (start #~(lambda args #$(if create? diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 0dcf2b3afe..1515062ada 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -564,6 +564,9 @@ any, are available. Raise an error if they're not." %pseudo-file-system-types)) ;; Don't try to validate network file systems. (not (string-prefix? "nfs" (file-system-type fs))) + ;; Don't try to validate ZFS file systems. + ;; XXX We should validate these by 'zfs status'. + (not (string-prefix? "zfs" (file-system-type fs))) (not (memq 'bind-mount (file-system-flags fs))))) file-systems)) -- 2.29.2