From unknown Sat Aug 16 10:50:18 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#45643 <45643@debbugs.gnu.org> To: bug#45643 <45643@debbugs.gnu.org> Subject: Status: [PATCH 0/3] Better Support for ZFS on Guix Reply-To: bug#45643 <45643@debbugs.gnu.org> Date: Sat, 16 Aug 2025 17:50:18 +0000 retitle 45643 [PATCH 0/3] Better Support for ZFS on Guix reassign 45643 guix-patches submitter 45643 raid5atemyhomework severity 45643 normal tag 45643 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 03 20:02:38 2021 Received: (at submit) by debbugs.gnu.org; 4 Jan 2021 01:02:38 +0000 Received: from localhost ([127.0.0.1]:38991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwEGc-0003YF-5o for submit@debbugs.gnu.org; Sun, 03 Jan 2021 20:02:38 -0500 Received: from lists.gnu.org ([209.51.188.17]:49194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwEGa-0003Y6-7y for submit@debbugs.gnu.org; Sun, 03 Jan 2021 20:02:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwEGa-0008GA-1N for guix-patches@gnu.org; Sun, 03 Jan 2021 20:02:36 -0500 Received: from mail-40141.protonmail.ch ([185.70.40.141]:61963) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwEGW-0007z5-Rx for guix-patches@gnu.org; Sun, 03 Jan 2021 20:02:35 -0500 Date: Mon, 04 Jan 2021 01:02:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1609722149; bh=MtqWHyTFjXNj1OdDmkAr8BW1wORE+xVii4yjgrLSxps=; h=Date:To:From:Reply-To:Subject:From; b=w1qPPJO5E51voUjL+dikvhipST8akHybLqX3vN2rKbKcmTwmLq5DTSJcKiHbZjj6P WxcSoe6U+EynhpNQQuVs6NJufstQATRLFuMmF4bqh6HUA8b6QocZGpTasOs/FUEeRJ oHXBCMiL/8i6EZt/M4o42ZCMs6tsHT4jTHKDpy1M= To: "guix-patches@gnu.org" From: raid5atemyhomework Subject: [PATCH 0/3] Better Support for ZFS on Guix Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Received-SPF: pass client-ip=185.70.40.141; envelope-from=raid5atemyhomework@protonmail.com; helo=mail-40141.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: raid5atemyhomework Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) ZFS package is broken, and we should really recompile ZFS at each kernel up= date anyway. This patchset includes: * Patch 1: * Fixes for "util-linux" dependency which causes problems with mounting Z= FS datasets. * Expose a "make-zfs-package" procedure to create kernel-specific ZFS pac= kages as suggested here: https://issues.guix.gnu.org/45403#3 * Add a service "zfs-loader-service-type" that provisions "zfs-loader", t= hat modprobes ZFS and automounts ZFS datasets at bootup. The latter behavio= r is what is expected of ZFS from other OSs, so it's best to imitate that a= s well. * Document how to set up and use the above. * This makes ZFS on Guix actually *possible*. Tested in a VM. * Patch 2: * Make the "file-systems" provisioning service a target similar to "user-= processes", so that other services can insert themselves into "file-systems= " mounting. * Make the "zfs-loader" part of the "file-systems" target if it is instan= tiated. * This enables /home on ZFS (previous patch is not enough as "user-homes"= service is part of the "user-processes"; we need to make ZFS loading and m= ounting earlier). * Patch 3 * Disable checking of "device" field for declared file-systems that are o= f type "zfs". * Make file-systems of type "zfs" dependent on "zfs-loader" to ensure tha= t "zfs" module is loaded and all pools are imported and known by the ZFS mo= dule. * This enables declaring ZFS datasets as (file-system ...) declarations, = if the sysad wants to explicitly document the mountpoints in the configurat= ion file rather than having ZFS manage mountpoints. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 03 20:05:41 2021 Received: (at 45643) by debbugs.gnu.org; 4 Jan 2021 01:05:41 +0000 Received: from localhost ([127.0.0.1]:38999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwEJY-0003d8-U7 for submit@debbugs.gnu.org; Sun, 03 Jan 2021 20:05:41 -0500 Received: from mail-40140.protonmail.ch ([185.70.40.140]:47487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwEJW-0003cu-Rs for 45643@debbugs.gnu.org; Sun, 03 Jan 2021 20:05:39 -0500 Date: Mon, 04 Jan 2021 01:05:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1609722331; bh=8uBPq24ZQAcju/6ftAX6kgwPoVVUnBL2FQolRQsnxwc=; h=Date:To:From:Reply-To:Subject:From; b=Q2yN18vW1esFyANKckGQNYY/uS7EEcdq6fZ3ILk737tOLqXwHJ1jjaPvOxm1LDz3t H0AcmB0LftyHR4qcq5TUbe84CtvYzQ3xT3V5XU6TPKrax5HYCb29qXMzipGSjEwlR/ PqK4jDT0R1O32kzGU475kaOCCZ0+wqDwJxMro+sU= To: "45643@debbugs.gnu.org" <45643@debbugs.gnu.org> From: raid5atemyhomework Subject: [PATCH 1/3] gnu, doc: Create and document procedure to compile ZFS for specific kernel. Message-ID: <_yQ96oMMZ2qR6_Y7zRGocuGc7bzzQl5zF_6x-AEmsOFM4YnJvcpGzfcnHNBNhYl0LxPvPsac1rL6eHG63g5W58W9K76qXYwKa57-hu36AYI=@protonmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 45643 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: raid5atemyhomework Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) >From 004a84a38266eb8735f1e127f5794bf6d66b9272 Mon Sep 17 00:00:00 2001 From: raid5atemyhomework Date: Fri, 1 Jan 2021 20:26:42 +0800 Subject: [PATCH 1/3] gnu, doc: Create and document procedure to compile ZFS for specific kernel. --- doc/guix.texi | 100 ++++++++++++++++++++++++++++++++++ gnu/local.mk | 1 + gnu/packages/file-systems.scm | 25 ++++++++- gnu/services/file-systems.scm | 72 ++++++++++++++++++++++++ 4 files changed, 196 insertions(+), 2 deletions(-) create mode 100644 gnu/services/file-systems.scm diff --git a/doc/guix.texi b/doc/guix.texi index 1081ed26a3..5ad3907dbe 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13885,6 +13885,106 @@ a file system declaration such as: compress-force=3Dzstd,space_cache=3Dv2")) @end lisp +@node ZFS file system +@subsection ZFS file system + +The ZFS on Linux file system cannot legally be downloaded as part of the +Linux kernel, but you as a user can do anything on hardware you own, +including download ZFS as source code, compile ZFS as a kernel module, +and link it into Linux. + +As a large and complex kernel module, ZFS has to be compiled for a +specific version of Linux. Often the latest ZFS package available in Guix +cannot be compiled with the latest Linux kernel available in Guix, so +installing the @code{zfs} package in your system configuration file will +fail. + +Instead, you have to check the +@url{https://github.com/openzfs/zfs/releases,OpenZFS release notes} for +the specific version of ZFS that Guix has packaged to determine what +Linux kernels you can use, then check the @code{linux-libre} packages +that Guix has packaged, and select one you can use on your system. + +Then, you have to modify your system configuration file, and create a +ZFS package that compiles using the specific Linux version you chose. +Below is a sketch of how you would modify your @code{operating-system} +declaration in order to set up ZFS: + +@lisp +(use-modules (gnu)) +;; @dots{} +(use-service-modules + ; @dots{} + file-systems) +(use-package-modules + ; @dots{} + linux + file-systems) + +;; @dots{} + +;;; (1) Select a specific kernel. +(define system-kernel linux-libre-5.4) +;;; (2) Define a ZFS package for your kernel. +(define system-zfs (make-zfs-package system-kernel)) + +;; @dots{} + +(operating-system + ;;; (3) Specify your selected kernel. + (kernel system-kernel) + ;;; (4) Add the "module" output of the system ZFS package to + ;;; the kernel-loadable modules. + (kernel-loadable-modules (list (list system-zfs "module"))) + + ;; @dots{} + + (packages + ;;; (5) Add the system ZFS package to global packages so that + ;;; "zfs", "zpool" etc. commands are available. + (cons* system-zfs + ; @dots{} + %base-packages)) + + ;; @dots{} + + (services + ;;; (6) Add a service that loads ZFS and all ZFS pools at boot. + (cons* (service zfs-loader-service-type + system-zfs) + ; @dots{} + %base-services)) + ;; @dots{} + ) +@end lisp + +@deffn (Scheme Procedure) make-zfs-package @var{kernel} +This procedure creates a package which, when included as a package +in your system, can be loaded as a kernel module for the specified +@var{kernel}, a Linux kernel package. +It is intended to create a system-specific ZFS kernel module for +the Linux kernel you will use in your system. +@end deffn + +@deffn (Scheme Variable) zfs-loader-service-type +This is the service that loads the ZFS kernel module and imports all +ZFS pools. The value associated with @code{zfs-loader-service-type} +services must be the ZFS package you defined for your system, and +whose @code{"module"} output you have included as a loadable kernel +module. +@end deffn + +When you have modified your @code{operating-system} to include ZFS +as in the above and reconfigured and rebooted, you will now be able +to create, mount, and manage ZFS pools. At each boot, ZFS will +automatically open any ZFS pools it detects in your system, and will +mount ZFS pools that have a non-@code{legacy} mountpoint. If ZFS +finds mountable ZFS filesystems that are encrypted by passphrase, it +will prompt for passphrases on the console. + +ZFS as root filesystem is not supported yet. ZFS for @code{/home} is +also probably not easily doable yet. + @node Mapped Devices @section Mapped Devices diff --git a/gnu/local.mk b/gnu/local.mk index c03a8b9f51..e59a3bb9f7 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -601,6 +601,7 @@ GNU_SYSTEM_MODULES =3D=09=09=09=09\ %D%/services/dict.scm=09=09=09=09\ %D%/services/dns.scm=09=09=09=09\ %D%/services/docker.scm=09=09=09\ + %D%/services/file-systems.scm=09=09=09\ %D%/services/authentication.scm=09=09\ %D%/services/games.scm=09=09=09\ %D%/services/ganeti.scm=09=09=09\ diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm index 895ad069c5..e8f49a59fa 100644 --- a/gnu/packages/file-systems.scm +++ b/gnu/packages/file-systems.scm @@ -944,16 +944,37 @@ APFS.") ("openssl" ,openssl) ("python" ,python) ("python-cffi" ,python-cffi) - ("util-linux" ,util-linux "lib") + ("util-linux" ,util-linux) + ("util-linux-lib" ,util-linux "lib") ("zlib" ,zlib))) (home-page "https://zfsonlinux.org/") (synopsis "Native ZFS on Linux") (description "ZFS on Linux is an advanced file system and volume manager which was originally developed for Solaris and is now maintained by the OpenZFS -community.") +community. + +DO NOT INSTALL THIS PACKAGE. Instead, refer to the 'ZFS file system' secti= on +of the Guix info manual for how to install ZFS.") (license license:cddl1.0))) +(define-public (make-zfs-package kernel) + (package + (inherit zfs) + (name (string-append "zfs-for-" + (package-name kernel) + "-" + (package-version kernel) + "-version")) + (arguments + (cons* #:linux kernel (package-arguments zfs))) + (description + "ZFS on Linux is an advanced file system and volume manager which was +originally developed for Solaris and is now maintained by the OpenZFS +community. + +This package has been compiled for a specific Linux kernel."))) + (define-public mergerfs (package (name "mergerfs") diff --git a/gnu/services/file-systems.scm b/gnu/services/file-systems.scm new file mode 100644 index 0000000000..bdc33f4028 --- /dev/null +++ b/gnu/services/file-systems.scm @@ -0,0 +1,72 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2021 raid5atemyhomework +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services file-systems) + #:use-module (guix gexp) + #:use-module (gnu services) + #:use-module (gnu services shepherd)) + +;;; ZFS +(define (zfs-loader-shepherd-service system-zfs) + (let* ((zpool (file-append system-zfs "/sbin/zpool"))) + (list + (shepherd-service + (documentation "Load ZFS kernel module and import ZFS pools.") + (provision '(zfs-loader)) + (requirement '(file-systems)) + (one-shot? #t) + (modules `((srfi srfi-1) + (srfi srfi-34) + (srfi srfi-35) + (rnrs io ports) + ,@%default-modules)) + (start #~(lambda _ + (if (not (file-exists? "/proc/sys/kernel/modprobe")) + (begin (format (current-error-port) "error: ~a~%" + "Kernel is missing loadable module su= pport.") + #f) + (and + (let ((modprobe (call-with-input-file + "/proc/sys/kernel/modprobe" get-= line))) + (guard (c ((message-condition? c) + (format (current-error-port) + "error loading 'zfs' kernel m= odule: ~a~%" + (condition-message c)) + #f)) + (invoke/quiet modprobe "--" "zfs"))) + (guard (c ((message-condition? c) + (format (current-error-port) + "error importing zpools: ~a~%" + (condition-message c)) + #f)) + ;; 'current-output-port' is typically connected = to /dev/klog + ;; in PID 1, so redirect it to the console so we= are talking + ;; to the user if zpool sees an encrpyted fs tha= t needs a + ;; passphrase. + (with-output-to-port (current-error-port) + (lambda () + (invoke #$zpool "import" "-a" "-l"))))))))))= )) + +(define-public zfs-loader-service-type + (service-type + (name 'zfs-loader) + (description "Load ZFS kernel module and import ZFS pools.") + (extensions + (list (service-extension shepherd-root-service-type zfs-loader-shepher= d-service) + (service-extension user-processes-service-type (const '(zfs-load= er))))))) + -- 2.29.2 From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 03 20:06:46 2021 Received: (at 45643) by debbugs.gnu.org; 4 Jan 2021 01:06:46 +0000 Received: from localhost ([127.0.0.1]:39004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwEKb-0003f2-Jb for submit@debbugs.gnu.org; Sun, 03 Jan 2021 20:06:45 -0500 Received: from mail-40137.protonmail.ch ([185.70.40.137]:54403) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwEKa-0003ep-5J for 45643@debbugs.gnu.org; Sun, 03 Jan 2021 20:06:44 -0500 Date: Mon, 04 Jan 2021 01:06:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1609722397; bh=Ld4GwnJKPEAGjcPN4LQCNb/ZTUuHB+22DrU5vZk6xDw=; h=Date:To:From:Reply-To:Subject:From; b=yI5a0tE1GFKjCrTls3qQnN7cTmuPC6ooUyTxb+tzsrP+BQWtYbywYd0MoHk6Yw4Ez 76aLFEX+aa8U768oo1w50K1EReNbvx5rzLReUYwvPWqkWgH7Szo00gXmo3OekVIkeN NX2mxmpWL+UhVnut52D6oSJQc9qIlWX8luYhvibM= To: "45643@debbugs.gnu.org" <45643@debbugs.gnu.org> From: raid5atemyhomework Subject: [PATCH 2/3] gnu: Make 'file-systems' target extensible. Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 45643 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: raid5atemyhomework Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >From fc4538963960550b678713ec46ac461cfbd6173e Mon Sep 17 00:00:00 2001 From: raid5atemyhomework Date: Sun, 3 Jan 2021 21:09:02 +0800 Subject: [PATCH 2/3] gnu: Make 'file-systems' target extensible. This is to support something like ZFS, which has a service that mounts ZFS file systems and does not normally use /etc/fstab --- doc/guix.texi | 9 +++++++-- gnu/services/base.scm | 37 +++++++++++++++++++++++++---------- gnu/services/file-systems.scm | 5 +++-- 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 5ad3907dbe..4544b481b0 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13982,8 +13982,13 @@ 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. -ZFS as root filesystem is not supported yet. ZFS for @code{/home} is -also probably not easily doable yet. +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 +@code{/home} you have to remove all files in it, then reboot to let +ZFS mount into @code{/home}. + +ZFS as root filesystem is not supported yet. @node Mapped Devices @section Mapped Devices diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 945b546607..deffd49154 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -66,6 +66,7 @@ %default-substitute-urls) #:export (fstab-service-type root-file-system-service + file-systems-service-type file-system-service-type swap-service host-name-service @@ -362,18 +363,30 @@ FILE-SYSTEM." (gnu system file-systems) ,@%default-modules))))))) +(define (file-systems-service requirements) + (list + (shepherd-service + (provision '(file-systems)) + (requirement (cons* 'root-file-system 'user-file-systems requirements= )) + (documentation "Target for all the initially-mounted file systems") + (start #~(const #t)) + (stop #~(const #t))))) + +(define file-systems-service-type + (service-type + (name 'file-systems) + (extensions (list (service-extension shepherd-root-service-type + file-systems-service))) + (compose concatenate) + (extend append) + ;; Extensions can add new services to this list. + (default-value '()) + (description "The @code{file-systems} service is the target that is st= arted +when all file systems have been mounted."))) + (define (file-system-shepherd-services file-systems) "Return the list of Shepherd services for FILE-SYSTEMS." (let* ((file-systems (filter file-system-mount? file-systems))) - (define sink - (shepherd-service - (provision '(file-systems)) - (requirement (cons* 'root-file-system 'user-file-systems - (map file-system->shepherd-service-name - file-systems))) - (documentation "Target for all the initially-mounted file systems") - (start #~(const #t)) - (stop #~(const #f)))) (define known-mount-points (map file-system-mount-point file-systems)) @@ -403,7 +416,7 @@ FILE-SYSTEM." (filter (negate known?) (mount-points))) #f)))) - (cons* sink user-unmount + (cons* user-unmount (map file-system-shepherd-service file-systems)))) (define (file-system-fstab-entries file-systems) @@ -431,6 +444,10 @@ FILE-SYSTEM." (service-extension fstab-service-type file-system-fstab-entries) + ;; Have 'file-systems' depend on each file-system + (service-extension file-systems-service-type + (cut map file-system->shepherd-s= ervice-name <>)) + ;; Have 'user-processes' depend on 'file-systems'. (service-extension user-processes-service-type (const '(file-systems))))) diff --git a/gnu/services/file-systems.scm b/gnu/services/file-systems.scm index bdc33f4028..73a6d52538 100644 --- a/gnu/services/file-systems.scm +++ b/gnu/services/file-systems.scm @@ -19,6 +19,7 @@ (define-module (gnu services file-systems) #:use-module (guix gexp) #:use-module (gnu services) + #:use-module (gnu services base) #:use-module (gnu services shepherd)) ;;; ZFS @@ -28,7 +29,7 @@ (shepherd-service (documentation "Load ZFS kernel module and import ZFS pools.") (provision '(zfs-loader)) - (requirement '(file-systems)) + (requirement '(root-file-system)) (one-shot? #t) (modules `((srfi srfi-1) (srfi srfi-34) @@ -68,5 +69,5 @@ (description "Load ZFS kernel module and import ZFS pools.") (extensions (list (service-extension shepherd-root-service-type zfs-loader-shepher= d-service) - (service-extension user-processes-service-type (const '(zfs-load= er))))))) + (service-extension file-systems-service-type (const '(zfs-loader= ))))))) -- 2.29.2 From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 03 20:09:51 2021 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= To: "45643@debbugs.gnu.org" <45643@debbugs.gnu.org> From: raid5atemyhomework Subject: [PATCH 3/3] gnu, guix: Support mounting legacy-mounted ZFS in operating-system form. Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 45643 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: raid5atemyhomework Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >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 From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 10 10:48:02 2021 Received: (at control) by debbugs.gnu.org; 10 Feb 2021 15:48:02 +0000 Received: from localhost ([127.0.0.1]:56947 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9rij-0005il-T4 for submit@debbugs.gnu.org; Wed, 10 Feb 2021 10:48:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l9rii-0005iT-Gb for control@debbugs.gnu.org; Wed, 10 Feb 2021 10:48:00 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45659) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9rid-0007jf-9N for control@debbugs.gnu.org; Wed, 10 Feb 2021 10:47:55 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=43372 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l9ric-0000li-SD for control@debbugs.gnu.org; Wed, 10 Feb 2021 10:47:55 -0500 Date: Wed, 10 Feb 2021 16:47:53 +0100 Message-Id: <87wnvf6i1i.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #45692 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) merge 45692 45643 quit From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 21 16:15:22 2021 Received: (at 45643) by debbugs.gnu.org; 21 Dec 2021 21:15:22 +0000 Received: from localhost ([127.0.0.1]:55854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzmTh-0003Pd-PP for submit@debbugs.gnu.org; Tue, 21 Dec 2021 16:15:21 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:46325) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzmTc-0003PF-TU; Tue, 21 Dec 2021 16:15:20 -0500 Received: (Authenticated sender: brice@waegenei.re) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 8F8BDE000B; Tue, 21 Dec 2021 21:15:09 +0000 (UTC) From: Brice Waegeneire To: raid5atemyhomework Subject: Re: bug#45643: [PATCH 0/3] Better Support for ZFS on Guix References: <20211027163827.4olhr3ks5s4sxkzp@pelzflorian.localdomain> <5YZ8GHQ55G_bk1ENRQbMKQT2bZq1jeplfowx_SukADa1rur5xYROOvtIFQRgmnahZ-mhXsy26cgvMhpAdHavnEGbmkeSH_jS54qn0EY5Ajk=@protonmail.com> <4upTXOeFpR-H8kfsj1uM6oBw46bW6rM6M20RHB7BsK2ksa4HIzrYqrF-PgUeuUqVeYuO8rbdjTzsvSBmkTVS6dsQx70dYqy61oc1Q6AVIW0=@protonmail.com> Date: Tue, 21 Dec 2021 22:15:06 +0100 In-Reply-To: <4upTXOeFpR-H8kfsj1uM6oBw46bW6rM6M20RHB7BsK2ksa4HIzrYqrF-PgUeuUqVeYuO8rbdjTzsvSBmkTVS6dsQx70dYqy61oc1Q6AVIW0=@protonmail.com> (raid5atemyhomework@protonmail.com's message of "Sun, 12 Dec 2021 13:32:05 +0000") Message-ID: <87lf0dd5id.fsf_-_@waegenei.re> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 45643 Cc: 45643@debbugs.gnu.org, "45692@debbugs.gnu.org" <45692@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello raid5atemyhomework, During the last months I had some issue swith BTRFS volumes, so I want to see if ZFS does better in this cases. raid5atemyhomework writes: > **BUMP** > > Come on, last patch, please? I'll try to review your last patch set in the comming weeks, I can't promise anything tho but don't do ping me if I take too long. > If you are worried about not knowing anything about ZFS, please see this, > which I used as reference: https://github.com/openzfs/zfs/discussions/11453 Indeed that's my case, thank your for the ressource. > Otherwise, really, all I need to get reviewed is if the code is Guix-y enough to merge in. > I believe all the Scheme style guidelines are followed correctly at this point. > > Thanks > raid5atemyhomework Cheers, - Brice From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 01 06:59:16 2022 Received: (at 45643) by debbugs.gnu.org; 1 Jan 2022 11:59:16 +0000 Received: from localhost ([127.0.0.1]:57854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3d2Z-00011y-Ub for submit@debbugs.gnu.org; Sat, 01 Jan 2022 06:59:16 -0500 Received: from mail-40135.protonmail.ch ([185.70.40.135]:53446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3d2X-00011b-Ke for 45643@debbugs.gnu.org; Sat, 01 Jan 2022 06:59:14 -0500 Date: Sat, 01 Jan 2022 11:59:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail2; t=1641038347; bh=yT1rZRSCrDcxQzGZkCT5DrdRcsVT0XBgsgCb8qgk378=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc; b=twNyMyvaX7wIhkdIK9z6o+uC/TXeXaQzu5yVf8PMYNEeoRVbUZkbx8giAimsuds7Q LY3jexeO74id2eCwtEWrbFOmPH0WR9UEIFNQxntF9A/VRNAR24Vnn27/yH/+Ty3to2 9JIu2pQhBjvKeLR/6eE3ZwAhBO9GgPjlmFltwhemGsSoGf4TB5+5LBcKTgX8hEAtKz bIrjDKUDivry2ZZCh77i1LxNm9yq//PH2d/1i57SxUwLzetHzSIYjcrpUfbvNNeOyH KQbyJXX0atiMSuzhgOGCbyULy+n4zxryAIf1PbAlybZkL96epx2KagIiEEQHnurHhr Ikq79F8eg14mA== To: Brice Waegeneire From: raid5atemyhomework Subject: Re: bug#45643: [PATCH 0/3] Better Support for ZFS on Guix Message-ID: In-Reply-To: <87lf0dd5id.fsf_-_@waegenei.re> References: <20211027163827.4olhr3ks5s4sxkzp@pelzflorian.localdomain> <5YZ8GHQ55G_bk1ENRQbMKQT2bZq1jeplfowx_SukADa1rur5xYROOvtIFQRgmnahZ-mhXsy26cgvMhpAdHavnEGbmkeSH_jS54qn0EY5Ajk=@protonmail.com> <4upTXOeFpR-H8kfsj1uM6oBw46bW6rM6M20RHB7BsK2ksa4HIzrYqrF-PgUeuUqVeYuO8rbdjTzsvSBmkTVS6dsQx70dYqy61oc1Q6AVIW0=@protonmail.com> <87lf0dd5id.fsf_-_@waegenei.re> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 45643 Cc: "45643@debbugs.gnu.org" <45643@debbugs.gnu.org>, "45692@debbugs.gnu.org" <45692@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: raid5atemyhomework Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thanks Santa! > Hello raid5atemyhomework, > > During the last months I had some issue swith BTRFS volumes, so I want to= see if > ZFS does better in this cases. > > raid5atemyhomework raid5atemyhomework@protonmail.com writes: > > > BUMP > > Come on, last patch, please? > > I'll try to review your last patch set in the comming weeks, I can't prom= ise > anything tho but don't do ping me if I take too long. > > > If you are worried about not knowing anything about ZFS, please see thi= s, > > which I used as reference: https://github.com/openzfs/zfs/discussions/1= 1453 > > Indeed that's my case, thank your for the ressource. > > > Otherwise, really, all I need to get reviewed is if the code is Guix-y = enough to merge in. > > I believe all the Scheme style guidelines are followed correctly at thi= s point. > > Thanks > > raid5atemyhomework > > Cheers, > > - Brice From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 19 10:38:03 2022 Received: (at control) by debbugs.gnu.org; 19 Mar 2022 14:38:03 +0000 Received: from localhost ([127.0.0.1]:60263 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVaDT-0000BP-5o for submit@debbugs.gnu.org; Sat, 19 Mar 2022 10:38:03 -0400 Received: from mail-40132.protonmail.ch ([185.70.40.132]:62128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nVaDQ-0000Av-Q8 for control@debbugs.gnu.org; Sat, 19 Mar 2022 10:38:01 -0400 Date: Sat, 19 Mar 2022 14:37:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1647700674; bh=G+fVaO46J5cR3sxO/M4UcdCh44JO7Am1a/9860Om1mw=; h=Date:To:From:Reply-To:Subject:Message-ID:From:To:Cc:Date:Subject: Reply-To:Feedback-ID:Message-ID; b=iTiQYdoUtd0YzPNhiZadpyOucvwn2lx2YWM5MYukICQSCXPqk7l07XodKcN5u+WXu o50OtgddEIZ+wMgV45lub0GO3FSsH0YJgXC69r0meudXPrOdkD/+x2GB+HsJwpLseZ r4ug/wnEULeXV6u93/6XUQSuF+ZbyvNnISymQJYYmumeCEfDSnZMhZ3l62th3gqCq3 i04AQigS9umKtzEO/Oq5EJZOViKoFxhde6+29Y+QIWPF4KefN751VKr+2mzRWb4469 aSPxvfMzpZXb+92m/Ap6UtTDqHkMGrt3mV1LGpPPxIwcj6CspZNNhdSZYqVmSm5HTv c/9wBXU7pccCQ== To: "control@debbugs.gnu.org" From: raid5atemyhomework Subject: (No Subject) Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: close 45692 quit No point: nobody will review or merge anyway. Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 SLIGHTLY_BAD_SUBJECT Subject contains something slightly spammy 0.0 RCVD_IN_MSPIKE_H5 RBL: Excellent reputation (+5) [185.70.40.132 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (raid5atemyhomework[at]protonmail.com) 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: raid5atemyhomework Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) close 45692 quit No point: nobody will review or merge anyway. From unknown Sat Aug 16 10:50:18 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 17 Apr 2022 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator