Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Encrypted (aes-xts-plain64) + lvm won't boot.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
something-something-horri
n00b
n00b


Joined: 23 Jun 2018
Posts: 28
Location: earth

PostPosted: Sat May 04, 2019 11:45 pm    Post subject: Encrypted (aes-xts-plain64) + lvm won't boot. Reply with quote

I'm not sure whats the problem but grub takes a long time to mkconfig and I have errors when trying to boot. I'm installing a encrypted lvm partition on a MBR with a unencrypted ext4 partition as boot.
my /proc/mounts
Code:

proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=471575,mode=755 0 0
devpts /dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs / tmpfs rw,relatime 0 0
/dev/sdb1 /mnt/cdrom iso9660 ro,relatime,nojoliet,check=s,map=n,blocksize=2048 0 0
/dev/loop0 /mnt/livecd squashfs ro,relatime 0 0
tmpfs /run tmpfs rw,nodev,relatime,size=378304k,mode=755 0 0
debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
cgroup_root /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755 0 0
openrc /sys/fs/cgroup/openrc cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/lib/rc/sh/cgroup-release-agent.sh,name=openrc 0 0
none /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0
shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0
/dev/mapper/mikugentoo-lvolroot /mnt/gentoo ext4 rw,relatime 0 0
/dev/sda1 /mnt/gentoo/boot ext4 rw,relatime 0 0
/dev/mapper/mikugentoo-lvolhome /mnt/gentoo/home ext4 rw,relatime 0 0
none /mnt/gentoo/proc proc rw,relatime 0 0
sysfs /mnt/gentoo/sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
debugfs /mnt/gentoo/sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
configfs /mnt/gentoo/sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
fusectl /mnt/gentoo/sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
cgroup_root /mnt/gentoo/sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755 0 0
openrc /mnt/gentoo/sys/fs/cgroup/openrc cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/lib/rc/sh/cgroup-release-agent.sh,name=openrc 0 0
none /mnt/gentoo/sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0
udev /mnt/gentoo/dev devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=471575,mode=755 0 0
devpts /mnt/gentoo/dev/pts devpts rw,relatime,gid=5,mode=620,ptmxmode=000 0 0
shm /mnt/gentoo/dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /mnt/gentoo/tmplvm tmpfs rw,nodev,relatime,size=378304k,mode=755 0 0

When booting
Code:

>> Scanning for and activating volume groups
Reading all physical Volumes. This may take a while...
Enter Passphrase for /dev/sda2:
device-mapper reload ioctl on failed: No such file or directory
Failed to setup dm-crypt key mapping for device /dev/sda2
Check that kernel supports aes-xts-plain64 cipher (check syslog for more info).
!! failed to open luks device /dev/sda2
!! could not find the root in /dev/sda2
!! please specify another value or:
!! press enter for the same
!! type shell for shell
!! type q to quit
!! Could not find the root key in .

gentoo config
Code:

# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub2-mkconfig -o /boot/grub/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DISTRIBUTOR="Gentoo"

# Default menu entry
#GRUB_DEFAULT=0

# Boot the default entry this many seconds after the menu is displayed
GRUB_TIMEOUT=2
#GRUB_TIMEOUT_STYLE=menu

# Append parameters to the linux kernel command line
GRUB_PRELOAD_MODULES=lvm
GRUB_CRYPTODISK_ENABLE=y
GRUB_DEVICE=/dev/ram0
GRUB_CMDLINE_LINUX="real_root=/dev/mapper/mikugentoo-lvolroot crypt_root=/dev/sda2 dolvm"
#
# Examples:
#
# Boot with network interface renaming disabled
# GRUB_CMDLINE_LINUX="net.ifnames=0"
#
# Boot with systemd instead of sysvinit (openrc)
# GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd"

# Append parameters to the linux kernel command line for non-recovery entries
#GRUB_CMDLINE_LINUX_DEFAULT=""

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal.
# Note that you can use only modes which your graphic card supports via VBE.
# You can see them in real GRUB with the command `vbeinfo'.
#GRUB_GFXMODE=640x480

# Set to 'text' to force the Linux kernel to boot in normal text
# mode, 'keep' to preserve the graphics mode set using
# 'GRUB_GFXMODE', 'WIDTHxHEIGHT'['xDEPTH'] to set a particular
# graphics mode, or a sequence of these separated by commas or
# semicolons to try several modes in sequence.
#GRUB_GFXPAYLOAD_LINUX=

# Path to theme spec txt file.
# The starfield is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub/themes/starfield/theme.txt"

fstab
Code:

# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed); notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>            <mountpoint>    <type>        <opts>        <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
#
# NOTE: Even though we list ext4 as the type here, it will work with ext2/ext3
#       filesystems.  This just tells the kernel to use the ext4 driver.
#
# NOTE: You can use full paths to devices like /dev/sda3, but it is often
#       more reliable to use filesystem labels or UUIDs. See your filesystem
#       documentation for details on setting a label. To obtain the UUID, use
#       the blkid(8) command.

