From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id II1VOf+GFGH/MgEAgWs5BA (envelope-from ) for ; Thu, 12 Aug 2021 04:27:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 8O7hNP+GFGGVGAAAbx9fmQ (envelope-from ) for ; Thu, 12 Aug 2021 02:27:11 +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 AEE4B84B6 for ; Thu, 12 Aug 2021 04:27:10 +0200 (CEST) Received: from localhost ([::1]:39136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mE0R2-0006Vk-NN for larch@yhetil.org; Wed, 11 Aug 2021 22:27:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mE0Qw-0006Vc-SS for bug-guix@gnu.org; Wed, 11 Aug 2021 22:27:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mE0Qw-0006Nr-Kf for bug-guix@gnu.org; Wed, 11 Aug 2021 22:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mE0Qw-0005Ck-Fw for bug-guix@gnu.org; Wed, 11 Aug 2021 22:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#40999: GRUB prevents booting a degraded RAID1 array atop LUKS Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 12 Aug 2021 02:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40999 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Giovanni Biscuolo Received: via spool by 40999-submit@debbugs.gnu.org id=B40999.162873516419923 (code B ref 40999); Thu, 12 Aug 2021 02:27:02 +0000 Received: (at 40999) by debbugs.gnu.org; 12 Aug 2021 02:26:04 +0000 Received: from localhost ([127.0.0.1]:37064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mE0Pw-0005Aw-5K for submit@debbugs.gnu.org; Wed, 11 Aug 2021 22:26:03 -0400 Received: from mail-qt1-f173.google.com ([209.85.160.173]:43830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mE0Pr-0005Ae-8m for 40999@debbugs.gnu.org; Wed, 11 Aug 2021 22:25:59 -0400 Received: by mail-qt1-f173.google.com with SMTP id l3so3861917qtk.10 for <40999@debbugs.gnu.org>; Wed, 11 Aug 2021 19:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=V74UOxIcw24rzoC9ZZljwXLNWvz4aASTYawQt42AIWw=; b=iYXDaxS9SnFFG/mNLuVSO51nzTb7182goze3XV1BhEocie+8el4obkA1airUvfLT0D tZQnlk+zVy65dbXfLbM9ec504k9cv2VY0qWx/dPrayHXNW6GA2dpXv7GaOeTjPP7vRQ5 ym5bNOCJDPJyEwlZkpPsYXoaGb6/eDbp7vDYwkV7qzvg6C1UPGHGUmRyXJVJcv7SLEvx aGSdoXWWsxoWg/04ndjvszokjfAi7FqrBEn6sPRvXhGsc1zFzxjDvRFBYQxfnRd8t0QF zbujhmWsd+5yD+1kHSM+jYdSH45g+zGnZHYzQKrONYN9EYWykEhz3jEOe53+hbEquUJW Q6IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=V74UOxIcw24rzoC9ZZljwXLNWvz4aASTYawQt42AIWw=; b=Gx7AI6Y6rNalGEl1HsTt1wPKqzsB5eegtxuHEPDxNnTlawky+ILjyDhHNZHFrfofvD hGZ1z30Q/1+2zyyhNS24qkxJ891bH8HZ+WnstFOm4NYBjiPCSWhjs4yyRq3Xk7pk35bW ZN7bBafhYNxXFb+F07R3JrRQU8JBt6BB5mhula/e7ZtI/YviWwzpTnGlSS7JKJ85ry7/ WkqNgwvyGS0ik5TK+1W2xaQ+5ukSARufPqtyBhIoI59qKvtz4tX4TFxhi8m60ferbSH0 Fvdkms9xAfzTMSKNFTrC7ipr0P1mhR6gw7B91AZUYxloBaLD3XRzkh7T02suU/YgUzCU VtgQ== X-Gm-Message-State: AOAM532MEmfup55tqgRJp0JJ7ow4Shk8FtMwV5T6z6yDMD4jjpD7xN1K WCsDTQ5s2sf1VKKJ2zkIrhw1R2McqGamig== X-Google-Smtp-Source: ABdhPJwuOd+W9KCVumqeakcrbMuFWkccfmfJM79lxW6IWDELVwO3PdsjPcRKVUO0zY4ZBm9RQSXDgA== X-Received: by 2002:a05:622a:310:: with SMTP id q16mr1738445qtw.168.1628735149499; Wed, 11 Aug 2021 19:25:49 -0700 (PDT) Received: from hurd (dsl-10-131-149.b2b2c.ca. [72.10.131.149]) by smtp.gmail.com with ESMTPSA id f17sm517788qkm.107.2021.08.11.19.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 19:25:49 -0700 (PDT) From: Maxim Cournoyer References: <87o8r7kbbz.fsf@hurd.i-did-not-set--mail-host-address--so-tickle-me> <874kc14zd9.fsf@gmail.com> <87mtpof3bk.fsf@xelera.eu> Date: Wed, 11 Aug 2021 22:25:48 -0400 In-Reply-To: <87mtpof3bk.fsf@xelera.eu> (Giovanni Biscuolo's message of "Wed, 11 Aug 2021 16:45:03 +0200") Message-ID: <87fsvfz9eb.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 40999@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628735231; 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: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=V74UOxIcw24rzoC9ZZljwXLNWvz4aASTYawQt42AIWw=; b=LHMrb3H/7gbJpzEsuTNV3oaD2eMB+lbbij7m8f9+IK1sF6Jq9oyPTW70CaXvMdiLPVQbw0 bPfFSFI3FjcPqvNvevPxUPavC0e6ZWsgQL2MuhFYHXAOv2j7XuFzfYTtsVt6THtEM8Bef7 EBqZZAgzjPqOFiz92fmoDrraWT/WROv1OYN8gi5/G91drYKtccrl0Uq9y/XSMzn/CWje3o 2lDBofXJj6r9LrHxD2FAhRk/wdlHAf2MpNKur91QBeAK0spS4Y+Lpz3qmbKdluVtDb1FXA jiHvdKJaE9OfffZLINCXja2ecDNy4w1Bg0eeuAMzNVEj+7ZX9f+Y+Hc0xFt1/Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628735231; a=rsa-sha256; cv=none; b=Oje852y7kAQmjsg3/k1uJY5Sbl9K98JjxSUSPjM3aVj1cK3d/t8fD0cvmuc+wFhs2I+tfS otMukSN0PG0OK3WzussW8MTVsbzPE8JraJ/BVOo8uR4Wd/StbqqtMxcK+CU+xS8mVTJK1g rfvazhunJu20yAlRYmQC9a1SkBZy615K8UV0UaUcyhrw2KCMMl+nH5FZGlYfKosaKOW2T1 QWWPge6FwYEkCZo0hpXwufvAzIPiWSoVNtKoCSiKx6nOGqX7QRyZa6Xi7gZ9XI1MlPwp1q NgAKMatHYMRqursN6aXQrKeEv46Ex44YTmZoeA4R6HTCmUbu+rB6D/hYG8awcQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=iYXDaxS9; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -1.31 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=iYXDaxS9; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: AEE4B84B6 X-Spam-Score: -1.31 X-Migadu-Scanner: scn1.migadu.com X-TUID: aetLgHcIix2l Hello Giovanni, Giovanni Biscuolo writes: > Hello Maxim, > > Maxim Cournoyer writes: > > [...] > >>> On a system where: >>> >>> 1) Each disks comprising the array is fully LUKS encrypted >>> 2) Each mapped disk is made part of a Btrfs RAID1 array >>> >>> When attempting to boot the system after pulling out (in BIOS or using >>> the cable) the drive to simulate a complete disk failure, GRUB hangs, >>> prompting for the LUKS password of the disappeared drive and >>> (unsurprisingly) failing to open it. > > [...] > >> Ideally, GRUB (or is it our boot script?) > > Since the end result is your system entered "grub rescue" mode AFAIU > it's a GRUB issue Yeah, it looks like it. The grub.cfg file only has basic things in it, nothing that could explain the failure. >> should be smart enough to realize that oh, that's Btrfs RAID1, it >> ought to work in degraded mode, so let's keep going. > > I (still) don't have a Guix System to test your setup and (try to) patch > thing up, so we need more info to debug the situation. I believe the basic recipe to reproduce is there: 1. Partition two drives like so (GPT with 2MiB BIOS boot): $ sudo sfdisk -l /dev/sda Disk /dev/sda: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors Disk model: WDC WD1002FAEX-0 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: B5BB7BA4-23A3-4E7C-87BB-8339B02C5905 Device Start End Sectors Size Type /dev/sda1 2048 6143 4096 2M BIOS boot /dev/sda2 6144 1953523711 1953517568 931.5G Linux filesystem $ sudo sfdisk -l /dev/sdb Disk /dev/sdb: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors Disk model: WDC WD1002FAEX-0 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: 45C58C18-7B39-A745-B22F-6A2321FB1999 Device Start End Sectors Size Type /dev/sdb1 2048 6143 4096 2M BIOS boot /dev/sdb2 6144 1953523711 1953517568 931.5G Linux filesystem 2. LUKS encrypt the whole 2nd (main) partition of each drive. 3. Format the mapped devices as Btrfs RAID1. 4. Reconfigure a Guix system on top of that (see a config snippet below) 5. Disconnect one of the two drives and reboot. 6. Contemplate the failure to get past GRUB. > Can you please provide the output of the "ls" command and the "set" > command from the grub rescue shell? I'll post after rebooting. > Also, please what is your /proc/cmdline (when Linux correcly boots)? --8<---------------cut here---------------start------------->8--- BOOT_IMAGE=/@root/gnu/store/1c0dkkkv5vdnyp73gvcl9k1kym5jjm54-linux-libre-5.13.8/bzImage --root=/dev/mapper/cryptroot --system=/gnu/store/815481yf1kfacwgkh4aa11rlb3lm6gvi-system --load=/gnu/store/815481yf1kfacwgkh4aa11rlb3lm6gvi-system/boot quiet snd_hda_intel.dmic_detect=0 modprobe.blacklist=rtl8187 --8<---------------cut here---------------end--------------->8--- The system config relevant sections are: --8<---------------cut here---------------start------------->8--- (operating-system (host-name "hurd") (timezone "America/Montreal") (keyboard-layout (keyboard-layout "dvorak")) (bootloader (bootloader-configuration (bootloader grub-bootloader) (target "/dev/sda") (terminal-outputs '(console)) (keyboard-layout keyboard-layout))) (kernel-arguments '("quiet" "snd_hda_intel.dmic_detect=0" "modprobe.blacklist=rtl8187")) (mapped-devices (list (mapped-device (source "/dev/sda2") (target "cryptroot") (type luks-device-mapping)) (mapped-device (source "/dev/sdb2") (target "cryptroot-mirror") (type luks-device-mapping)) (mapped-device (source "/dev/sdc2") (target "cryptroot-mirror2") (type luks-device-mapping)))) ;; Note: Using any of the LUKS encrypted drives exposed under ;; /dev/mapper is enough to reference the Btrfs RAID-1 array, ;; since the 'btrfs device scan' command is executed in the init ;; RAM disk and takes care of assembling the array. (file-systems (cons* (file-system (mount-point "/") (device "/dev/mapper/cryptroot") (type "btrfs") (options (alist->file-system-options (cons '("subvol" . "@root") %common-btrfs-options))) (dependencies mapped-devices)) (file-system (device "/dev/mapper/cryptroot") (mount-point "/home") (type "btrfs") (options (alist->file-system-options (cons '("subvol" . "@home") %common-btrfs-options))) (dependencies mapped-devices)) (file-system (device "/dev/mapper/cryptroot") (mount-point "/data") (type "btrfs") (options (alist->file-system-options (cons '("subvol" . "@data") %common-btrfs-options))) (dependencies mapped-devices)) %base-file-systems)) [...] --8<---------------cut here---------------end--------------->8--- Thanks, Maxim