manjaro xfce asks for my luks password twice during bootup (first, grub asks for it, then the initrd asks for the password (for the swap (same as the other)) the second time)
I suggest that it isn’t supposed to happen. how do I fix this?
Is this a fresh installation or did it work previously but just now this started to happen?
How did you install?
(automatic mode or did you create your partitions yourself?)
Please post output of lsblk -f
for a start
@Mirdarthos
the default/automatic installation, when you check “encrypt the system”, creates a Luks1 encrypted contailer, which Grub can open/decrypt - inside this container is the root partition and the swap - so they are both decrypted at the same time - with just one password, using Grub.
If one does something else, one needs to take care of the decryption process yourself …
I had this issue as well, but found the solution is to use openswap and a keyfile to handle it. I provide my passphrase to grub and everything else gets handled automatically.
Installing encrypted with a swap partition gets me in the same situation as @imre84 - have to supply the password for the swap partition separately.
It is made even more difficult because of plymouth - without hitting ESC you won’t even see the prompt for the password, the system just sits there …
I just assumed it would work the same way as with a swap file - and it can.
But some configuration needs to be done for that -
but this is not present or is incomplete as the installer does it.
This allows my system to work as I would expect it, but it was NOT the default from the Manjaro installer. I had to find the solution and implement it. There is a bit more to it, such as the filling the keyfile with random data, etc.
Mod edit:- Your attempt at formatting is appreciated. Please note that the three backtcks ``` both before and after the pasted content should be on their own lines to avoid unexpected misalignment of content.
Corrected for you in this instance. No charge.
See How to Post Command Output as Preformatted Text
To understand and see for myself, I installed a test system in a VM with the same setup - just with ext4 instead of btrfs.
And I got the same result as you did - had to open the encrypted swap separately.
After a bit of exploration I deleted the VM - I should have kept it, as I now realize.
What I took away from this is:
It could be remedied by changing the HOOKS array in /etc/mkinitcpio.conf
replacing the “encrypt” keyword with “sd-encrypt”
Section 1.2.4 - the above link goes to there directly
But I did not test it - it’s speculation as of now.
I’d have to reinstall a test system again and try. No time for that right now.
No - it’s not as easy as that - just tried.
The way the installer does it results in a system where you have to supply the password twice.
Not ideal. Not nice. Perhaps no one has actually tested this and noticed this undesirable result?
… we are the guinea pigs?
If you install again, but use a swap file instead of a swap partition, it should work.
But a swap file is not without other potential problems when you use btrfs.
I should have logged in to this forum on my smartphone before wrecking my main system.
sd-encrypt: it made things worse, needed to fix my system from a live cd (this was my first time dealing with both btrfs and manjaro from a live cd, so it was slightly scary for a split second)
this helped a lot, thanks. I actually disabled resuming (is this the same as hibernation? I hate hibernation. maybe justifiably so.)
I removed resume=… from GRUB_CMDLINE_LINUX_DEFAULT
and I removed openswap and resume from HOOKS=()
needed to run mkinitcpio -P and update-grub
on the live CD mkinitcpio gave too much warnings to my liking but booted fine(ish), so I reran both of these from the system
but anyhow I now can confirm, only grub asks for my luks password.
thank you for your help
Yes, resume = hibernation.
I use it without issue along with sleep, aka suspend. Your mileage may vary with either action.
Glad to hear you got it sorted.
You seem to be attributing your success to information given by @Kielcelaria – I have therefore marked their post as the solution to this topic.
If this presumption is mistaken, please feel free to mark another post as the solution.
Note that it is customary for the OP to indicate which post helped them the most to reach a resolution, which in turn helps others with a similar issue to quickly evaluate whether or not a topic will help them.
Like @imre84 said:
Removing “openswap” from /etc/mkinitcpio.conf HOOKS array allowed this to work - just confirmed it on my test install.
This is totally unintuitive, counterintuitive even - because there is an encrypted swap partition which needs to be opened, however:
with “openswap” it doesn’t work, without it it does.
His last post should be the solution to this thread.
I am confused. I posted my mkinitcpio and grub lines which work 100%, allowing me to enter my passphrase 1 time and decrypt both / and swap. Not sure how my configuration is working yet when you tried it failed on your end. Something must be different. Did you use a keyfile?
I do not know why it works for you.
Your configuration (what you posted) is - short of
in /etc/default/grub
exactly what the installer does.
keyfile /crypto_keyfile.bin - mentioned in /etc/crypttab with the two encrypted partitions as well
The HOOKS in /etc/mkinitcpio.conf does contain “openswap” as the installer does it - and this doesn’t work.
After removing it, it does work for me.
as @imre84 said it does for him as well
Counter-intuitive, yes.
But that is what it is - for me and for him.
In short again:
what the installer does, doesn’t work.
after removing “openswap” - and only this one keyword - it works
maybe I’m going to run some experiments on a VM during the weekend to see if I can have better results
EDIT:
I’ve used this iso:
d1b66b5a8638174ae8c745a1310df6e9991c217cfc76aa5f8dd933aa356acce0 manjaro-xfce-25.0.10-251013-linux612.iso
to install manjaro to a VM
I’ve chosen swap, no hibernation, yet I needed to remove hibernation (as above)
but removing hibernation wasn’t enough, with openswap present it still asks for my password twice
removing the openswap fixed the issue once again
(I’m not sure if hibernating would work without openswap given the fact that hibernation essentially saves your memory to your swap, so I haven’t tried)
EDIT2:
I modified the above VM to do hibernation but no openswap (it asks for the password once), when I hibernated it, for some reason it was aware of the fact that it is supposed to resume from hibernation (suprising, so the fact is stored outside of the swap (as well)?) but wasn’t able to do so. so I guess I was right there’s no point in hibernation if you don’t have openswap
EDIT3:
hibernation works, as long as you can put up with luks password being asked twice (and splash being disabled) and mouse cursor being corrupted after restoring from a hibernation
I absolutely do not want to sound like I am arguing, but I use hibernation, openswap and only enter my password once. I have two partitions, / and swap both encrypted. Not sure what is different on my configuration than yours, except I am Manjaro Plasma. Happy to dig in and provide any information or file settings as needed to help sort this out.
I would love to see an easy and fully functional solution that can be incorporated, or at least have a how to file created.