/dev/sda1            /boot        ext4        noauto,noatime    1 2
/dev/mapper/mikugentoo-lvolroot    /        ext4        noatime        0 1
/dev/mapper/mikugentoo-lvolswap    none        swap        sw        0 0
/dev/mapper/mikugentoo-lvolhome    /home        ext4        noatime        0 2

#UUID=459ead6a-1029-4173-8259-8aff553c4500        /boot        ext4        noauto,noatime    1 2
#UUID=3d56c52f-61de-4c38-8136-ffd627523a20        /        ext4        noatime        0 1
#UUID=7a98b317-1c15-4dbd-9bb3-88470bebf94b        none        swap        sw        0 0
#UUID=53b761cc-8933-4a27-ac72-91918ad5e597        /home        ext4        noatime        0 2

#LABEL=boot        /boot        ext4        noauto,noatime    1 2
#UUID=58e72203-57d1-4497-81ad-97655bd56494        /        ext4        noatime        0 1
#LABEL=swap        none        swap        sw        0 0
#/dev/cdrom        /mnt/cdrom    auto        noauto,ro    0 0
Back to top
View user's profile Send private message
g2g591
Apprentice
Apprentice


Joined: 17 Sep 2007
Posts: 186

PostPosted: Sun May 05, 2019 4:39 am    Post subject: Reply with quote

How about your kernel config as well, since your error when booting seems to question it
Code:
Check that kernel supports aes-xts-plain64 cipher
Back to top
View user's profile Send private message
something-something-horri
n00b
n00b


Joined: 23 Jun 2018
Posts: 28
Location: earth

PostPosted: Sun May 05, 2019 12:08 pm    Post subject: Reply with quote

g2g591 wrote:
How about your kernel config as well, since your error when booting seems to question it
Code:
Check that kernel supports aes-xts-plain64 cipher

I believe I checked them all off. Where exactly in genkernel is it located? In Crptographic API --> AES (x86_64)?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun May 05, 2019 12:17 pm    Post subject: Reply with quote

something-something-horri,

Code:
device-mapper reload ioctl on failed: No such file or directory

There should be a device name there. between 'on' and 'failed'.

Either your initrd, init script in the initrd or kernel have bits missing.
Possibly all three.

Post your lspci output, so we can see your hardware.
Pastebin your kernel .config fil so we can check it matches your hardware.

Take your initrd/initramfs apart and pastbin the init script you find inside.

Lastly, explain how you made your kernel and initrd.
_________________
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
something-something-horri
n00b
n00b


Joined: 23 Jun 2018
Posts: 28
Location: earth

PostPosted: Sun May 05, 2019 1:50 pm    Post subject: Reply with quote

NeddySeagoon wrote:
something-something-horri,

Code:
device-mapper reload ioctl on failed: No such file or directory

There should be a device name there. between 'on' and 'failed'.

Either your initrd, init script in the initrd or kernel have bits missing.
Possibly all three.

Post your lspci output, so we can see your hardware.
Pastebin your kernel .config fil so we can check it matches your hardware.

Take your initrd/initramfs apart and pastbin the init script you find inside.

Lastly, explain how you made your kernel and initrd.

I forgot to mention, when I grub-mkconfig it shows this for all /dev/ sub directories.
Code:

WARNING: Device /dev/<whatever> not initalized in udev database even after waiting 1000000 microseconds

I used
Code:
 genkernel --menuconfig --install --save-config --symlink --lvm --luks all
for genkernel and
Code:
 grub-install --modules="linux crypto search_fs_uuid luks lvm" --recheck /dev/sda
and
Code:
grub-mkconfig -o /boot/grub/grub.cfg

Here is my lspci output
Code:

00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)
00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:02.1 Display controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:19.0 Ethernet controller: Intel Corporation 82567LM Gigabit Network Connection (rev 03)
00:1a.0 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03)
00:1a.1 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03)
00:1a.2 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 03)
00:1a.7 USB controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03)
00:1c.2 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 3 (rev 03)
00:1c.3 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 4 (rev 03)
00:1d.0 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
00:1d.7 USB controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93)
00:1f.0 ISA bridge: Intel Corporation ICH9M-E LPC Interface Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation 82801IBM/IEM (ICH9M/ICH9M-E) 4 port SATA Controller [AHCI mode] (rev 03)
00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 03)
02:00.0 Network controller: Qualcomm Atheros AR9285 Wireless Network Adapter (PCI-Express) (rev 01)

Here is my kernel config, http://dpaste.com/0MHYTQB .
How do you take apart the initramfs?

-- edit by NeddySeagoon --
Removed the extra .com from the link
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun May 05, 2019 2:00 pm    Post subject: Reply with quote

something-something-horri,

If your initrd is an initramfs, its a compressed cpio archive of cpio archives. cpio will decompose it.

