From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id OOulIhj4MmVTfgAA9RJhRA:P1 (envelope-from ) for ; Fri, 20 Oct 2023 23:58:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id OOulIhj4MmVTfgAA9RJhRA (envelope-from ) for ; Fri, 20 Oct 2023 23:58:48 +0200 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 4053969C7F for ; Fri, 20 Oct 2023 23:58:48 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=PLZqoTZI; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1697839128; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=w6T4OhVqmRkExg50uSINUTxXWT66FUGBEMnWGNGh+DQ=; b=Sjpx+EBoeGecu+41HH5CK9unVm9Ezv//t0S9jk1oYp42H7D0B8hwAfbPEZw64fRXmKAYyV klGfg0ORtcooYWwxDzn98EdUfSvu5xlre1TrGYa2AkFXEwbdVT+7NUFZIiHPGsS9x18PFv mB1vmJHXCujpMZjfelQ8phwmXRGMnMhAFyQgE01AKbhp3h3DW3KUZQsU4HyoXUz5h9ET04 tg1U5lgiXPgMsWQCmx+zMyS7dB4M0WNZZgKvmHs0OnkRq+E57c+brggnexUU6pFBDfNJpD I3MkiM4BUcNIpCqHPUPMGHvYARLDUh9piZ8h8FKBPXiQzMo35yoZUK+RDPezyA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1697839128; a=rsa-sha256; cv=none; b=eDNMvBGGy2HAPoLfCvGthF6syO0upaawG2NXoBFgPUWPBJRoMTO4zKcWp6wpBe16+57cfl hw1Hu5+HnuGbF/difBlpm2WUFiidhHqZFlKZCrN1gwGoZLGXRoRkLVRhhRdLH3Ciaf4fLI CSdod4HOril//CCf8jAGfMsNAYhH/rT3eM1YykqkV0IDe6xHWL53LKFkcRT4eS7WfB6+iN Hxg1skeV+HbxSuz43LLR+7/VlzMSOoRuKSePG5RWEkbFZIMXacpvlkJQzSDV1+/iBjtVfy 0At59c7yT/xZg7RTGeJ/c4p43kTcgPARzr7z6J3wBKNNxGIVPLsKetZfpUXoIw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=PLZqoTZI; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtxTx-0003rA-Hw; Fri, 20 Oct 2023 17:56:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtxTu-0003pT-Tf for guix-patches@gnu.org; Fri, 20 Oct 2023 17:56:35 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtxTu-0008Hy-Ln for guix-patches@gnu.org; Fri, 20 Oct 2023 17:56:34 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qtxUL-0007jK-Ov for guix-patches@gnu.org; Fri, 20 Oct 2023 17:57:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64259] [PATCH 2/2] Provide md-array-device-mapping to start MD arrays via UUID or name. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 20 Oct 2023 21:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64259 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Felix Lechner Cc: 64259@debbugs.gnu.org Received: via spool by 64259-submit@debbugs.gnu.org id=B64259.169783897329651 (code B ref 64259); Fri, 20 Oct 2023 21:57:01 +0000 Received: (at 64259) by debbugs.gnu.org; 20 Oct 2023 21:56:13 +0000 Received: from localhost ([127.0.0.1]:41783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtxTZ-0007iA-23 for submit@debbugs.gnu.org; Fri, 20 Oct 2023 17:56:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtxTU-0007hu-8Q for 64259@debbugs.gnu.org; Fri, 20 Oct 2023 17:56:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtxSw-00085q-HH; Fri, 20 Oct 2023 17:55:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=w6T4OhVqmRkExg50uSINUTxXWT66FUGBEMnWGNGh+DQ=; b=PLZqoTZI2HTUa+VKu2M/ m7X/iEMrrjNuNt4j62C4KT9MKEM6Nm7LT5RWOXsLUk45zTn7AYo3LAwKF/6D9m8PatOGCzE0oZU2Z OK9roFzpZFDsGq3u5aHzdu1ODMSZekh9SEzt1AKJOLn09cLb3cjjq4HNJ+33RqIj1SGmMYk0IhY+j 7P6zwPYebYgCqjz2a5YoBGrzwx7SmRmU34M630mic3c1jOMJoBBLqtaMz0Q3ak8m5YMg2lKtlnQ+L hCQCn8c/Es+KDA/c5k8yQ0haV1qLE4R6+g5otgkcaGZiUhEo2dNwCAurjGckOS68FzDtlwFWv0TKI NCOgVenYR1cuxQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <4e7eab10caeacfb1f8a0736cdab7154c517b9e36.1687571974.git.felix.lechner@lease-up.com> (Felix Lechner's message of "Fri, 23 Jun 2023 19:07:23 -0700") References: <4e7eab10caeacfb1f8a0736cdab7154c517b9e36.1687571974.git.felix.lechner@lease-up.com> Date: Fri, 20 Oct 2023 23:55:30 +0200 Message-ID: <87bkctt0vh.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -6.84 X-Migadu-Queue-Id: 4053969C7F X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -6.84 X-TUID: k4wAWVaufy9e Hi, Felix Lechner skribis: > This commit cures the most precipitous danger for users of MD arrays in G= NU > Guix, namely that their equipment may not boot after a drive failure. Why would that happen? Could be because the device names specified in the =E2=80=98source=E2=80=99 field of the mapped device become invalid? > Adjusts the documentation by erasing any mention of the obsolete > raid-device-mapping. No one should use that any longer. Ideally, users wo= uld > be a deprecation warning, but I was unable to adapt 'define-deprecated' to > this use case. Please feel free to make further changes. If it has to be deprecated then yes, we try and use =E2=80=98define-depreca= ted=E2=80=99. > Please feel free to insert better changelog messages. I had some difficul= ty > meeting the likely expectations of any reviewer. Please also feel free to= make > any other adjustments as needed without checking with me. Thanks! The reviewer may feel free, sure=E2=80=A6 :-) > @item source > -This is either a string specifying the name of the block device to be ma= pped, > -such as @code{"/dev/sda3"}, or a list of such strings when several devic= es > -need to be assembled for creating a new one. In case of LVM this is a > -string specifying name of the volume group to be mapped. > +This is either a string specifying the name of the block device to be > +mapped, such as @code{"/dev/sda3"}. For MD array devices it is either > +the UUID of the array or a string that is interpreted as the array name > +(see Mdadm documentation). In case of LVM it is a string specifying > +name of the volume group to be mapped. Instead of =E2=80=9Csee Mdadm documentation=E2=80=9D, could you add a link = or a command to type to access said documentation? Better yet, an example of what an mdadm device name or UUID is and how to obtain it would be welcome. > +(define (open-md-array-device source targets) > + "Return a gexp that assembles SOURCE to the MD device > +TARGET (e.g., \"/dev/md0\"), using 'mdadm'." > + (let ((array-selector > + (match source > + ((? uuid?) > + (string-append "--uuid=3D" (uuid->string source))) > + ((? string?) > + (string-append "--name=3D" source)))) > + (md-device > + (match targets > + ((target) > + target)))) > + (if (and array-selector md-device) ^ This condition is always true. > + ;; Use 'mdadm-static' rather than 'mdadm' to avoid pulling its w= hole > + ;; closure (80 MiB) in the initrd when an MD device is needed fo= r boot. > + #~(zero? (system* #$(file-append mdadm-static "/sbin/mdadm") > + "--assemble" #$md-device > + "--run" > + #$array-selector)) > + #f))) > + > +(define (close-md-array-device source targets) > + "Return a gexp that stops the MD device TARGET." > + (match targets > + ((target) > + #~(zero? (system* #$(file-append mdadm-static "/sbin/mdadm") > + "--stop" #$target))))) > + > +(define md-array-device-mapping > + ;; The type of MD mapped device. > + (mapped-device-kind > + (open open-md-array-device) > + (close close-md-array-device))) Instead of renaming and duplicating part of the logic, how about supporting those new =E2=80=98source=E2=80=99 specification right in =E2=80= =98open-raid-device=E2=80=99? It would emit a deprecation warning when =E2=80=98source=E2=80=99 is a list= of strings. Does the busy wait loop currently in =E2=80=98open-raid-device=E2=80=99 nee= d to be preserved? Thanks, Ludo=E2=80=99.