GRUB menu and LUKS unlocking too slow

I have the same problem described 3 years ago in this topic:

Though my laptop doesn’t have an Nvidia GPU, only intel integrated graphics.
Every keypress (arrow-keys & enter) takes a few seconds to do anything and a screen redraw takes a few extra seconds where I can watch it slowly drawing from the top to the bottom.

I’ve tried commenting out GRUB_GFXMODE=auto and instead adding the line GRUB_GFXMODE=1280x800 below (and also did a sudo update-grub afterwards) but my next reboot didn’t look or feel any different.

Though it’s not only grub that’s super slow, also the LUKS full disk encryption unlocking step before grub takes something like 40 seconds instead of the 10 seconds that it should take. This step also has a much too huge resolution and draws tiny text.

My laptop screen has a native resolution 3200x2000 pixels, and I guess that’s what it’s using.

What makes you think it would take 10 seconds?

If you have a full disk encryption meaning your /boot is encrypted, 40 secondes is not abnormal.
It takes time for GRUB to unlock /boot in early boot.

You can lower the iteration count :

https://wiki.archlinux.org/title/GRUB/Tips_and_tricks#Speeding_up_LUKS_decryption_in_GRUB

What’s you iteration count ?
sudo cryptsetup luksDump /dev/<partition>

By default, on my machine, it was about 5 000 000 and the decryption of /boot took also 40 seconds (with a core i5 12400).

If you want to change the interation count, i advice you to specify the key slot although it’s not specified in Arch Wiki.

sudo cryptsetup luksChangeKey --pbkdf-force-iterations <iteration count : you can try 1 000 000 or less depending your cpu> --key-slot <number> /dev/<partition>

2 Likes

on my machine those iterations seem to be much less:

sudo cryptsetup luksDump /dev/nvme0n1p5
LUKS header information for /dev/nvme0n1p5

Version:        1
Cipher name:    aes
Cipher mode:    xts-plain64
Hash spec:      sha256
Payload offset: 4096
MK bits:        512
MK digest:      ****
MK salt:        ****
MK iterations:  33991
UUID:           ****

Key Slot 0: ENABLED
        Iterations:             542740
        Salt:                   ****
        Key material offset:    8
        AF stripes:             4000
Key Slot 1: ENABLED
        Iterations:             540502
        Salt:                   ****
        Key material offset:    512
        AF stripes:             4000
Key Slot 2: DISABLED
Key Slot 3: DISABLED
Key Slot 4: DISABLED
Key Slot 5: DISABLED
Key Slot 6: DISABLED
Key Slot 7: DISABLED

update: okey, reduced key slot 2 from 540502 iterations to 10000 iterations, let’s try a reboot and see if that helps.

Yes, i have a core i5 12400, it’s 3 generation above yours.
Usually, you have to change the key slot 0, but i advice you to verify :

sudo cryptsetup luksOpen --test-passphrase --key-slot 0 /dev/<partition> && echo correct || echo incorrect

I simply left out the --key-slot 0 parameter and it asked my for the password I want to update. entered it and it turned out to be key slot 1.

I don’t believe i5-12400 is newer or should be more powerful than my i7-13700H:

this says that i5-12400 is from Q1 2022, while i7-13700H from Q1 2023. So one year newer. And I thought it should be i3<i5<i7<i9 at least when they are of a similar age.

I read somewhere that that’s the target that the luks-whole-system-encryption installers aim for usually, could be wrong, don’t have any refrences. sorry.

Interestingly, using this created a new key in slot 2 and removed slot 0. Since I don’t know what key 1 was, I removed it with
sudo cryptsetup -v luksKillSlot /dev/nvme0n1p5 1.

Reducing those iterations definitely improved my unlocking speed, but the GRUB menu is still extremely slow (~2 seconds to react to a button press, ~9 seconds to refresh the screen whole screen).

Can somebody help me with grub performance? The tip to reduce the resolution didn’t work, it still shows up with that huge resolution that it already is in from the luks unlocking screen.

You should update your profile then :

OK, pretty inaccurate.

Regarding grub press button performance, just use a search engine, there are a lot of tips. Take the time to test them and do not expect people to spoon feeding you.