unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: raid5atemyhomework <raid5atemyhomework@protonmail.com>
To: "guix-devel@gnu.org" <guix-devel@gnu.org>
Subject: Re: ZFS on Guix
Date: Sat, 09 Jan 2021 18:14:07 +0000	[thread overview]
Message-ID: <07kwAFNpjhGFe7ArkjjAtRhr564wvMPGhHFyjGb_XdmmPNddKTmT9Swky1NbbUxHBC4xw3p-m_3JyW16Ql9J7PLyk6UdhCsA2cdkHehdti8=@protonmail.com> (raw)
In-Reply-To: <vzCMYS_rSzkd3ZDA5TktzybU2LmfZsjWLmrd0ABQ1bIKyulAreAghoDBo0yjb-bEbH5ZmKhOO3D9WPjuDoMMUs0OeUWA1WakVWFo6H61IHY=@protonmail.com>

Hi guix-developers,

I just found out that ZFS on Linux maintains a file `/etc/zfs/zpool.cache` which contains information on ZPOOLs (i.e. ZFS-managed RAID arrays).  I just didn't encounter this file before on Guix because the file is created if and only if the directory `/etc/zfs/` exists, and that directory is not created by the ZFS installation process on Guix (because I'm the one making the ZFS installation process on Guix right now and I didn't know about this directory).

Now, my understanding is that `/etc/` directory is recreated at each `guix system reconfigure`.  Thus, if ZFS maintains information in `/etc/zfs/` then on a reconfigure the information is lost.

If so --- for Guix, what should I use instead?

As it happens, ZFS uses this directory for at least these things:

