From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 11 22:26:04 2021 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 To: Giovanni Biscuolo Subject: Re: bug#40999: GRUB prevents booting a degraded RAID1 array atop LUKS 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-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 40999 Cc: 40999@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.0 (-) 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