If its an initrd, its a file system in a compressed file.
Decompress the initrd then mount the output with the loop option.

As you used genkernel, you will have a cpio archive of cpio archives.

Code:
WARNING: Device /dev/<whatever> not initalized in udev database even after waiting 1000000 microseconds

Either /dev is not mounted or udev is not started, or started and failed.

What does
Code:
mount
show?
Are there any errors in dmesg?

-- edit --

Your link redirects to a domain squatter for me.
_________________
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
something-something-horri
n00b
n00b


Joined: 23 Jun 2018
Posts: 28
Location: earth

PostPosted: Sun May 05, 2019 3:48 pm    Post subject: Reply with quote

would this be okay? http://dpaste.com/0MHYTQB/duplicate/
I don't know where to find the archive that genkernel supposedly made of initramfs. It seems I need to activate a kernel parameter for it to store a archive of initramfs.
What I should name CONFIG_INITRAMFS_SOURCE: ? do I need to do that to make the cpio file?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun May 05, 2019 10:29 pm    Post subject: Reply with quote

something-something-horri,

That looks mostly harmless. Its has all the bits to find your HDD and to auto mount /dev.
That implies that udev is failing for some reason.

CONFIG_INITRAMFS_SOURCE is only needed if you want to build the initrd into the kernel.
The only reason to do that is because you want a efi stub kernel. Most users don't want that.
Its a way of making the kernel so that the UEFI firmware can load the kernel directly - no boot loader is required.
However, UEFI firmware can load only one file, so there is no scope for a separate initrd.

Its possible to build the kernel and initrd separately with careful manual configuration of the kernel.
I update my kernel every six weeks or so. My initrd is from April 2009.
_________________
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
something-something-horri
n00b
n00b


Joined: 23 Jun 2018
Posts: 28
Location: earth

PostPosted: Mon May 06, 2019 7:56 pm    Post subject: Reply with quote

NeddySeagoon wrote:
something-something-horri,

That looks mostly harmless. Its has all the bits to find your HDD and to auto mount /dev.
That implies that udev is failing for some reason.

CONFIG_INITRAMFS_SOURCE is only needed if you want to build the initrd into the kernel.
The only reason to do that is because you want a efi stub kernel. Most users don't want that.
Its a way of making the kernel so that the UEFI firmware can load the kernel directly - no boot loader is required.
However, UEFI firmware can load only one file, so there is no scope for a separate initrd.

Its possible to build the kernel and initrd separately with careful manual configuration of the kernel.
I update my kernel every six weeks or so. My initrd is from April 2009.

Code:
initramfs-genkernel-x86_64-4.19.27-gentoo-r1: XZ compressed data

Yet when I type
Code:
lzcat initramfs-genkernel-x86_64-4.19.27-gentoo-r1 | cpio -idv

I get
Code:
lzcat: initramfs-genkernel-x86_64-4.19.27-gentoo-r1: file format not recognized

Okay, sorry, I thought xz was in lzma format not _based_ on lzma format, I used xcat


Last edited by something-something-horri on Tue May 07, 2019 12:56 am; edited 1 time in total
Back to top
View user's profile Send private message
something-something-horri
n00b
n00b


Joined: 23 Jun 2018
Posts: 28
Location: earth

PostPosted: Tue May 07, 2019 12:52 am    Post subject: init script Reply with quote

NeddySeagoon wrote:
something-something-horri,

That looks mostly harmless. Its has all the bits to find your HDD and to auto mount /dev.
That implies that udev is failing for some reason.

CONFIG_INITRAMFS_SOURCE is only needed if you want to build the initrd into the kernel.
The only reason to do that is because you want a efi stub kernel. Most users don't want that.
Its a way of making the kernel so that the UEFI firmware can load the kernel directly - no boot loader is required.
However, UEFI firmware can load only one file, so there is no scope for a separate initrd.

Its possible to build the kernel and initrd separately with careful manual configuration of the kernel.
I update my kernel every six weeks or so. My initrd is from April 2009.

Okay Here's the init script http://dpaste.com/ZFPM2B1
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue May 07, 2019 9:09 am    Post subject: Reply with quote

something-something-horri,

You pastebin has gone.
_________________
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
something-something-horri
n00b
n00b


Joined: 23 Jun 2018
Posts: 28
Location: earth

PostPosted: Tue May 07, 2019 3:05 pm    Post subject: Reply with quote

NeddySeagoon wrote:
something-something-horri,

You pastebin has gone.

http://dpaste.com/1ATWEQP
http://dpaste.com/1ATWEQP/duplicate/
Back to top
View user's profile Send private message
something-something-horri
n00b
n00b


Joined: 23 Jun 2018
Posts: 28
Location: earth

PostPosted: Fri May 17, 2019 10:31 pm    Post subject: Reply with quote

I'm going to use syslinux instead, what modules should I use for lvm and the encryption I used?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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