Аналог efibootmgr для windows

Время на прочтение5 мин

Количество просмотров87K

Добрый вечер, Habrahabr!

Сегодня мы научимся перезагружаться из Linux прямиком в Windows и обратно всего за один (двойной) клик.

image

Дано:

  • Два диска с GPT с разными ОС
  • Материнская плата с UEFI и отключеным Legacy Mode
  • Windows, которую бережно поставили с полной поддержкой UEFI
  • Linux (у меня Manjaro), который бережно поставили, выпилив любое упоминание GRUB и прочих старомодных вещей
  • rEFInd — красивый менеджер загрузки (нет, не загрузчик)

Надо:

  • Написать два скрипта на *sh и cmd (bat), которые позволят перезагрузиться в нужную ОС

Примечания:

  • Рабочие варианты обозначены, как Решение, остальное — мои рассуждения и описание пути к цели.
  • Я сознательно опускаю описание тех деталей, которые не относятся к сути настройки, либо легко варьируются. Упоминаются же эти детали потому, что для меня они не были очевидны на момент настройки, поэтому статья становится более понятной для неискушенных читателей, которые не будут видеть в ней инструкцию по рисованию совы.
  • Почему стоит быть осторожным при модификации NVRAM

Linux:

Linux is your bro

Linux — прекрасная база для работы с компьютером, поэтому всё, что нам нужно, уже есть в репозиториях, а коллективный разум сообщества знает всё и всегда готов помочь. Поэтому, после недолгого изучения интернета, ставим efibootmgr:

У меня это было так

sudo pacman -S efibootmgr

Отлично, теперь запускаем:

sudo efibootmgr

Видим что-то вроде этого

Timeout: 1 seconds
BootOrder: 0001,0000
Boot0000* Windows Boot Manager
Boot0001* rEFInd Boot Manager

Внимательные читатели уже наверняка заметили, что в выводе что-то не так, но тогда я был окрылён мыслью о том, что через 15 минут буду летать между операционками без проблем, и не обратил на это должного внимания.
Ок, 3 минуты на документацию, и мы находим нужный параметр «-n«, который выставляет кастомый порядок загрузки ровно на один раз. Пробуем выполнить эту команду:
Решение

sudo efibootmgr -n 0000 && sync && reboot

И оказываемся в Windows, как того и желали. Теперь эту команду записываем в скрипт/alias/*.desktop-файл и радуемся тому, как всё здорово получилось.

Windows:

Typical Windows

Началось всё с поиска аналога efibootmgr для Windows, которого в чистом виде, конечно же, нет. Для успокоения совести я даже попытался использовать Linux Subsystem, но это, конечно же, не сработало.
Беглый поиск по интернетам показал, что схожим функционалом по модификации NVRAM обладает утилита bcdedit. Отлично, думаю я, запускаю PowerShell из-под Администратора и пишу

bcdedit /enum firmware

Вот что я увидел


Firmware Boot Manager
---------------------
identifier              {fwbootmgr}
displayorder            {6893bb38-946b-11e7-b175-9301bd8a88f4}
                        {bootmgr}
timeout                 1

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume2
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  ru-RU
inherit                 {globalsettings}
default                 {current}
resumeobject            {6893bb40-946b-11e7-b175-9301bd8a88f4}
toolsdisplayorder       {memdiag}
timeout                 30

Firmware Application (101fffff)
-------------------------------
identifier              {6893bb38-946b-11e7-b175-9301bd8a88f4}
device                  partition=\Device\HarddiskVolume2
path                    \EFI\REFIND\REFIND_X64.EFI
description             rEFInd Boot Manager

Где Linux? Куда грузиться? Ненавижу винду
На самом деле оказалось, что виновата не Windows, а я (да-да, тот самый момент для внимательных пользователей), и вот почему: rEFInd — прекрасная утилита, которая обычно, для корректной работы, требует только установить себя. Она умеет подхватывать все .efi файлы, разные дистрибутивы с разными ядрами, сама подставляет иконки. Прелесть, а не инструмент. Но это сыграло со мной злую шутку, так как оказалось, что UEFI ничего не знает про Linux, так как отсутствует соответствующий ему .efi-файл.
Поэтому презагружаемся обратно в Linux, конфигурируем systemd-boot (bootctl). Теперь всё выглядит вот так:

Timeout: 1 seconds
BootOrder: 0001,0003,0000,0002
Boot0000* Windows Boot Manager
Boot0001* rEFInd Boot Manager
Boot0002* Linux Boot Manager
Boot0003* Manjaro

Возвращаемся обратно и снова запускаем.

bcdedit /enum firmware

Вот что я увидел теперь


Firmware Boot Manager
---------------------
identifier              {fwbootmgr}
displayorder            {6893bb38-946b-11e7-b175-9301bd8a88f4}
                        {bootmgr}
                        {ff0bc716-c088-11e7-bf74-000acd2dac7d}
                        {ff0bc716-c088-11e7-bf74-000acd2dac7d}
timeout                 1

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume2
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  ru-RU
inherit                 {globalsettings}
default                 {current}
resumeobject            {6893bb40-946b-11e7-b175-9301bd8a88f4}
toolsdisplayorder       {memdiag}
timeout                 30

Firmware Application (101fffff)
-------------------------------
identifier              {6893bb38-946b-11e7-b175-9301bd8a88f4}
device                  partition=\Device\HarddiskVolume2
path                    \EFI\REFIND\REFIND_X64.EFI
description             rEFInd Boot Manager

Firmware Application (101fffff)
-------------------------------
identifier              {ff0bc716-c088-11e7-bf74-000acd2dac7d}
device                  partition=\Device\HarddiskVolume2
path                    \EFI\SYSTEMD\SYSTEMD-BOOTX64.EFI
description             Linux Boot Manager

Firmware Application (101fffff)
-------------------------------
identifier              {ff0bc717-c088-11e7-bf74-000acd2dac7d}
device                  partition=\Device\HarddiskVolume1
path                    \EFI\manjaro\vmlinuz-4.13-x86_64
description             Manjaro

Тут стоит упомянуть, что проблему мне помогали решать пользователи reddit. Именно благодаря им мы имеем следующий шаг:

bcdedit /bootsequence {ff0bc716-c088-11e7-bf74-000acd2dac7d}

Где аргументом является identifier необходимого варианта — Linux Boot Manager.

Troubleshooting

Powershell не даёт нормально выполнить эту команду, ругаясь на

The entry list data is not valid as specified.

Всё из-за того, что Microsoft периодически любит что-нибудь сломать. Решение просто и элегантно — вызываем классический CMD и работаем в нём. Это можно сделать командой

cmd

Перезагружаемся и видим, что порядок загрузки не изменился, а мы оказались в первом элементе в BootOrder (у меня это был rEFInd), выбираем Windows и видим страшный привет из времен DOS, который говорит нам, что \EFI\SYSTEMD\SYSTEMD-BOOTX64.EFI не найден. Да, мы изменили параметры загрузчика Windows, но не UEFI.
Борьба с этой ошибкой заняла у меня все праздники, но ничего путного не получалось. Я уже подумывал написать на C++ небольшую программку для этого (то, что это возможно, следует из существования такого софта, как EasyUEFI).
Но тут на очередном сайте я обнаружил вот такую конструкцию

 bcdedit /set {bootmgr} path ....

И тут меня осенило, что можно прямо сказать bcdedit что и куда писать. Дальше стоило только проверить догадку:
Решение

bcdedit.exe /set {fwbootmgr} bootsequence {ff0bc716-c088-11e7-bf74-000acd2dac7d} /addfirst

Тут важно, что мы явно сказали писать не в {bootmgr} (как он, видимо, делает по-умолчанию), а в {fwbootmgr}, что и является нашими настройками UEFI.
Перезагружаемся, и всё работает так, как мы этого хотели. Сохраняем это дело в bat/lnk, дописываем

shutdown /r /t 0

Выставляем запуск из-под администратора и готово!
Спасибо за внимание! Буду крайне рад замечаниям по технической части в комментариях, замечаниям по оформлению — в ЛС.

Android

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Android Developers Blog

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Qt Blog

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

LLVM Project Blog

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Chromium Blog

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

w00tsec

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Malwarebytes

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Blog RSS

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Blog — NVM Express

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Schneier on Security

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Rapid7 Blog

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Search Msdn

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Replicant

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

IoTivity blogs

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Bootlin

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

FreeBSD Foundation

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Ubuntu blog

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

FSF News

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Blog — Xen Project

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Red Hat Blog

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Planet openSUSE

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Fedora People

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Planet Debian

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Blog

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Kali Linux

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Linaro

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

ASSET InterTech

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Sage

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Lenovo EDU Community

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

System76 Blog RSS Feed

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

Purism

Just another WordPress.com site

bunnie’s blog

Hastily-written news/info on the firmware security/development communities, sorry for the typos.

You probably dont know anything about this, because you still haven’t figured out what is the point.

I mentioned Linux in my first post «efibootmgr alternative» — since efibootmgr is Linux program, and we are on Windows forum its obvious that i want Windows program that can do stuff like efibootmgr does. You have no idea about it.

About laptops blocking messing with uefi boot — its not safeboot but Secure Boot.

Who was talking about laptop? PC in general, is desktop, and even if i had laptop, Secure Boot can be disabled.

I really dont think that bcdboot can be used for «talking to Linux» (thats what you said) i wanted to modify UEFI boot order in NVRAM.

Bcdboot create files needed for booting for both legacy (BIOS) systems as well as UEFI systems. For leagacy, this write BOOTMGR (bootloader since NT 6.x) to PBR of system volume and create other boot files. It works on MBR disks only. For UEFI, it copy windows loader (EFI executable binary) and other needed files to ESP (usually 1st partition, few hundred megs. fat32 formatted) and creates new UEFI boot entry in NVRAM. I think its obvious that these are completely different and incompatible (BIOS/UEFI). UEFI booting is supported on all x64 versions of Windows since Vista.

If you still not got it, Bcdboot can create UEFI boot entry in NVRAM, so its possible to work with it from Windows.

These «linux codes» i send you, arent outdated.

Now i’m asking again, is there any efibootmgr alternative for Windows?

EDIT: leave that thread, really, i dont think that you can help me

A Linux user-space application to modify the Intel Extensible Firmware Interface (EFI) Boot Manager. This application can create and destroy boot entries, change the boot order, change the next running boot option, and more.

We have listed more than 10 alternatives to efibootmgr.
You can find them below.
The top competitors are: GRUB, Grub2Win, and Clover EFI bootloader.
Apart from the top ones, people
also compare efibootmgr with
rEFIt, EasyUEFI, and OpenCore.

Best efibootmgr Alternatives & Competitors in 2025

The best efibootmgr alternatives based on verified products, community votes, reviews and other factors.

Filter:

5
Open-Source Alternatives.

Latest update:

  1. /grub-alternatives

  2. Safely dual boot Windows and Linux without touching the Windows MBR.

    /grub2win-alternatives

  3. Clear, Fast & Unlimited. Residential & Mobile Proxies For Best Price.

    Try for free
    paid
    Free Trial
    $3.0 (3$ per 1 Gb)

    ASocks screenshot

    Try for free

  4. This is EFI-based bootloader for BIOS-based computers created as a replacement to EDK2/Duet…

    /clover-efi-bootloader-alternatives

  5. rEFIt is a boot menu and maintenance toolkit for EFI-based machines like the Intel Macs.

    /refit-alternatives

  6. Manage EFI/UEFI Boot Options & Manage EFI System Partitions & Fix EFI/UEFI Boot Issues

    /easyuefi-alternatives

  7. OpenCore is a modern open-source macOS boot loader

    /opencore-alternatives

  8. Grub Customizer is a graphical interface to configure the GRUB2/BURG settings and menuentries.

    /grub-customizer-alternatives

  9. Das U-Boot (the Universal Bootloader) and Embedded Linux

    /u-boot-alternatives

  10. Limine is an advanced x86/x86_64 BIOS and UEFI bootloader that supports modern PC features such as Long Mode, 5-level paging, multi-core startup, and more thanks to the stivale and stivale2 boot protocols.

    Open Source

    /limine-alternatives

  11. LaunchDarkly is a powerful development tool which allows software developers to roll out updates and new features.

    /launchdarkly-alternatives

  12. Burg is a brand-new boot loader based on https://alternativeto.net/software/grub/.

    /burg-alternatives

  13. Systemd-Boot, formerly known as Gummiboot, is one of the simplest UEFI boot managers that lets you boot Linux and Windows in EFI mode even if the system is BIOS only supported.

    /systemd-boot-alternatives

  14. Download Bootice — Edit your computer’s MBR and PBR settings with various built-in tools such as a partition manager, UEFI editor, BCD configurator, and more

    /bootice-alternatives

Suggest an alternative

If you think we’ve missed something, please suggest an alternative to efibootmgr.

SysAid

SysAid is a robust IT Service Management (ITSM) platform powered by Agentic AI, automating the repetitive, time-consuming work.
featured

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Лучшая версия windows 10 ltsc
  • Не подключается блютуз колонка к ноутбуку windows 10
  • При установке windows 10 пишет oobekeyboard
  • Libreoffice для windows 2000
  • Как изменить положение второго монитора windows 10