How to switch from encrypt to sd-encrypt hook?
My current mkinitcpio.conf looks like this:
HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt filesystems fsck)
According to mkinitcpio examples from wiki, If I'm correct, I should change it to: HOOKS=(base systemd autodetect keyboard sd-vconsole block sd-encrypt filesystems fsck) Keymap and consolefont is replaced by sd-vconsole if I'm correct.
I have changed boot entry from cryptdevice=... To rd.luks.name=uuid=cryptroot rd.luks.options=allow-discard
After running mkinitcpio -P and rebooting my system, it hung on the message: A start job is running for /dev/mapper/cryptroot
About this post
- Posted
- Archived
- Score
- 3 · 81% up
- Kind
- Text
- ID
- 131thyv
12 comments
My hooks:
In cmdline:
Alternatively, define your encrypted filesystems in
/etc/crypttab.initramfsand domkinitcpio -Pinstead of defining in boot cmd line.That's a very good but I completely can't understand crypttab :(
Arch wiki says:
In my system crypttab.initramfs does not exist
You lost a modconf in your hooks...
I lost it here. It was in my mkinitcpio.conf file.
Change allow-discard to just discard for systemd encrypt kernel parameter. Refer to the man pages for systemd-cryptsetup-generator and crypttab.
My /boot/loader/entries/arch.conf look like this:
Could you tell me how should it look if I want to change my mkinitcpio hooks from HOOKS=(base udev autodetect keyboard keymap consolefont modconf block encrypt filesystems fsck)
to
HOOKS=(base systemd autodetect keyboard sd-vconsole modconf block sd-encrypt filesystems fsck)
?
For your systemd-boot entry, refer to this page. https://wiki.archlinux.org/title/dm-crypt/Encrypting_an_entire_system#Configuring_the_boot_loader
The /etc/mkinitcpio.conf section looks okay.
Also these sections are helpful: https://wiki.archlinux.org/title/dm-crypt/System_configuration#Using_systemd-cryptsetup-generator
https://wiki.archlinux.org/title/dm-crypt/System_configuration#Unlocking_in_early_userspace
Use the
rd.luks.nameoption for the kernel parameter. In your boot entry, addrd.luks.name=UUID=devicename(Alternatively you can add your root drive to /etc/crypttab, create a symlink from /etc/crypttab.initramfs pointed to /etc/crypttab, then rebuild initramfs with mkinitcpio -P).
The man pages also has examples if you read them. That is how I figured that stuff out.