* `/etc/zfs/zpool.cache` - a binary file containing information about what ZPOOLs were created on this system.  The `zpool` command updates this file!
* `/etc/zfs/zpool.d/` - a directory of scripts that can be used to extend the `zpool` command; the ZFS release normally installs a bunch of files it has in those directories.
* `/etc/zfs/vdev_id.conf` - a sysad-managed configuration file that is used to indicate the paths.
* `/etc/zfs/zed.d/` - a directory of scripts that are executed when particular events are detected by the ZFS Event Daemon (which I didn't know about, and which should also be installed and started as a Shepherd service as well).  Sysads are supposed to link or copy files from `/libexec/zfs/zed.d/` (which are provided by the installation) to enable/disable particular zedlets, and can add other events here. The ZFS release normally links some of the files in `/libexec/zfs/zed.d/`.
* `/etc/zfs/zfs-functions` - a shell file containing functions that some bits of ZFS `init` scripts / `initramfs` scripts use, and maybe more. I think Guix can safely ignore this, though somebody (most likely me) will have to read it through to understand how ZFS actually implements some of its magical abilities.

Of these, many are stuff that we might plausibly generate by adding more fields in `zfs-configuration`, though the ZED and its zedlet system would bring in the possibility of writing Guile GEXP to create scripts for particular events.

However, I'm not so sure about `zpool.cache` file.  For one, it doesn't contain text data so it's not easy to generate it ourselves.

On the other hand I've got ZFS working without it, by just using `zpool import -a` to have ZFS scan for all devices.  The problem with this technique is if Guix is used on a system with several dozen or hundred devices in various ZPOOLs; this would slow down boot while ZFS is checking all arrays and figuring out which device goes into which array, whereas a `zpool.cache` file would let ZFS know about all pools created or imported on the system and would not need to scan their labels and reassemble their arrays and so on.  Another is that for a complex enough setup, a storage device might be connected to the hardware by hostile parties (for example, by network-addressable block devices, or USB) that contains a ZPOOL with a `mountpoint=/gnu/store` (or other sensitive directory) property, which, if auto-imported via `zpool import -a`, could let particular subdirectories of the filesystem to be subverted.

How best do I handle this?


Thanks
raid5atemyhomework


  reply	other threads:[~2021-01-09 18:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-02  6:16 ZFS on Guix raid5atemyhomework
2021-01-02  6:40 ` raid5atemyhomework
2021-01-03 15:50   ` Danny Milosavljevic
     [not found]     ` <Kyzl4xnRrDtWbTkAmBf1i8mtSZvu-AYatdazY1NsABFAzqqi7HQl-t0d2LWAInr8n7KxGyJWfIfTWqrefrxdgWelKbr2SWc9ATV5P8zrVtw=3D@protonmail.com>
     [not found]       ` <DmzbKm-kVn1tCfYc4eAXeEEbj3RN28qvXJaLL6dHtBBeNdXE-e-vN-a4Y-De38H8jI5lt19mauUTz9k0JArMyOT2ciYoxKY8mXFw3xeHGqo=3D@protonmail.com>
     [not found]         ` <guGWV=5FuA7tRqi0SzCiial7b5W7uKlmcMRhQXIlhtzyf1Fgq91eakr8d5EQrZ2fJPJK1OqKMCJfMgE2H4SjRSph-31ms=5F2g-mFiddv9ppiaQ=3D@protonmail.com>
2021-01-04  0:50     ` raid5atemyhomework
2021-01-04  1:15       ` raid5atemyhomework
2021-01-05 11:02         ` raid5atemyhomework
2021-01-05 14:56           ` raid5atemyhomework
2021-01-06  0:59             ` Carlo Zancanaro
2021-01-06  3:50               ` raid5atemyhomework
2021-01-06  3:58                 ` Carlo Zancanaro
     [not found]                   ` <t=5Ft9LHglTTJw2Bhtd2xX4JCJeZBi5Drqg0t04vJsfRLfoENqpftZcuHO8LYi2AO05P71lbbCgQC5etCDiPsdcssJmw1pHGyCY3 gUT-9w9?= =?us-ascii?Q?=5Fo=3D@protonmail.com>
     [not found]                     ` <Zd8uMcxWfNY1RxDn4gwrCZjHKAUxSQgcuBsNDAqa0tMqj=5FufQWE-URr7L49OBWMGDfQB8v=5F8eRdnhlsZTxU0Xq=5FF6tu-92jvvc1lSh-2tdA=3D@protonmail.com>
     [not found]                       ` <vzCMYS=5FrSzkd3ZDA5TktzybU2LmfZsjWLmrd0ABQ1bIKyulAreAghoDBo0yjb-bEbH5ZmKhOO3D9WPjuDoMMUs0O eUWA1WakV?= =?us-ascii?Q?WFo6H61IHY=3D@protonmail.com>
     [not found]                         ` <07kwAFNpjhGFe7ArkjjAtRhr564wvMPGhHFyjGb=5FXdmmPNddKTmT9Swky1NbbUxHBC4xw3p-m=5F3JyW16Ql9J7PLyk6UdhCsA2cdkHehdti8=3D@protonmail.com>
     [not found]                           ` <VnQXBr-z8pdZxWrb6VtIu5pv0UeG1II5uUu4Q7BU3NsJMQbxhiQyWJE4fhEIWJO3VWrjetf1SMIu4=5Fgi5r2AlYq8dADCXCDwW30RYaJ6seA=3D@protonmail.com>
     [not found]                             ` <BwsjjkFjW7wwYSYYp-YUhl5t1-1OtA8t3wbDftsQTZBXHNxcR2tBprzJmBYvNrMKnCeiu0d5bPz7V8IaKIdYu9NP7kDsd16z6gMPpR89-3c=3D@protonmail.c om>
     [not found]                           ` <VnQXBr-z8pdZxWrb6VtIu5pv0UeG1II5uUu4Q7BU3NsJMQbxhiQyWJE4fhEIWJO3VWrjetf1SMIu4=5Fgi5r2AlY q8dADCXCD?= =?us-ascii?Q?wW30RYaJ6seA=3D@protonmail.com>
     [not found]                             ` <BwsjjkFjW7wwYSYYp-YUhl5t1-1OtA8t3wbDftsQTZBXHNxcR2tBprzJmBYvNrMKnCeiu0d5bPz7V8IaKIdYu9NP7kDsd16z6gMPpR89-3c=3D@protonmail.com>
2021-01-06  4:41                   ` raid5atemyhomework
2021-01-06  5:20                     ` raid5atemyhomework
2021-01-06 15:58                       ` raid5atemyhomework
2021-01-09 18:14                         ` raid5atemyhomework [this message]
2021-01-10  5:17                           ` raid5atemyhomework
2021-02-08  2:13                             ` raid5atemyhomework
2021-02-08  3:51                               ` Joshua Branson
2021-02-08  6:04                                 ` raid5atemyhomework
2021-02-08  6:13                               ` raid5atemyhomework
2021-02-08  9:17                               ` Maxime Devos
2021-02-08  9:32                                 ` raid5atemyhomework
2021-02-08  9:35                                   ` Maxime Devos
2021-02-10  8:29                                   ` Efraim Flashner
2021-02-08  2:16                 ` Danny Milosavljevic
2021-02-10  7:37                   ` raid5atemyhomework
     [not found] <=5F1CLe9QSGsoMlu5WxBMXm4CbFLM=5FM9iRG1XQF9GDsK0GP208jpngdymfix4tAfoLP94mhMTt-Tx6OP2xN=5Fn78Jhx5KQzkiqPpIci=5F44C9OI=3D@protonmail.com>

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='07kwAFNpjhGFe7ArkjjAtRhr564wvMPGhHFyjGb_XdmmPNddKTmT9Swky1NbbUxHBC4xw3p-m_3JyW16Ql9J7PLyk6UdhCsA2cdkHehdti8=@protonmail.com' \
    --to=raid5atemyhomework@protonmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).