Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
device-mapper: reload ioctl on failed: invalid argument.
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
silentcola
n00b
n00b


Joined: 17 Nov 2019
Posts: 17

PostPosted: Sun Dec 22, 2019 11:22 am    Post subject: device-mapper: reload ioctl on failed: invalid argument. Reply with quote

Hi all,

Going through install process for Gentoo with LUKS/LVM, first by following Sakaki's EFI Install Guide then MoJo's 'Encrypted Gentoo Linux Install Tutorial | LVM - LUKS - Plymouth' on youtube.

At reboot, I get warning, in my previous post I understood i do not need to worry about it but here he it is anyway.
Code:
WARNING: Failed to connect to lvmtad. Falling back to device scanning
Enter passphrase for /dev/sda3


After entering my password
Code:

device-mapper: reload ioctl on    failed: invalid argument.


Every time i enter correct password I get that message and cannot log in.

/etc/fstab
Code:

/dev/sda2                  /boot       ext2   noatime                     0 2
/dev/mapper/gentoo-root         /         ext4   defaults,rw,relatime,data=ordered    0 1
/dev/mapper/gentoo-home         /home      ext4   rw,relatime,data=ordered   0 2
/dev/mapper/gentoo-swap         none      swap    defaults                    0 0


/etc/default/grub
Code:

GRUB_PRELOAD_MODULES=lvm
GRUB_ENABLE_CRYPTODISK=y
GRUB_DEVICE=/dev/ram0
GRUB_CMDLINE_LINUX="crypt_root=/dev/sda3 real_root=/dev/mapper/gentoo-root rootfstype=ext4 dolvm quiet splash"


If anyone has any pointers, that would be great!
Back to top
View user's profile Send private message
silentcola
n00b
n00b


Joined: 17 Nov 2019
Posts: 17

PostPosted: Mon Dec 30, 2019 1:21 pm    Post subject: Reply with quote

Is this a Kernel or LVM issue? Where can I go for further documentation?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15334

PostPosted: Tue Dec 31, 2019 1:56 am    Post subject: Reply with quote

I would start by enabling debug printing of the steps, so that you know which command triggers that message. My guess is that it is related to the cryptsetup phase, not the LVM phase. Have you checked that your kernel has the appropriate ciphers to access the LUKS device?
Back to top
View user's profile Send private message
silentcola
n00b
n00b


Joined: 17 Nov 2019
Posts: 17

PostPosted: Thu Jan 02, 2020 7:57 am    Post subject: Reply with quote

Hello Hu,

Thanks for the reply, I guess I need to boot again with CD installer, and allow logging at boot.

How do i do this properly? Because I enabled rc logging in [/etc/rc.conf], after rebooting I am stuck at EFI boot screen with EFI shell and Device mapping table.
I don't even have option to enter password.

I'm wondering if I need to remount everything when booting from CD after initial install.

Code:

cryptsetup luksOpen /dev/sda3 gentoo
#Enter passphrase
mount /dev/mapper/gentoo-root /mnt/gentoo
mount --types proc /proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
Back to top
View user's profile Send private message
silentcola
n00b
n00b


Joined: 17 Nov 2019
Posts: 17

PostPosted: Thu Jan 02, 2020 12:25 pm    Post subject: Reply with quote

My install instructions I modified are as follows:
https://pastebin.com/K7VZVKXP

Perhaps you can see what/where i go wrong in install process?
Back to top
View user's profile Send private message
silentcola
n00b
n00b


Joined: 17 Nov 2019
Posts: 17

PostPosted: Thu Jan 02, 2020 6:22 pm    Post subject: Reply with quote

Ok, I actually got a bit further, following details:

blkid
Code:
/dev/loop0: TYPE="squashfs"
/dev/sda1: UUID="D945-098D" TYPE="vfat" PARTLABEL="grub" PARTUUID="ca3e3039-32cd-4c82-93fb-f0118ce50db6"
/dev/sda2: UUID="3C68-92D2" TYPE="vfat" PARTLABEL="boot" PARTUUID="803291be-25e0-48b0-9488-ddbb0d56f956"
/dev/sda3: UUID="fadccaa9-c99b-40e0-b4f7-a5b0e971ad5b" TYPE="crypto_LUKS" PARTLABEL="lvm" PARTUUID="3369bb30-5e3f-4a11-af2d-974cb67f6a00"
/dev/sr0: UUID="2019-10-28-03-14-25-28" LABEL="Gentoo amd64 20191027T214502Z" TYPE="iso9660" PTUUID="2584d85d" PTTYPE="dos"
/dev/mapper/gentoo: UUID="GxNWqQ-ULuq-Ntov-Z7Be-uN44-5Gb6-HW2y0Q" TYPE="LVM2_member"
/dev/mapper/gentoo-swap: UUID="93375a9d-eb0b-40db-a35b-35131060b5ec" TYPE="swap"
/dev/mapper/gentoo-root: UUID="d86ff021-f997-4991-b810-48c9ff87b5de" TYPE="ext4"
/dev/mapper/gentoo-home: UUID="d7c5df36-0e3e-4261-b2d7-16e00ef41846" TYPE="ext4"

