LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   When booting Slackware with encrypted /boot and LVM, it doesnt detects /dev/sda3 (that contains the system) to decrypt (https://www.linuxquestions.org/questions/slackware-14/when-booting-slackware-with-encrypted-boot-and-lvm-it-doesnt-detects-dev-sda3-that-contains-the-system-to-decrypt-4175727712/)

I7sReact 08-04-2023 10:30 AM

When booting Slackware with encrypted /boot and LVM, it doesnt detects /dev/sda3 (that contains the system) to decrypt
 
So, im making a Slackware 15 minimal install in my External USB HDD were im going to use GRUB instead of ELILO (because i can boot in other machines more easily) in a UEFI machine, and set up encryption, with LUKS1 in the /boot partition and LUKS2 with argon2id in the partition that contains the LVM with / and /home. But during booting of the system, it doesnt detects that partition that contains the system and doesnt unlock it. So im gonna say what steps im following.

1- Partitioning

Code:

/dev/sda1 -> /boot/efi (512MiB, FAT32)
/dev/sda2
    |_ slackware_boot -> /boot (1024MiB, EXT4, LUKS1 Encryption)
/dev/sda3
    |_ slackware_sys (LUKS2 encryption with Argon2id)
            |_system
                  |_ root -> / (70GiB, EXT4)
                  |_ home -> /home (230GiB, EXT4)

2- Start the Slackware installer and them continue to the end (I dont install LILO or ELILO), in the end, instead of rebooting the machine, i enter the shell and first chroot to /mnt where the slackware install is located.

3- Editing /etc/default/grub

I add:

Code:

GRUB_ENABLE_CRYPTODISK=y
And in GRUB Kernel Parameters Line, i add:

Code:

cryptdevice=UUID=<UUID of sda3>:slackware_sys root=/dev/system/root
Save and exit

4- Editing /etc/crypttab

Code:

slackware_boot  UUID=<UUID of sda2> none luks
slackware_sys  UUID=<UUID of sda3> none luks

(Idk how to setup a keyfile correctly yet, so i leave it as none)

5- Editing /etc/fstab

I change stuff like /dev/sda1, /dev/mapper/slackware_boot, /dev/system/root and /dev/system/home to its UUIDs counterparts

6- Rebuilding the initrd

Using the mkinitrd tool. I rebuild using the following flags

Code:

mkinitrd -c -k 5.15.19 -m ext4:usbhid:usb-storage:jbd2:ehci-hcd -f ext4 -r /dev/system/root -C /dev/sda3 -L -l br-abnt2
7- Installing GRUB

Code:

grub-install --target=x86_64-efi --efi-directory=/boot/efi --removable --recheck
grub-mkconfig -o /boot/grub/grub.cfg

8- Rebooting the machine

So, rebooting the machine i can boot and enter the unlocking GRUB phase. Where it has no problems, but after that, when trying to boot at the system and loading the kernel, it says that dont detects /dev/sda3 to decrypt it, so it hangs me to a emergency mode.

I followed a lot of guides, blogs and posts to help me making this Slackware install. From the ArchWiki, LinuxQustions.org and some blogs scattered through out the web. Some stuff

https://wiki.archlinux.org/title/Dm-...ystem#top-page
https://wiki.archlinux.org/title/GRUB#Encrypted_/boot
https://www.tumfatig.net/2022/slackw...n-uefi-laptop/
https://linorg.usp.br/slackware/slac...ADME_CRYPT.TXT
https://linorg.usp.br/slackware/slac...EADME_UEFI.TXT
https://www.youtube.com/watch?v=K7PQS0NEJsQ
https://www.linuxquestions.org/quest...fi-4175582667/

Didier Spaier 08-04-2023 11:44 AM

When I clicked on this thread before answering it comes empty. A few minutes ago there was a post (not this one, as I am not the OP). I am the only one to see that?

I7sReact 08-04-2023 11:50 AM

Quote:

Originally Posted by Didier Spaier (Post 6446288)
When I clicked on this thread before answering it comes empty. A few minutes ago there was a post (not this one, as I am not the OP). I am the only one to see that?

Wait, I reentered now to see if i got a reply, and WTF happened with the entire post, it simply disapeared the entire text? This was my first post here, maybe i forgot to click in something? And the worst part is that i edited the text about 2 times adding stuff for context and links

And now my long text disapeared, how cool is that? Now i dont want to rewrite all the text to post it again. Feeling lazy that i waste 15min putting details to, but in the end my entire post disapear

And funny thing is, when i enter in My Posts page, it doesnt appear nothing, like if i never posted something WTF

GazL 08-04-2023 12:21 PM

I good habit to get into with this site is to copy long posts to your clipboard just in case. I've had it happen to me a number of times and yes, it's very frustrating when that happens.

Not just you Didier. Thread was empty here too. Very odd.

I7sReact 08-04-2023 12:31 PM

Quote:

Originally Posted by GazL (Post 6446296)
I good habit to get into with this site is to copy long posts to your clipboard just in case. I've had it happen to me a number of times and yes, it's very frustrating when that happens.

Not just you Didier. Thread was empty here too. Very odd.

Thanks for saying that stuff like this can happen.
Gonna use a Clipboard to these longer texts from now on.

I created some will to redo all over the text
Im gonna post it again when ready

I7sReact 08-04-2023 01:26 PM

The new post
 
https://www.linuxquestions.org/quest...st-4175727721/


All times are GMT -5. The time now is 09:14 PM.