[Bug 2085818] Re: Failure to deploy because of inability to set EFI variable

Mate Kukri 2085818 at bugs.launchpad.net
Thu Nov 14 17:50:45 UTC 2024


> grub-install: warning: Cannot set EFI variable Boot0000.
> grub-install: warning: efivarfs_set_variable: writing to fd 8 failed: Input/output error.
> grub-install: warning: _efi_set_variable_mode: ops->set_variable() failed: Input/output error.

This is usually caused by the firmware reporting a failure when trying
to set an EFI variable.

It is unclear that this is in actual issue in GRUB.

What is the age and model of the system in question? Older firmware are
known to have buggy EFI variable implementations where the variable
storage space fills up and they fail to perform garbage collection
correctly.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/2085818

Title:
  Failure to deploy because of inability to set EFI variable

Status in curtin:
  Incomplete
Status in MAAS:
  New
Status in grub2 package in Ubuntu:
  New

Bug description:
  $ snap info maas | grep installed
  installed:          3.5.1-16317-g.409891638                  (36889) 197MB held

  MAAS Host: 22.04 LXD VM

  
  Deploying tatanga, an ARM64 system in TOR-3, fails with the following messages in the installation output:

          Running command ['mount', '--make-private', '/tmp/tmp_6qzhgdl/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
          Running command ['umount', '/tmp/tmp_6qzhgdl/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
          Running command ['mount', '--make-private', '/tmp/tmp_6qzhgdl/target/sys'] with allowed return codes [0] (capture=False)
          Running command ['umount', '/tmp/tmp_6qzhgdl/target/sys'] with allowed return codes [0] (capture=False)
          Running command ['mount', '--make-private', '/tmp/tmp_6qzhgdl/target/run'] with allowed return codes [0] (capture=False)
          Running command ['umount', '/tmp/tmp_6qzhgdl/target/run'] with allowed return codes [0] (capture=False)
          Running command ['mount', '--make-private', '/tmp/tmp_6qzhgdl/target/proc'] with allowed return codes [0] (capture=False)
          Running command ['umount', '/tmp/tmp_6qzhgdl/target/proc'] with allowed return codes [0] (capture=False)
          Running command ['mount', '--make-private', '/tmp/tmp_6qzhgdl/target/dev'] with allowed return codes [0] (capture=False)
          Running command ['umount', '/tmp/tmp_6qzhgdl/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 "/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/tmp_6qzhgdl/target', '/usr/lib/grub/grub-multi-install']
          Exit code: 1
          Reason: -
          Stdout: ''
          Stderr: Installing grub to /boot/efi.
                  Installing for arm64-efi platform.
                  grub-install: warning: Cannot set EFI variable Boot0000.
                  grub-install: warning: efivarfs_set_variable: writing to fd 8 failed: Input/output error.
                  grub-install: warning: _efi_set_variable_mode: ops->set_variable() failed: Input/output error.
                  grub-install: error: failed to register the EFI boot entry: Input/output error.

          Unexpected error while running command.
          Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmp_6qzhgdl/target', '/usr/lib/grub/grub-multi-install']
          Exit code: 1
          Reason: -
          Stdout: ''
          Stderr: Installing grub to /boot/efi.
                  Installing for arm64-efi platform.
                  grub-install: warning: Cannot set EFI variable Boot0000.
                  grub-install: warning: efivarfs_set_variable: writing to fd 8 failed: Input/output error.
                  grub-install: warning: _efi_set_variable_mode: ops->set_variable() failed: Input/output error.
                  grub-install: error: failed to register the EFI boot entry: Input/output error.

  Stderr: ''

  Using rescue mode, I was  able to create an EFI entry for the disk-
  based boot loader without problem:

  ubuntu at tatanga:~$ sudo efibootmgr -c -d /dev/nvme0n1 -p 1 -l \\EFI\\ubuntu\\shimaa64.efi -L "ubuntu"
  efibootmgr: ** Warning ** : Boot0007 has same label ubuntu
  BootCurrent: 0005
  Timeout: 5 seconds
  BootOrder: 0000,0005,0006,0001,0003,0004,0007
  Boot0001* UEFI: Built-in EFI Shell
  Boot0003  UEFI: PXE IPv4 Intel(R) Network 18:C0:4D:82:E0:C8
  Boot0004  UEFI: PXE IPv4 Intel(R) Network 18:C0:4D:82:E0:C9
  Boot0005* UEFI: PXE IPv4 Mellanox Network 0C:42:A1:52:2D:00
  Boot0006* UEFI: PXE IPv4 Mellanox Network 0C:42:A1:52:2D:01
  Boot0007  ubuntu
  Boot0000* ubuntu

  This was my second attempt to deploy the node; the first one failed
  with a message to the effect that it was unable to delete Boot0000
  (which was an "ubuntu" boot-to-disk entry). I used rescue mode to
  delete that entry without problem.

To manage notifications about this bug go to:
https://bugs.launchpad.net/curtin/+bug/2085818/+subscriptions




More information about the foundations-bugs mailing list