vim /etc/fstab
Code:
# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>
UUID=3C68-92D2  /boot           vfat    noatime          1 2
UUID=d86ff021-f997-4991-b810-48c9ff87b5de       /               ext4    defaults,rw,relatime,data=ordered    0 1
UUID=d7c5df36-0e3e-4261-b2d7-16e00ef41846       /home           ext4    rw,relatime,data=ordered        0 2
UUID=93375a9d-eb0b-40db-a35b-35131060b5ec       none            swap    defaults


throws error when I boot:
https://imgur.com/a/J9Zrr5w
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15334

PostPosted: Fri Jan 03, 2020 1:58 am    Post subject: Reply with quote

That imgur link does not render for me. Please post the text of the error you receive.
Back to top
View user's profile Send private message
silentcola
n00b
n00b


Joined: 17 Nov 2019
Posts: 17

PostPosted: Sat Jan 04, 2020 4:19 pm    Post subject: Reply with quote

hello again.

I have sysklogd added as service default with following config.
Code:

#  /etc/syslog.conf     Configuration file for syslogd.
#
#                       For more information see syslog.conf(5)
#                       manpage.

#
# First some standard logfiles.  Log by facility.
#

auth,authpriv.*                 /var/log/auth.log
*.*;auth,authpriv.none          -/var/log/syslog
#cron.*                         /var/log/cron.log
daemon.*                        -/var/log/daemon.log
kern.*                          -/var/log/kern.log
lpr.*                           -/var/log/lpr.log
mail.*                          -/var/log/mail.log
user.*                          -/var/log/user.log

#
# Logging for the mail system.  Split it up so that
# it is easy to write scripts to parse these files.
#
mail.info                       -/var/log/mail.info
mail.warn                       -/var/log/mail.warn
mail.err                        /var/log/mail.err

# Logging for INN news system
#
news.crit                       /var/log/news/news.crit
news.err                        /var/log/news/news.err
news.notice                     -/var/log/news/news.notice

#
# Some `catch-all' logfiles.
#
*.=debug;\
        auth,authpriv.none;\
        news.none;mail.none     -/var/log/debug
*.=info;*.=notice;*.=warn;\
        auth,authpriv.none;\
        cron,daemon.none;\
        mail,news.none          -/var/log/messages

#
# Emergencies are sent to everybody logged in.
#
*.emerg                         *

#
# I like to have messages displayed on the console, but only on a virtual
# console I usually leave idle.
#
#daemon,mail.*;\
#       news.=crit;news.=err;news.=notice;\
#       *.=debug;*.=info;\
#       *.=notice;*.=warn       /dev/tty8

# The named pipe /dev/xconsole is for the `xconsole' utility.  To use it,
# you must invoke `xconsole' with the `-file' option:
#
#    $ xconsole -file /dev/xconsole [...]
#
# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
#      busy site..
#
daemon.*;mail.*;\
        news.err;\
        *.=debug;*.=info;\
        *.=notice;*.=warn       |/dev/xconsole



unfortunately it does not log anything at boot.
Code:

livecd / # ls -lah /var/log/
total 892K
drwxr-xr-x 6 root    root    4.0K Jan  1 14:55 .
drwxr-xr-x 9 root    root    4.0K Dec 29 22:55 ..
-rw-r--r-- 1 root    root       0 Dec 30 01:45 boot
drwxr-xr-x 2 root    root    4.0K Jan  1 03:18 ConsoleKit
drwxr-xr-x 2 root    root    4.0K Jan  1 01:30 cups
-rw-rw---- 1 portage portage  11K Jan  4 16:46 emerge-fetch.log
-rw-rw---- 1 portage portage 232K Jan  4 16:54 emerge.log
-rw-r--r-- 1 root    root    607K Jan  1 16:28 genkernel.log
-rw-r--r-- 1 root    root       0 Dec 29 22:55 .keep
drwxrwsr-x 3 portage portage 4.0K Dec 29 22:59 portage
drwxrwx--- 2 root    portage 4.0K Dec 30 01:46 sandbox
-rw------- 1 root    root     63K Jan  1 17:07 tallylog


tallylog is full of @@@@@@ symbols.

with this in mind I decided to go ahead and emerge syslog-ng
after emerging sucesffuly I am unable to enable it.
Code:

livecd /var/log # rc-update syslog-ng add default
 * rc-update: invalid command `syslog-ng'



What am i missing?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15334

PostPosted: Sat Jan 04, 2020 4:41 pm    Post subject: Reply with quote

You have the parameters out of order. According to man rc-update, you should write rc-update add service runlevel, but you wrote rc-update service add runlevel. Swap the second and third parameters.
Back to top
View user's profile Send private message
silentcola
n00b
n00b


Joined: 17 Nov 2019
Posts: 17

PostPosted: Sun Jan 05, 2020 11:59 am    Post subject: Reply with quote

Thanks for the reply, you were correct. I had it the wrong way around.

However, this isn't easy...

After adding syslog-ng as default run level and rebooting, rebooted I no longer get grub splash screen. Instead it starts in EUFI Interactive Shell v2.1 with mapping table.

No logging done in /var/log/, which is understandable because this path is within a LUKS - LVM.

Honestly, I think I'll go back to non-encrypted lvm... this is getting far to in the weeds... Every change seems to break something else.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15334

PostPosted: Sun Jan 05, 2020 4:53 pm    Post subject: Reply with quote

LVM on LUKS on a partition is a pretty common setup. I've used this before, even with the root filesystem inside the LVM. It requires an initramfs to unlock LUKS and then scan/activate/mount the LVM, but it was worth it for me to be able to resize filesystems readily.

Since the initramfs handles mounting/unlocking, it is also on the initramfs to provide any debugging output you may need to understand why it does not work.

If you're being stopped at the UEFI shell, then that says your bootloader isn't even starting Linux, so your initramfs is currently irrelevant. We need to understand why the bootloader no longer starts Linux, and fix that first.
Back to top
View user's profile Send private message
silentcola
n00b
n00b


Joined: 17 Nov 2019
Posts: 17

PostPosted: Wed Jan 08, 2020 9:15 pm    Post subject: Reply with quote

Hello Hu,

I decided to start again completely, this time with simpler profile so that compile times would be shorter.


Managed to do full install, reboot system, unlocked luks partion and finally log in with no issue.

This morning when I rebooted I was welcomed by EUFI Interactive Shell v2.1 with mapping table. again.

blkid
Code:

/dev/loop0: TYPE="squashfs"
/dev/sda1: UUID="D945-098D" TYPE="vfat" PARTLABEL="grub" PARTUUID="7b819e98-fa10-43bf-b288-864936725f21"
/dev/sda2: UUID="2E51-F53C" TYPE="vfat" PARTLABEL="boot" PARTUUID="18978e9e-5d7d-4666-849d-67eddf03f012"
/dev/sda3: UUID="a151876e-35b2-410d-98b3-230f24f68cd5" TYPE="crypto_LUKS" PARTLABEL="lvm" PARTUUID="08d797dc-7df1-44bc-8d28-c1725a77f732"
/dev/sr0: UUID="2019-10-28-03-14-25-28" LABEL="Gentoo amd64 20191027T214502Z" TYPE="iso9660" PTUUID="2584d85d" PTTYPE="dos"
/dev/mapper/gentoo: UUID="Go10hN-ux0B-LA5l-uq7Q-QL4v-h63D-ErgimR" TYPE="LVM2_member"
/dev/mapper/vg0-root: UUID="058ae0e8-821c-4dcd-9637-2afd6b6e8a92" TYPE="ext4"
/dev/mapper/vg0-home: UUID="0c128292-0977-4753-af1f-3a67147911a6" TYPE="ext4"


/etc/fstab
Code:
UID=2E51-F53C                                  /boot           vfat            noauto,noatime  1 2
UUID=058ae0e8-821c-4dcd-9637-2afd6b6e8a92       /               ext4            defaults        0 1
UUID=0c128292-0977-4753-af1f-3a67147911a6       /home           ext4            defaults        0 1
tmpfs                                           /tmp            tmpfs           size=4Gb        0 0
tmpfs                                           /run            tmpfs           size=100M       0 0
shm                                             /dev/shm        tmpfs           nodev,nosuid,noexec 0 0



/etc/default/grub
Code:
GRUB_DISTRIBUTOR="Gentoo"
GRUB_CMDLINE_LINUX="dolvm root_trim=yes crypt_root=UUID=a151876e-35b2-410d-98b3-230f24f68cd5 root=/dev/mapper/vg0-root"



I notice when I try to mount /boot following error: mount: /boot: special device UID=2E51-F53C does not exist.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15334

PostPosted: Thu Jan 09, 2020 3:16 am    Post subject: Reply with quote

If your firmware's shell is asking for input, that suggests it is not running Grub. How did you configure the system to run Grub as your bootloader?
Back to top
View user's profile Send private message
silentcola
n00b
n00b


Joined: 17 Nov 2019
Posts: 17

PostPosted: Thu Jan 09, 2020 5:35 pm    Post subject: Reply with quote

Umm like this?

Code:

$echo "sys-boot/grub:2 device-mapper" >> /etc/portage/package.use/sys-boot

$emerge -av grub

$mount /boot

$grub-install --target=x86_64-efi --efi-directory=/boot

$grub-mkconfig -o /boot/grub/grub.cfg

$rc-update add lvm default


After this i changed passwd, then ran reboot.

It rebooted, showed grub menu, then was able to log in.


Next day I boot machine and am welcomed with firmware's shell. I changed nothing after initial log in...
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15334

PostPosted: Fri Jan 10, 2020 3:47 am    Post subject: Reply with quote

That suggests your system's firmware is silently resetting your boot preferences. That is unpleasant, and very system dependent.
Back to top
View user's profile Send private message
silentcola
n00b
n00b


Joined: 17 Nov 2019
Posts: 17

PostPosted: Wed Jan 15, 2020 8:42 am    Post subject: Reply with quote

Ok, strange, but i'm running this within a VM.
VM software wasn;t changed between boots either.
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