uefi, bios, gpt+lvm config

Bug #1934483 reported by sascha arthur
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
subiquity
New
Undecided
Unassigned

Bug Description

Hello,

Im trieing to archive an configuration which is using GPT (including LVM) which is bootable via BIOS/UEFI.

Currently im having this config here:

# user-data
autoinstall:
  version: 1
  storage:
    grub:
      reorder_uefi: false
    swap:
      size: 0
    config:
    - {ptable: gpt, preserve false, name: '', grub_device: true, type: disk, id: biggestDisk, wipe: superblock-recursive, match: { "size": "largest" } }

    - {device: biggestDisk, size: 512MB, flag: boot, number: 1, preserve: false, grub_device: true, type: partition, id: biggestDiskPartions-p1}
    - {fstype: vfat, volume: biggestDiskPartions-p1, preserve: false, type: format, id: format-efi}

    - {device: biggestDisk, size: 1024MB, flag: bios_grub, number: 2, preserve: false, grub_device: false, type: partition, id: biggestDiskPartions-p2}
    - {fstype: ext4, volume: biggestDiskPartions-p2, preserve: false, type: format, id: format-bios}

    - {device: biggestDisk, size: -1, flag: linux, number: 3, preserve: false, type: partition, id: biggestDiskPartions-p3}
    - {name: ubuntu-vg, devices: [biggestDiskPartions-p3], preserve: false, type: lvm_volgroup, id: biggestDiskVolgroup-0 }
    - {name: lv-root, volgroup: biggestDiskVolgroup-0, size: 100%, preserve: false, type: lvm_partition, id: lvm-partition-lv-root}
    - {fstype: ext4, volume: lvm-partition-lv-root, preserve: false, type: format,id: format-root}

    - {device: format-root, path: /, type: mount, id: mount-2}
    - {device: format-bios, path: /boot, type: mount, id: mount-1}
    - {device: format-efi, path: /boot/efi, type: mount, id: mount-3}

This one works completely out using an EFI system.

Installing this config on an BIOS system, it runs completely through the installer but after the 'grub install stage' it complains with:

-----------------------------------------------------------------------

       Running command ['udevadm', 'settle'] with allowed return codes [0] (capture=False)
        TIMED subp(['udevadm', 'settle']): 0.018
        Running command ['umount', '/target/sys'] with allowed return codes [0] (capture=False)
        Running command ['umount', '/target/run'] with allowed return codes [0] (capture=False)
        Running command ['umount', '/target/proc'] with allowed return codes [0] (capture=False)
        Running command ['umount', '/target/dev'] with allowed return codes [0] (capture=False)
        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 "/snap/subiquity/2501/lib/python3.6/site-packages/curtin/commands/main.py", line 202, in main
            ret = args.func(args)
          File "/snap/subiquity/2501/lib/python3.6/site-packages/curtin/commands/curthooks.py", line 1891, in curthooks
            builtin_curthooks(cfg, target, state)
          File "/snap/subiquity/2501/lib/python3.6/site-packages/curtin/commands/curthooks.py", line 1857, in builtin_curthooks
            variant=distro_info.variant)
          File "/snap/subiquity/2501/lib/python3.6/site-packages/curtin/commands/curthooks.py", line 809, in setup_grub
            install_grub(instdevs, target, uefi=uefi_bootable, grubcfg=grubcfg)
          File "/snap/subiquity/2501/lib/python3.6/site-packages/curtin/commands/install_grub.py", line 398, in install_grub
            in_chroot.subp(cmd, env=env, capture=True)
          File "/snap/subiquity/2501/lib/python3.6/site-packages/curtin/util.py", line 708, in subp
            return subp(*args, **kwargs)
          File "/snap/subiquity/2501/lib/python3.6/site-packages/curtin/util.py", line 275, in subp
            return _subp(*args, **kwargs)
          File "/snap/subiquity/2501/lib/python3.6/site-packages/curtin/util.py", line 141, in _subp
            cmd=args)
        curtin.util.ProcessExecutionError: Unexpected error while running command.
        Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/target', 'grub-install', '/dev/vda1']
        Exit code: 1
        Reason: -
        Stdout: ''
        Stderr: Installing for i386-pc platform.
                grub-install: warning: File system `fat' doesn't support embedding.
                grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
                grub-install: error: will not proceed with blocklists.

        Unexpected error while running command.
        Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/target', 'grub-install', '/dev/vda1']
        Exit code: 1
        Reason: -
        Stdout: ''
        Stderr: Installing for i386-pc platform.
                grub-install: warning: File system `fat' doesn't support embedding.
                grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
                grub-install: error: will not proceed with blocklists.
-----------------------------------------------------------------------

setting grub_device to false for 'biggestDiskPartions-p1', let the installer run trough without complaining. But sadly afterwards its not booting the OS, but is stuck at "booting from disk ..."

Any idea how to fix this / getting a config which works for both worlds (EFI+BIOS)?

Revision history for this message
sascha arthur (sarthur) wrote (last edit ):

Found here an example which is similar to mine:

https://gist.github.com/bitsandbooks/6e73ec61a44d9e17e1c21b3b8a0a9d4c

Sadly this one doesn't work as well for BIOS boot method...

Using the mentioned config, the autoinstaller complains with:

"autoinstall config did not create needed bootloader partition"

which im sometimes running into as well..

Looking forward to a solution also will further invest some time into the issue..

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Yeah this isn't supported currently. We'd like it to be, it just never gets to the top of the todo list :(

Revision history for this message
sascha arthur (sarthur) wrote :

any updates on this one? :D

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.