unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kaelyn <kaelyn.alexi@protonmail.com>
To: Giovanni Biscuolo <g@xelera.eu>
Cc: guix-devel@gnu.org
Subject: Re: problems installing on LUKS2 encrypted device
Date: Fri, 08 Dec 2023 19:04:20 +0000	[thread overview]
Message-ID: <ytQaJVaEWAiSax3KewwEmZ6hBylgDE9vWEsq4_DYRV7Y4RhdlbkXYDXvA5YcnX6gIcFwmMRyTvNMGp9JKIGNJsSiaTeTp30pBnKo6spdS7Q=@protonmail.com> (raw)
In-Reply-To: <87il58a99j.fsf@xelera.eu>

Hi Gio,

On Friday, December 8th, 2023 at 9:34 AM, Giovanni Biscuolo <g@xelera.eu> wrote:

> 
> Hello,
> 
> I've noticed that the last released system installer [1], when using the
> guided install workflow, is using a LUKS1 encryption; since I would like
> to install on a LUKS2 encrypted root filesystem I tried to "manually"
> install following the instructions in the manual [2].
> 
> When using a LUKS2 encryption format [3], completing the installation
> and rebooting, I get an error from Grub: it cannot find the encrypted
> volume, it's trying to open the /unencrypted/ volume instead (via UUID),
> child of the LUKS2 encrypted one.
> 
> If I just change the type of encryption to "luks1" in [3], the booting
> of the installed machine works as expected.
> 
> Since I know that the LUKS2 support in Grub was not available when Guix
> 1.4 was released, I also tried to "guix pull && hash guix" /before/
> installing with "guix system init /mnt/etc/config.scm /mnt", but the
> error was the same.
> 
> I still have not tried to build an updated system installation image to
> see if it is working.
> 
> Since the (stable) manual provides instructions on how to install Guix
> System on a LUKS2 encrypted partition [4], I'd like to understand if I'm
> doing something wrong or there is a bug, at least in the manual.

About halfway through the email, your use of LUKS2 with Grub was tickling my brain about what I remembered reading regarding Grub's LUKS2 support being limited. While searching for references for that--and subsequently seeing that you were already using PBKDF2--I came across https://savannah.gnu.org/bugs/?55093 which seems to hold the answer. According to the newest comment, Grub 2.06 has a seemingly-undocumented additional requirement for working with LUKS2 of needing to use sha256 as the keyslot hash.

Additionally, https://wiki.archlinux.org/title/GRUB#LUKS2 suggests that Grub 2.06 requires manually creating an EFI binary using grub-mkimage (with grub-install once again being sufficient in 2.12rc1), though I don't know if the Guix bootloader machinery addresses that shortcoming or not.

Please take the above with a grain of salt, as I have only ever used LUKS1 with Grub (and I've recently started moving away from Grub). HTH!

Cheers,
Kaelyn

> I'm attaching the script I'm using for the "manual" installation: if I
> set "luks2" in the "cryptsetup luksFormat..." command /and/ uncomment
> the "guix pull && hash guix" commands, the installation provides an
> unbootable system.
> 
> Sorry for the "short story made long" but my script it's a proof of
> concept to allow installing a Guix System starting from any (recent)
> rescue system (tested only with a Guix install image and a systemd
> rescue system, grml), that's why is so "long":
> 
> 
> 
> Thanks! Gio'
> 
> [1] https://ftp.gnu.org/gnu/guix/guix-system-install-1.4.0.<arch>-linux.iso
> 
> 
> [2] https://guix.gnu.org/en/manual/en/html_node/Manual-Installation.html
> 
> [3] cryptsetup luksFormat --type luks2 --pbkdf pbkdf2 /dev/sdaX
> 
> [4] https://guix.gnu.org/en/manual/en/html_node/Keyboard-Layout-and-Networking-and-Partitioning.html
> 
> --
> Giovanni Biscuolo
> 
> Xelera IT Infrastructures


  reply	other threads:[~2023-12-08 19:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-08 17:34 problems installing on LUKS2 encrypted device Giovanni Biscuolo
2023-12-08 19:04 ` Kaelyn [this message]
2023-12-28 16:38   ` Josselin Poiret

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='ytQaJVaEWAiSax3KewwEmZ6hBylgDE9vWEsq4_DYRV7Y4RhdlbkXYDXvA5YcnX6gIcFwmMRyTvNMGp9JKIGNJsSiaTeTp30pBnKo6spdS7Q=@protonmail.com' \
    --to=kaelyn.alexi@protonmail.com \
    --cc=g@xelera.eu \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).