"efibootmgr: Could not set variable Boot0000: No such file or directory" и "efibootmgr: Could not prepare boot variable: No such file or directory"

grub-efi-amd64-signed при установке для платформы x86_64-efi иногда (~1 из 20 тестов) не удается создать запись Boot0000 со следующими ошибками "efibootmgr: Could not set variable Boot0000: No such file or directory" и "efibootmgr: Could not prepare boot variable: No such file or directory"

Я даже попытался удалить все загрузочные записи перед запуском grub-install -v /dev/sda без успеха.

Я хочу добиться надежной работы с помощью grub, а не использовать rEFInd.

Менеджер загрузки rEFInd: Keeping rEFInd Booting

Следующая последовательность - это моя отладочная информация:

+ efibootmgr -v
BootCurrent: 0000
Timeout: 1 seconds
No BootOrder is set; firmware will attempt recovery
Boot0002* Hard Drive    BBS(HD,,0x0)AMGOAMNO........m.K.I.N.G.S.T.O.N. .S.M.S.2.0.0.S.3.6.0.G....................A.........................>..Gd-.;.A..MQ..L.0.5.2.0.B.6.2.7.1.6.3.0.5.B.B.D. . . . ......AMBOAMNO........{.K.i.n.g.s.t.o.n.D.a.t.a.T.r.a.v.e.l.e.r. .3...0.P.M.A.P....................A.......................N..Gd-.;.A..MQ..L.K.i.n.g.s.t.o.n.D.a.t.a.T.r.a.v.e.l.e.r. .3...0.P.M.A.P......AMBO
Boot0003* UEFI: KingstonDataTraveler 3.0PMAP    PciRoot(0x0)/Pci(0x1d,0x7)/USB(2,0)/HD(1,MBR,0x4294967189,0x800,0x1cdf000)AMBO

+ update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-131-generic
Found initrd image: /boot/initrd.img-4.4.0-131-generic
Found memtest86+ image: /boot/memtest86+.bin
done

++ seq 0 9
+ for i in '$(seq 0 9)'
+ efibootmgr -b 0000 -B
efibootmgr: Could not delete Boot0000: No such file or directory
efibootmgr: Could not delete boot variable: No such file or directory
+ for i in '$(seq 0 9)'
+ efibootmgr -b 0001 -B
efibootmgr: Could not delete Boot0001: No such file or directory
efibootmgr: Could not delete boot variable: No such file or directory
+ for i in '$(seq 0 9)'
+ efibootmgr -b 0002 -B
BootCurrent: 0000
Timeout: 1 seconds
No BootOrder is set; firmware will attempt recovery
Boot0003* UEFI: KingstonDataTraveler 3.0PMAP
+ for i in '$(seq 0 9)'
+ efibootmgr -b 0003 -B
BootCurrent: 0000
Timeout: 1 seconds
No BootOrder is set; firmware will attempt recovery
+ for i in '$(seq 0 9)'
+ efibootmgr -b 0004 -B
efibootmgr: Could not delete Boot0004: No such file or directory
efibootmgr: Could not delete boot variable: No such file or directory
+ for i in '$(seq 0 9)'
+ efibootmgr -b 0005 -B
efibootmgr: Could not delete Boot0005: No such file or directory
efibootmgr: Could not delete boot variable: No such file or directory
+ for i in '$(seq 0 9)'
+ efibootmgr -b 0006 -B
efibootmgr: Could not delete Boot0006: No such file or directory
efibootmgr: Could not delete boot variable: No such file or directory
+ for i in '$(seq 0 9)'
+ efibootmgr -b 0007 -B
efibootmgr: Could not delete Boot0007: No such file or directory
efibootmgr: Could not delete boot variable: No such file or directory
+ for i in '$(seq 0 9)'
+ efibootmgr -b 0008 -B
efibootmgr: Could not delete Boot0008: No such file or directory
efibootmgr: Could not delete boot variable: No such file or directory
+ for i in '$(seq 0 9)'
+ efibootmgr -b 0009 -B
efibootmgr: Could not delete Boot0009: No such file or directory
efibootmgr: Could not delete boot variable: No such file or directory
+ efibootmgr -v
BootCurrent: 0000
Timeout: 1 seconds
No BootOrder is set; firmware will attempt recovery

+ grub-install -v /dev/sda
grub-install: info: executing modprobe efivars 2>/dev/null.
grub-install: info: Looking for /sys/firmware/efi ...
grub-install: info: ...found.
Installing for x86_64-efi platform.
grub-install: info: cannot open `/boot/grub/device.map': No such file or directory.
grub-install: info: /dev/sda1 is not present.
grub-install: info: Looking for /dev/sda1.
grub-install: info: /dev/sda is a parent of /dev/sda1.
grub-install: info: /dev/sda1 starts from 34.
grub-install: info: opening the device hostdisk//dev/sda.
grub-install: info: drive = 0.
grub-install: info: the size of hostdisk//dev/sda is 117231408.
grub-install: info: drive = 0.
grub-install: info: the size of hostdisk//dev/sda is 117231408.
grub-install: info: Scanning for DISKFILTER devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid1x devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09_be devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09 devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for dmraid_nv devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for ldm devices on disk hostdisk//dev/sda.
grub-install: info: scanning hostdisk//dev/sda for LDM.
grub-install: info: no LDM signature found.
grub-install: info: Scanning for lvm devices on disk hostdisk//dev/sda.
grub-install: info: no LVM signature found.
grub-install: info: Scanning for DISKFILTER devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid1x devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09_be devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09 devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for dmraid_nv devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for ldm devices on disk hostdisk//dev/sda.
grub-install: info: scanning hostdisk//dev/sda for LDM.
grub-install: info: no LDM signature found.
grub-install: info: Scanning for lvm devices on disk hostdisk//dev/sda.
grub-install: info: no LVM signature found.
grub-install: info: Scanning for DISKFILTER devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid1x devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09_be devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09 devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for dmraid_nv devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for ldm devices on disk hostdisk//dev/sda.
grub-install: info: scanning hostdisk//dev/sda for LDM.
grub-install: info: no LDM signature found.
grub-install: info: Scanning for lvm devices on disk hostdisk//dev/sda.
grub-install: info: no LVM signature found.
grub-install: info: Scanning for DISKFILTER devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid1x devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09_be devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09 devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for dmraid_nv devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for ldm devices on disk hostdisk//dev/sda.
grub-install: info: scanning hostdisk//dev/sda for LDM.
grub-install: info: no LDM signature found.
grub-install: info: Scanning for lvm devices on disk hostdisk//dev/sda.
grub-install: info: no LVM signature found.
grub-install: info: Partition 0 starts from 34.
grub-install: info: /dev/sda1 is present.
grub-install: info: Looking for /dev/sda1.
grub-install: info: /dev/sda is a parent of /dev/sda1.
grub-install: info: /dev/sda1 starts from 34.
grub-install: info: opening the device hostdisk//dev/sda.
grub-install: info: drive = 0.
grub-install: info: the size of hostdisk//dev/sda is 117231408.
grub-install: info: drive = 0.
grub-install: info: the size of hostdisk//dev/sda is 117231408.
grub-install: info: Scanning for DISKFILTER devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid1x devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09_be devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09 devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for dmraid_nv devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for ldm devices on disk hostdisk//dev/sda.
grub-install: info: scanning hostdisk//dev/sda for LDM.
grub-install: info: no LDM signature found.
grub-install: info: Scanning for lvm devices on disk hostdisk//dev/sda.
grub-install: info: no LVM signature found.
grub-install: info: Scanning for DISKFILTER devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid1x devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09_be devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09 devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for dmraid_nv devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for ldm devices on disk hostdisk//dev/sda.
grub-install: info: scanning hostdisk//dev/sda for LDM.
grub-install: info: no LDM signature found.
grub-install: info: Scanning for lvm devices on disk hostdisk//dev/sda.
grub-install: info: no LVM signature found.
grub-install: info: Scanning for DISKFILTER devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid1x devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09_be devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09 devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for dmraid_nv devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for ldm devices on disk hostdisk//dev/sda.
grub-install: info: scanning hostdisk//dev/sda for LDM.
grub-install: info: no LDM signature found.
grub-install: info: Scanning for lvm devices on disk hostdisk//dev/sda.
grub-install: info: no LVM signature found.
grub-install: info: Scanning for DISKFILTER devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid1x devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09_be devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09 devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for dmraid_nv devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for ldm devices on disk hostdisk//dev/sda.
grub-install: info: scanning hostdisk//dev/sda for LDM.
grub-install: info: no LDM signature found.
grub-install: info: Scanning for lvm devices on disk hostdisk//dev/sda.
grub-install: info: no LVM signature found.
grub-install: info: Partition 0 starts from 34.
grub-install: info: /dev/sda1 is present.
grub-install: info: Looking for /dev/sda1.
grub-install: info: /dev/sda is a parent of /dev/sda1.
grub-install: info: /dev/sda1 starts from 34.
grub-install: info: opening the device hostdisk//dev/sda.
grub-install: info: drive = 0.
grub-install: info: the size of hostdisk//dev/sda is 117231408.
grub-install: info: drive = 0.
grub-install: info: the size of hostdisk//dev/sda is 117231408.
grub-install: info: Scanning for DISKFILTER devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid1x devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09_be devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09 devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for dmraid_nv devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for ldm devices on disk hostdisk//dev/sda.
grub-install: info: scanning hostdisk//dev/sda for LDM.
grub-install: info: no LDM signature found.
grub-install: info: Scanning for lvm devices on disk hostdisk//dev/sda.
grub-install: info: no LVM signature found.
grub-install: info: Scanning for DISKFILTER devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid1x devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09_be devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09 devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for dmraid_nv devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for ldm devices on disk hostdisk//dev/sda.
grub-install: info: scanning hostdisk//dev/sda for LDM.
grub-install: info: no LDM signature found.
grub-install: info: Scanning for lvm devices on disk hostdisk//dev/sda.
grub-install: info: no LVM signature found.
grub-install: info: Scanning for DISKFILTER devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid1x devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09_be devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09 devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for dmraid_nv devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for ldm devices on disk hostdisk//dev/sda.
grub-install: info: scanning hostdisk//dev/sda for LDM.
grub-install: info: no LDM signature found.
grub-install: info: Scanning for lvm devices on disk hostdisk//dev/sda.
grub-install: info: no LVM signature found.
grub-install: info: Scanning for DISKFILTER devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid1x devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09_be devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for mdraid09 devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for dmraid_nv devices on disk hostdisk//dev/sda.
grub-install: info: Scanning for ldm devices on disk hostdisk//dev/sda.
grub-install: info: scanning hostdisk//dev/sda for LDM.
grub-install: info: no LDM signature found.
grub-install: info: Scanning for lvm devices on disk hostdisk//dev/sda.
grub-install: info: no LVM signature found.
grub-install: info: Partition 0 starts from 34.
grub-install: info: drive = 0.
grub-install: info: the size of hostdisk//dev/sda is 117231408.
...grub-install info continued...
grub-install: info: adding 170 padding fixup entries.
grub-install: info: writing 960 bytes of a fixup block starting at 0xc000.
grub-install: info: reading /usr/lib/grub/x86_64-efi/fshelp.mod.
grub-install: info: reading /usr/lib/grub/x86_64-efi/ext2.mod.
grub-install: info: reading /usr/lib/grub/x86_64-efi/part_gpt.mod.
grub-install: info: reading /usr/lib/grub/x86_64-efi/search_fs_uuid.mod.
grub-install: info: reading /boot/grub/x86_64-efi/load.cfg.
grub-install: info: kernel_img=0xd7cc90, kernel_size=0x18a00.
grub-install: info: the core size is 0x1dbd8.
grub-install: info: writing 0x1ee00 bytes.
grub-install: info: copying `/usr/lib/shim/shimx64.efi.signed' -> `/boot/efi/EFI/ubuntu/shimx64.efi'.
grub-install: info: copying `/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed' -> `/boot/efi/EFI/ubuntu/grubx64.efi'.
grub-install: info: copying `/usr/lib/shim/mmx64.efi' -> `/boot/efi/EFI/ubuntu/mmx64.efi'.
grub-install: info: copying `/boot/grub/x86_64-efi/load.cfg' -> `/boot/efi/EFI/ubuntu/grub.cfg'.
grub-install: info: Registering with EFI: distributor = `ubuntu', path = `\EFI\ubuntu\shimx64.efi', ESP at hostdisk//dev/sda,gpt1.
grub-install: info: executing efibootmgr --version </dev/null >/dev/null.
grub-install: info: executing modprobe -q efivars.
grub-install: info: executing efibootmgr -c -d /dev/sda -p 1 -w -L ubuntu -l \EFI\ubuntu\shimx64.efi.
efibootmgr: Could not set variable Boot0000: No such file or directory
efibootmgr: Could not prepare boot variable: No such file or directory
Installation finished. No error reported.

+ update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-131-generic
Found initrd image: /boot/initrd.img-4.4.0-131-generic
Found memtest86+ image: /boot/memtest86+.bin
done

+ efibootmgr -v
BootCurrent: 0000
Timeout: 1 seconds
No BootOrder is set; firmware will attempt recovery

Я написал bash скрипт, чтобы на 100% воспроизвести эту проблему:

#!/bin/bash
# UEFI NVRAM Variable Reproducibility Unit Test
set -x
while true
do
        efibootmgr -v
        for i in $(seq 0 9)
        do
                efibootmgr -b 000$i -B
        done
        efibootmgr -v
        grub-install
        if [ $(efibootmgr -v | grep -c ubuntu) -eq 0 ]
        then
                echo "BUG!!! OS will now fail to boot!!!"
                exit 0
        fi
done

Ниже приведено мое обходное решение:

# ensure fallback UEFI NVRAM boot record variable exists
efibootmgr -c -d /dev/sda -p 1 -w -L fallback -l '\EFI\ubuntu\grubx64.efi'

Создание второй избыточной загрузочной записи - это идеальное обходное решение для моей ненадежной аппаратной проблемы. Таким образом, grub-install может продолжать удалять, редактировать и использовать запись Boot0000/ubuntu. Если запись Boot0000/ubuntu будет потеряна, то нетронутая запись Boot0001/fallback будет автоматически выбрана BIOS и загрузит ОС.

/var/log/kern.log -> kernel: [ 179.804812] efivars: set_variable() failed: status=8000000000000009

Это в сочетании с параметром ядра efi_no_storage_paranoia=1 дает мне необходимую аппаратную надежность.

0
задан 9 August 2018 в 13:23

1 ответ

У меня аналогичная проблема с моим ACER SWITCH3 SW312-31. Я связался со службой поддержки ACER и получил ответ, что единственный способ обновить EFI (прошивку) - использовать установленный windows10. Я никак не мог найти способ с установленным EFI обновить прошивку. К счастью, теперь я мог загружаться и регулярно входить в свою (корневую) учетную запись. Я не уверен, как я это сделал. Раньше я обновил ubuntu 19.04 до 19.10 и загрузил в EFI новые файлы GRUB / EFI. Затем снова случилось то, что я не мог войти в систему. Выяснилось, что графический драйвер не работает должным образом. Последним действием было отключение проверки безопасности EFI, и я смог войти в систему. Я проверю все журналы.

0
ответ дан 5 December 2019 в 12:10

Другие вопросы по тегам:

Похожие вопросы: