Hi all!
I’m trying to deploy an Ubuntu 24 image with a crypted partition to be used by lvm.
The storage part of my curtin file is the following:
storage:
version: 1
config:
# Disk
- id: disk-nvme
type: disk
ptable: gpt
path: /dev/nvme0n1
wipe: superblock
preserve: false
grub_device: true
# Partitions
- id: part-efi
type: partition
device: disk-nvme
size: 512M
preserve: false
- id: part-boot
type: partition
device: disk-nvme
size: 5G
preserve: false
- id: part-lvm
type: partition
device: disk-nvme
size: 60G
preserve: false
# Crypt
- id: part-lvm_crypt
type: dm_crypt
dm_name: lvm_crypt
volume: part-lvm
key: testtest
keysize: '512'
# LVM
- id: vg0
name: volgroup0
type: lvm_volgroup
devices: [part-lvm_crypt]
- id: lv-var
type: lvm_partition
volgroup: vg0
name: lv_var
size: 20G
- id: lv-root
type: lvm_partition
volgroup: vg0
name: lv_root
size: 30G
# Format fs
- id: fs-efi
type: format
volume: part-efi
fstype: fat32
- id: fs-boot
type: format
volume: part-boot
fstype: ext4
- id: fs-var
type: format
volume: lv-var
fstype: ext4
- id: fs-root
type: format
volume: lv-root
fstype: ext4
# Mounts
- id: mount-efi
type: mount
device: fs-efi
path: /boot/efi
- id: mount-boot
type: mount
device: fs-boot
path: /boot
- id: mount-root
type: mount
device: fs-root
path: /
- id: mount-var
type: mount
device: fs-var
path: /var
But during deployment i recieve this error:
finish: cmd-install/stage-curthooks/builtin/cmd-curthooks/install-grub: FAIL: installing grub to target devices
finish: cmd-install/stage-curthooks/builtin/cmd-curthooks/configuring-bootloader: FAIL: configuring target system bootloader
finish: cmd-install/stage-curthooks/builtin/cmd-curthooks: FAIL: curtin command curthooks
Traceback (most recent call last):
File "/curtin/curtin/commands/main.py", line 202, in main
ret = args.func(args)
^^^^^^^^^^^^^^^
File "/curtin/curtin/commands/curthooks.py", line 1918, in curthooks
builtin_curthooks(cfg, target, state)
File "/curtin/curtin/commands/curthooks.py", line 1883, in builtin_curthooks
setup_grub(cfg, target, osfamily=osfamily,
File "/curtin/curtin/commands/curthooks.py", line 821, in setup_grub
install_grub(instdevs, target, uefi=uefi_bootable, grubcfg=grubcfg)
File "/curtin/curtin/commands/install_grub.py", line 444, in install_grub
in_chroot.subp(cmd, env=env, capture=True)
File "/curtin/curtin/util.py", line 792, in subp
return subp(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/curtin/curtin/util.py", line 280, in subp
return _subp(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/curtin/curtin/util.py", line 144, in _subp
raise ProcessExecutionError(stdout=out, stderr=err,
curtin.util.ProcessExecutionError: Unexpected error while running command.
Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmpdipsl60_/target', '/usr/lib/grub/grub-multi-install']
Exit code: 1
Reason: -
Stdout: ''
Stderr: Installing grub to /var/lib/grub/esp.
Installing for x86_64-efi platform.
grub-install: error: attempt to install to encrypted disk without cryptodisk enabled. Set `GRUB_ENABLE_CRYPTODISK=y' in file `/etc/default/grub'.
It seems that MAAS is trying to install the grub in /var/lib/grub/esp (don’t know why) and fails to access it as it is crypted.
If i remove the crypting config, and install lvm on the uncrypted partition, everything works fine.
I already dug into some documentation:
general guidance: Deploying servers with full disk encryption (LUKS2)
Or a similar problem: LVM Storage Template breaks Installation on 20.04
…but nothing seems to work.
Do you have any idea on why MAAS is trying to install the grub in that folder? Am i missing something?
Thanks in advance!!!