View previous topic :: View next topic |
Author |
Message |
LegionOfHell Apprentice

Joined: 16 Mar 2019 Posts: 253 Location: Toronto, Canada
|
Posted: Wed Jun 17, 2020 1:47 am Post subject: Error with encrypted setup. |
|
|
I get the following error right after installing Gentoo: https://ibb.co/sV0ghBC
here is how Iencrypted it:
Code: | cryptsetup luksFormat /dev/sda2
cryptsetup luksOpen --allow-discards /dev/sda2 hive
mkfs.ext4 /dev/mapper/hive |
Here is my /etc/fstab:
Code: | /dev/sda1 /boot vfat defaults,noatime 0 2
/dev/mapper/hive / ext4 noatime 0 1 |
Here is my /etc/default/grub:
Code: | GRUB_CMDLINE_LINUX="crypt_root=/dev/sda2 root=/dev/mapper/hive"
GRUB_CMDLINE_LINUX_DEFAULT=”root_trim=yes” |
Should I Use UUIDs ? |
|
Back to top |
|
 |
mslt n00b

Joined: 24 Oct 2017 Posts: 8 Location: Germany
|
Posted: Wed Jun 17, 2020 9:33 am Post subject: |
|
|
I do not use an encrypted setup at the moment, so this could be wrong...
But as far as I remember /etc/default/grub should look something like this.
Code: |
...
GRUB_CMDLINE_LINUX="crypt_root=/dev/sda2 rootfstype=ext4 real_root=/dev/mapper/hive"
...
|
_________________ Thinkpad T480
Core i5-8250U
16GB RAM
i3wm, zsh, nvim, spaces > tabs
gentoo - Obviously |
|
Back to top |
|
 |
AlexJGreen Tux's lil' helper

Joined: 19 Sep 2018 Posts: 149
|
Posted: Wed Jun 17, 2020 10:20 am Post subject: |
|
|
_
Last edited by AlexJGreen on Mon Dec 28, 2020 3:07 am; edited 1 time in total |
|
Back to top |
|
 |
LegionOfHell Apprentice

Joined: 16 Mar 2019 Posts: 253 Location: Toronto, Canada
|
Posted: Wed Jun 17, 2020 1:20 pm Post subject: |
|
|
coderanger wrote: | Enter the shell and check what is inside /dev/mapper. It it possible that the disk was mapped to different name. |
I don't quite get what you mean...
I do:
Code: | cryptsetup luksOpen --allow-discards /dev/sda2 hive
mount /dev/mapper/hive /mnt/gentoo |
and the rootfs files are in there... |
|
Back to top |
|
 |
AlexJGreen Tux's lil' helper

Joined: 19 Sep 2018 Posts: 149
|
Posted: Wed Jun 17, 2020 1:26 pm Post subject: |
|
|
_
Last edited by AlexJGreen on Mon Dec 28, 2020 3:07 am; edited 1 time in total |
|
Back to top |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 1643 Location: Bavaria
|
Posted: Wed Jun 17, 2020 4:57 pm Post subject: |
|
|
LegionOfHell wrote: | I do: Code: | cryptsetup luksOpen --allow-discards /dev/sda2 hive
mount /dev/mapper/hive /mnt/gentoo | and the rootfs files are in there... |
You do: Please "open" it with my invented name "hive" and then you mount it with this name. But this name isnt store anywhere ...
LegionOfHell wrote: | I don't quite get what you mean... |
It means, some scripts dont "open" it with "hive", it is "/dev/mapper... " (and this is also only a link to the real /dev/dm-0 or /dev/dm-1) |
|
Back to top |
|
 |
LegionOfHell Apprentice

Joined: 16 Mar 2019 Posts: 253 Location: Toronto, Canada
|
Posted: Wed Jun 17, 2020 5:34 pm Post subject: |
|
|
ok I messed things up badly...now when I turn my laptop on it doesn't find any bootable device...here is what I did:
Code: | cryptsetup luksOpen /dev/sda2 hive
mkdir /mnt/gentoo
mount /dev/mapper/hive /mnt/gentoo
cd /mnt/gentoo
mount -o bind /proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --make-rslave /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
mount --make-rslave /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
env-update
source /etc/profile
export PS1="(chroot) $PS1"
mount /dev/sda1 /boot
genkernel --luks initramfs
nano -w /etc/default/grub
GRUB_CMDLINE_LINUX="crypt_root=/dev/sda2 rootfstype=ext4 real_root=/dev/mapper/hive"
grub-mkconfig -o /boot/grub/grub.cfg
------
exit
cd
umount -l /mnt/gentoo/dev{/shm,/pts,}
umount -R /mnt/gentoo
reboot or poweroff |
I also get this error when grub-mkconfiging:
Code: | WARNING: Failed to connect to lvmetad. |
Quote: | It means, some scripts dont "open" it with "hive", it is "/dev/mapper... " (and this is also only a link to the real /dev/dm-0 or /dev/dm-1) |
so, this is the correct line? :
Code: | GRUB_CMDLINE_LINUX="crypt_root=/dev/sda2 rootfstype=ext4 real_root=/dev/mapper..." |
|
|
Back to top |
|
 |
pietinger Moderator

Joined: 17 Oct 2006 Posts: 1643 Location: Bavaria
|
Posted: Wed Jun 17, 2020 5:58 pm Post subject: |
|
|
LegionOfHell wrote: | Code: | GRUB_CMDLINE_LINUX="crypt_root=/dev/sda2 rootfstype=ext4 real_root=/dev/mapper..." |
|
Oh, no. I wrote "..." as meaning the rest of the directory. |
|
Back to top |
|
 |
LegionOfHell Apprentice

Joined: 16 Mar 2019 Posts: 253 Location: Toronto, Canada
|
Posted: Wed Jun 17, 2020 8:35 pm Post subject: |
|
|
coderanger wrote: | On the screenshot, type "shell" for a shell
then |
ok, here is what its showing:
https://ibb.co/G2nMBZk
so the line should be this:
GRUB_CMDLINE_LINUX="crypt_root=/dev/sda2 rootfstype=ext4 real_root=/dev/mapper/root"
can someone confirm ? |
|
Back to top |
|
 |
AlexJGreen Tux's lil' helper

Joined: 19 Sep 2018 Posts: 149
|
Posted: Wed Jun 17, 2020 8:50 pm Post subject: |
|
|
_
Last edited by AlexJGreen on Mon Dec 28, 2020 3:07 am; edited 1 time in total |
|
Back to top |
|
 |
LegionOfHell Apprentice

Joined: 16 Mar 2019 Posts: 253 Location: Toronto, Canada
|
Posted: Wed Jun 17, 2020 9:05 pm Post subject: |
|
|
ok, it works now...
I have another question:
when I do grub-mkconfig, I get the following warning:
Code: | WARNING: Failed to connect to lvmetad. |
I am not using lvm but I created my initramfs with
Code: | genkernel --microcode --luks --lvm initramfs |
how do i get rid of this warning ? |
|
Back to top |
|
 |
|