Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[KERNEL PANIC - LUKS + LVM - Gentoo AMD64 OpenRC musl/llvm]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
gentooser_one
n00b
n00b


Joined: 21 Nov 2022
Posts: 1

PostPosted: Thu Jul 13, 2023 4:22 pm    Post subject: [KERNEL PANIC - LUKS + LVM - Gentoo AMD64 OpenRC musl/llvm] Reply with quote

I'm trying to boot the system via EFIStub (efibootmgr), but I always got a kernel panic.

Initially, I used gentoo-kernel-bin. Then, using genkernel, I only generated a new initramfs with LUKS and LVM support:

Code:
genkernel --luks --lvm --install initramfs


Later, I copied the ".config" file from gentoo-kernel-bin to be used in the kernel compilation (gentoo-sources). The only modification I made so far was the processor frequency (from 300MHz to 1000MHz).

The following command was used to compile the kernel:

Code:
genkernel --makeopts="-j14" --lvm --luks --no-zfs --no-mrproper --no-clean --install all


These are the mount points:

Code:
nvme0n1 259:0 0 931.5G 0 disk
├─nvme0n1p1 259:1 0 514M 0 part /boot
└─nvme0n1p2 259:2 0 931G 0 part
├─gentoo-root 253:0 0 200G 0 lvm
│ └─gentoo 253:4 0 200G 0 crypt /
├─gentoo-var 253:1 0 200G 0 lvm /var
├─gentoo-storage 253:2 0 200G 0 lvm
└─gentoo-home 253:3 0 331G 0 lvm /home


Code:
/dev/mapper/gentoo-var: UUID="d2b544a7-a9e5-475e-918d-323ab4b5b846" UUID_SUB="df4e1296-3b32-40a8-8396-e6c1d4948024" BLOCK_SIZE="4096" TYPE="btrfs"
/dev/nvme0n1p1: UUID="50CE-8707" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="boot" PARTUUID="9f4569f9-a778-46a9-9c86-70a8b53cccc9"
/dev/nvme0n1p2: UUID="s6OSTc-61H2-PILT-lsw1-UHCX-XDsP-JXFKRg" TYPE="LVM2_member" PARTLABEL="lvm" PARTUUID="4bfa4697-c820-483e-859e-f549a923a2c0"
/dev/mapper/gentoo: UUID="1b18c966-dabc-4843-9c1d-23f6b04e75f3" UUID_SUB="1366b35e-3563-4b55-83f9-0d2f641125c1" BLOCK_SIZE="4096" TYPE="btrfs"
/dev/mapper/gentoo-storage: UUID="8daaf486-3cf4-45c9-aa07-45fb95ec3dc3" UUID_SUB="30130729-9925-4a0d-8fa4-afb92c10839a" BLOCK_SIZE="4096" TYPE="btrfs"
/dev/mapper/gentoo-root: UUID="36509807-00ff-4bf3-940a-63790465aebe" TYPE="crypto_LUKS"
/dev/mapper/gentoo-home: UUID="a212009e-4f68-44ee-b40a-7248f45bc199" UUID_SUB="cbab2900-1a63-4833-8a73-426b4e1becf9" BLOCK_SIZE="4096" TYPE="btrfs"


And this was the command I executed for efibootmgr (at this point, using gentoo-kernel-bin):

Code:
efibootmgr --disk /dev/nvme0n1 --part 1 --create --label "Gentoo Linux AMD64" --loader /vmlinuz-6.1.38-gentoo-dist --unicode 'root=UUID=36509807-00ff-4bf3-940a-63790465aebe rootfstype=btrfs root_key=rootfs.key root_keydev=/dev/mapper/gentoo-root crypt_root=UUID=1b18c966-dabc-4843-9c1d-23f6b04e75f3 real_root=UUID=36509807-00ff-4bf3-940a-63790465aebe initrd=/initramfs-6.1.38-gentoo-dist.img rw'


Could someone point out what I did wrong?

Thanks in advance!
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3882

PostPosted: Thu Jul 13, 2023 4:59 pm    Post subject: Reply with quote

Welcome to Gentoo Forums!

Code:

crypt_root=UUID=1b18c966-dabc-4843-9c1d-23f6b04e75f3 real_root=UUID=36509807-00ff-4bf3-940a-63790465aebe

This is not understood by the kernel.They are not valid kernel parameters.They are consumed by genkernel only.
You seem to have a most complicated setup.
It is basically btrfs on lvm except for the / partition which is lvm->luks->btrfs.
Very particular setup.
I would advice you IMHO to
1. Please stick with gentoo-kernel-bin
2. Ditch the efistub and genkernel
3. Use grub
4. Use dracut.
_________________
:)
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21856

PostPosted: Thu Jul 13, 2023 5:06 pm    Post subject: Reply with quote

If you need help with a kernel panic, you should show the text printed by the panic. You do not need to show all of it, but we need enough to understand which of several causes applies.

Your topology looks weird to me. If I read this right, you have an LVM on a partition, and a LUKS container inside the LVM, with your root inside the LUKS container. Your home is outside the LUKS container. This is backwards. Typically if any encryption is used, it is used to protect home. Some people will protect both home and root. I cannot recall ever seeing someone protect root and leave home exposed.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54421
Location: 56N 3W

PostPosted: Thu Jul 13, 2023 8:49 pm    Post subject: Reply with quote

gentooser_one,

Welcome to Gentoo.

As you get a kernel panic, your initramfs is not being used. If it were, the error would be trapped and you would be dropped to the rescue shell in the initramfs.

The EFI specification requires that firmware can load one file. Anything extra is a bonus. For those minimally compliant EFI firmwares, the initrd and the kernel command line must be built into the kernel for EFI stub loading to work.

Why do you think, your EFI firmware can handle the initrd and kernel parameters?

Put all the pieces together using grub, so you know all the pieces are good. Them make another efivars boot entry to use the same pieces as an EFI stub.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum