Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install CachyOS with encrypted ZFS and Grub #42

Open
christianhubmann opened this issue Dec 23, 2024 · 3 comments
Open

Cannot install CachyOS with encrypted ZFS and Grub #42

christianhubmann opened this issue Dec 23, 2024 · 3 comments

Comments

@christianhubmann
Copy link

Describe the bug
I tried installing CachyOS with Grub and encrypted ZFS root, but after installation begins, when the installer partitions the disk and creates the zpool, the installation fails with "Failed to create zpool" and aborts. Using the same partition layout but without encryption, the installation completes and the system boots successfully, so the only difference is the ZFS encryption.

I know that Grub does not support booting straight from ZFS, so I created a 2GB ext4 /boot partition (in addition to the ESP). As I said, when I use the same layout without encryption, the system boots successfully.

I have a different machine running CachyOS on encrypted ZFS root with systemd-boot and it works without issues. But since I want to dual boot with Windows, I can't use systemd-boot. In the past I had Ubuntu running with encrypted ZFS root and Grub (following this guide) so I would assume that it should also work in CachyOS.

CPU: AMD Ryzen 9 5900X
RAM: 32GB
GPU: AMD RX 7800 XT
UEFI boot
1TB NVME SSD

GPT partition table:

512M fat32 /boot/efi flags: boot
2048M ext4 /boot
(remaining) zfs / encrypted with passphrase
32G swap

I want to point out that in the install log, the following error appears:

2024-12-23 - 09:46:29 [6]:     .. Running QList("zpool", "create", "-f", "-o", "ashift=12", "-o", "autotrim=on", "-o", "compatibility=grub2", "-O", "mountpoint=none", "-O", "acltype=posixacl", "-O", "atime=off", "-O", "relatime=off", "-O", "xattr=sa", "-O", "normalization=formD", "-O", "encryption=aes-256-gcm", "-O", "keyformat=passphrase", "zpcachyos", "/dev/disk/by-partuuid/0c601402-09ca-4e4f-a959-cf36fbac0f64") 
2024-12-23 - 09:46:29 [6]:     .. Target cmd: QList("zpool", "create", "-f", "-o", "ashift=12", "-o", "autotrim=on", "-o", "compatibility=grub2", "-O", "mountpoint=none", "-O", "acltype=posixacl", "-O", "atime=off", "-O", "relatime=off", "-O", "xattr=sa", "-O", "normalization=formD", "-O", "encryption=aes-256-gcm", "-O", "keyformat=passphrase", "zpcachyos", "/dev/disk/by-partuuid/0c601402-09ca-4e4f-a959-cf36fbac0f64") Exit code: 1 output:
cannot create 'zpcachyos': Encryption feature not enabled.

When installing without encryption, the system boots successfully. When I then try to create an encryted dataset (e.g. for sensitive data), the same error is shown:

christian@Christian-PC ~> sudo zfs create -o encryption=on -o keyformat=passphrase zpcachyos/ROOT/cos/home/some_dataset
[sudo] password for christian: 
cannot create 'zpcachyos/ROOT/cos/home/some_dataset': Encryption feature not enabled.
christian@Christian-PC ~ [1]> 

So maybe the encryption feature doesn't get enabled when Grub is chosen?

To Reproduce

  1. Boot cachyos-desktop-linux-241221.iso (in VM but also happens bare-metal)
  2. Launch installer
  3. Choose Grub
  4. Choose "Manual partitioning"
    1. New Parition Table GPT
    2. Create 512M fat32 /boot/efi flags: boot
    3. Create 2048M ext4 /boot
    4. Create remaining zfs / encrypt with passphrase
    5. Optional swap partition
  5. On Desktop selection, I chose Gnome
  6. Start install
  7. After a few moments, the install fails with "Failed to create zpool"

Expected behavior
Install on encrypted ZFS root should work with grub.

Screenshots and Logs
Install log: https://termbin.com/jpo7

Additional context

@ptr1337
Copy link
Member

ptr1337 commented Dec 23, 2024

Thanks for your report!
It it fails to create a pool, then you need to wipe the complete disk manually before starting the installation.

This is sadly a bug in calamares, and we are not sure how to fix that :(

@christianhubmann
Copy link
Author

Hello Peter, thanks for the quick reply! Can you elaborate? The disk is completely empty when launching the installer (it's a newly created VM).

@ptr1337
Copy link
Member

ptr1337 commented Dec 23, 2024

Hello Peter, thanks for the quick reply! Can you elaborate? The disk is completely empty when launching the installer (it's a newly created VM).

Hi,
I will try later to reproduce this. Before the final release I made full testing across all filesystems and it worked. Ill let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants