Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] FAILED TO OPEN /dev/mcblk1p2 LUKS
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
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Sat Sep 11, 2021 2:36 am    Post subject: [Solved] FAILED TO OPEN /dev/mcblk1p2 LUKS Reply with quote

I have gentoo amd64 installed on a sd card. I followed these guides here:
https://wiki.gentoo.org/wiki/Dm-crypt#Kernel_Configuration
https://wiki.gentoo.org/wiki/Systemd
https://forums.gentoo.org/viewtopic-t-1136343-postdays-0-postorder-asc-start-50.html
https://amedeos.github.io/gentoo/2019/01/14/install-gentoo-with-luks-lvm-and-systemd.html
https://wiki.gentoo.org/wiki/Genkernel

NOTE: It is installed on a sd card. I don't know if that's an issue

Here is my config:
http://dpaste.com/ATENS5FAS

Here is my grub.conf:
http://dpaste.com/BC2L2FFXL

I am using genkernel which I have it configured to literally do everything for me:
http://dpaste.com/H8MLJD24B

Here is my /etc/crypttab:
http://dpaste.com/3Z8S9R2RL

Here is my etc/fstab:
http://dpaste.com/BQPTA8KCT

The issue: The issue I have is after typing in my passphrase. It will pop up "Killed" and followed up by FAILED TO OPEN /dev/mmcblk1p2 LUKS
Can't find root

Edit:
there are two partitions. One is called cryptlvm which is available once I unlocked it. That needs to be mounted first for everything else to work, I am assuming


Last edited by kucklehead on Wed Aug 10, 2022 3:51 am; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Sat Sep 11, 2021 8:32 am    Post subject: Reply with quote

It might be the case that
/dev/mmcblk
changes to /dev/sdx
Plz use PARTUUID or UUID
_________________
:)
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Sat Sep 11, 2021 3:56 pm    Post subject: Reply with quote

Killed is not normal here. My suspicion is that your cryptsetup dies badly, before it can finish its work. If you drop to a rescue shell and do the initramfs steps by hand, do you also get Killed? What is the full command that is killed to produce that output?
Back to top
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Sat Sep 11, 2021 7:48 pm    Post subject: Reply with quote

When I do drop into shell and do the initramfs by hand, I still get the same results.
Example: If I type in cryptsetup open /dev/mmcblk1p2 cryptlvm
It'll ask for my password, and the same error is "reproduced"

If I go into shell and poke around such as:
Code:
 ls dev

Which it pops up all the busybox tools, and my devices. Which is good

I got done with building arch linux systemd build, and to setup my stuff, I ran this expression:
Code:
 cryptsetup --type luks2 --cipher aes-xts-plain64 --hash sha256 --iter-time 2000 --key-size 256 --pbkdf argon2i --sector-size 512 --use-urandom --verify-passphrase luksFormat device

Note: This is all done in chroot, which shouldn't be a problem at all.

As for using UUIDs. I switched from using /dev/mapper/<logical volume> to using UUIDS in my fstab. For my kernel parameters, my root isn't in UUID. I'll change that into UUIDs, and see if that works.


Edit:

I have a feeling it might be the command I typed in that is causing it to die. Even reading this right here again:
https://wiki.gentoo.org/wiki/Dm-crypt
The only commands I need are:
Code:

cryptsetup -s 512 luksFormat /dev/sdb2
cryptsetup luksOpen /dev/sdb2 cryptlvm


Which I can set my lvm on it. The question is though, if it is that command, can I still recover it?
Back to top
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Sun Sep 12, 2021 6:29 pm    Post subject: Reply with quote

I was wrong about the command. How do I debug it and find out why it is outputting "Killed" whenever I try to manually open it or open it on boot. This is for a Chromebook, and I don't know if that affects anything exactly?
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Sun Sep 12, 2021 6:56 pm    Post subject: Reply with quote

If you have logical volumes you do NOT need UUID
Maybe only for the cryptdevice.
_________________
:)
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Sun Sep 12, 2021 7:03 pm    Post subject: Reply with quote

Normally, Killed would be printed by your shell to advise you that the child process was terminated by a SIGKILL. It's rather unusual for that to happen in interactive contexts. The only case I can think of would be that your cryptsetup was built with buffer overrun detection, and a buffer overrun occurred, which triggered the handler to SIGKILL the process to contain further damage. If so, an strace should confirm that it is sending itself a SIGKILL. Normally, I would expect this sequence of events to also print a fairly obvious diagnostic about "stack smashing detected" just before the SIGKILL is sent.
Back to top
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Wed Sep 15, 2021 1:31 am    Post subject: Reply with quote

Unfortunately strace isn't built with my busybox shell. Been following this guide here: https://linux.die.net/man/1/strace
Is there any debugging tools that come with it or do I have to include strace into it?

I tried installing it with dracut and it doesn't load past loading initramfs <gentoo>

These are the commands I used to build the init with dracut:
Code:

cd /usr/src/linux
make menuconfig
make -j3
make modules_install
make install
ls /lib/modules
dracut --force -H --kver <gentoo-kernel-bin-version>


creyptsetup luksOpen /dev/mmcblk1p2 cryptlvm results in the same error.
Back to top
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Sat Sep 18, 2021 6:05 pm    Post subject: Reply with quote

How do I trace it? I was googling it and found pgrep? Is there an article I can read. How do I do this exactly?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Sat Sep 18, 2021 7:10 pm    Post subject: Reply with quote

strace -o /tmp/crypt.strace -f -tt crypsetup luksOpen /dev/mmcblk1p2 cryptlvm. Before posting, edit your password out of the strace output. If cryptsetup crashes even on a wrong password, that would be ideal, as you could just enter a dummy password that it does not matter if we know.
Back to top
View user's profile Send private message
kucklehead
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2020
Posts: 108

PostPosted: Fri Sep 24, 2021 8:21 pm    Post subject: Reply with quote

I found out why it was not working. It is because it is on a chromebook which has low memory on it. Here is my proof and how I figured it out: https://sleeplessbeastie.eu/2021/07/05/how-to-open-luks2-encrypted-volume-on-a-low-memory-device/
Now I have another question, can I remotely update and upgrade gentoo using a more powerful machine? I was thinking SSH?
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