unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Giovanni Biscuolo <g@xelera.eu>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: 40999@debbugs.gnu.org
Subject: bug#40999: GRUB prevents booting a degraded RAID1 array atop LUKS
Date: Fri, 13 Aug 2021 17:05:12 +0200	[thread overview]
Message-ID: <877dgpfkrb.fsf@xelera.eu> (raw)
In-Reply-To: <87fsvfz9eb.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 5998 bytes --]

Hi Maxim,

I'd "debug" the issue trying to compare my Debian system config with
yours since I'm also using a BTRFS RAID1 filesystem on LUKS.

I've still not unplugged one of the two disks on mine to simulate a
drive failure, Soon™ I'd like to test this condition... but it's a
busy machine so I don't know when.

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

[...]

>>> 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.

Please could you also provide the result of "lsblk -f"?

This is (part of) my disks layout:

--8<---------------cut here---------------start------------->8---

sdc                                                                                  
├─sdc1                                                                               
├─sdc2 vfat                      F6D8-67E3                             470.8M     1% /boot/efi
├─sdc3 crypto_L                  e554b806-19ac-48b2-b521-b4e89839a756                
│ └─crypt_swap01
│      swap                      a43ce70c-dd35-47d8-a2ef-ef9d3c6d0885                [SWAP]
└─sdc4 crypto_L                  820bfdf7-46f7-46f5-8536-7e1b0f04e70e                
  └─crypt_btrfs01_03
       btrfs    btrfs_pool01     82afe97a-bb97-4b3d-90cb-93a058185b97                
sdd                                                                                  
├─sdd1                                                                               
├─sdd2                                                                               
├─sdd3 crypto_L                  960aa919-182b-4604-a8be-8477c86386cc                
│ └─crypt_swap02
│      swap                      3f8f6974-05a9-4047-993a-c4ccb27eaa1d                [SWAP]
└─sdd4 crypto_L                  c590c62e-6ac8-418c-9ea7-7ae9c79058c8                
  └─crypt_btrfs01_04
       btrfs    btrfs_pool01     82afe97a-bb97-4b3d-90cb-93a058185b97  802.3G    57% /mnt/btrfs

--8<---------------cut here---------------end--------------->8---

btrfs_pool01 is my BTRFS RAID1 filesystem, it includes /boot and /
(root) and is on two ancrypted LUKS partitions, as you can see.

Also, please what's your grub.cfg?

This is the config of a menuentry of mine:

--8<---------------cut here---------------start------------->8---

menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-82afe97a-bb97-4b3d-90cb-93a058185b97' {
	load_video
	insmod gzio
	if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
	insmod part_gpt
	insmod cryptodisk
	insmod luks
	insmod gcry_rijndael
	insmod gcry_rijndael
	insmod gcry_sha256
	insmod btrfs
	cryptomount -u c590c62e6ac8418c9ea77ae9c79058c8
	set root='cryptouuid/c590c62e6ac8418c9ea77ae9c79058c8'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint='cryptouuid/c590c62e6ac8418c9ea77ae9c79058c8'  82afe97a-bb97-4b3d-90cb-93a058185b97
	else
	  search --no-floppy --fs-uuid --set=root 82afe97a-bb97-4b3d-90cb-93a058185b97
	fi
	echo	'Loading Linux 5.10.0-0.bpo.3-amd64 ...'
	linux	/debian_root/boot/vmlinuz-5.10.0-0.bpo.3-amd64 root=UUID=82afe97a-bb97-4b3d-90cb-93a058185b97 ro rootflags=subvol=debian_root ip=10.38.2.2::10.38.2.1:255.255.255.0:anemone:eth0:none quiet
	echo	'Loading initial ramdisk ...'
	initrd	/debian_root/boot/initrd.img-5.10.0-0.bpo.3-amd64
}

--8<---------------cut here---------------end--------------->8---

AFAIU this code (from the snippet above):

--8<---------------cut here---------------start------------->8---

	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint='cryptouuid/c590c62e6ac8418c9ea77ae9c79058c8'  82afe97a-bb97-4b3d-90cb-93a058185b97
	else
	  search --no-floppy --fs-uuid --set=root 82afe97a-bb97-4b3d-90cb-93a058185b97
	fi

--8<---------------cut here---------------end--------------->8---

sets [1] the root GRUB env variable to the first found device containing
the UUID 82afe97a-bb97-4b3d-90cb-93a058185b97, that is the UUID of my
BTRFS filesystem

AFAIU (but still not tested) this means that if the device with UUID
c590c62[...] is missing the search ensures that GRUB will find the next
device containing the BTRFS filesystem identified by UUID 82afe97a[...]

WDYT?

[1] https://www.gnu.org/software/grub/manual/grub/grub.html#search

[...]

>> Can you please provide the output of the "ls" command and the "set"
>> command from the grub rescue shell?
>
> I'll post after rebooting.

OK thanks.

>> 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---

This is mine (derived from the GRUB menu entry shown above):

--8<---------------cut here---------------start------------->8---

BOOT_IMAGE=/debian_root/boot/vmlinuz-5.10.0-0.bpo.3-amd64 root=UUID=82afe97a-bb97-4b3d-90cb-93a058185b97 ro rootflags=subvol=debian_root ip=10.38.2.2::10.38.2.1:255.255.255.0:anemone:eth0:none quiet

--8<---------------cut here---------------end--------------->8---

AFAIU using "root=UUID=..." is more robust than using the (possibly
missing) device mapper path.

[...]

Hope this helps.

Best regards, Gio'

-- 
Giovanni Biscuolo

Xelera IT Infrastructures

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 849 bytes --]

  reply	other threads:[~2021-08-13 15:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 13:56 bug#40999: GRUB prevents booting a degraded RAID1 array atop LUKS maxim.cournoyer
2021-08-07  5:06 ` Maxim Cournoyer
2021-08-11 14:45   ` Giovanni Biscuolo
2021-08-12  2:25     ` Maxim Cournoyer
2021-08-13 15:05       ` Giovanni Biscuolo [this message]
2021-08-29  6:15         ` Maxim Cournoyer
2022-03-05  3:33           ` Maxim Cournoyer
2022-03-27  4:07 ` Maxim Cournoyer

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=877dgpfkrb.fsf@xelera.eu \
    --to=g@xelera.eu \
    --cc=40999@debbugs.gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /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).