Grub не видит windows boot manager

Все способы:

  • Способ 1: Установка Windows на диск с Linux
  • Способ 2: Обнаружение раздела Windows
  • Способ 3: Ручное добавление загрузчика
  • Вопросы и ответы: 0

Способ 1: Установка Windows на диск с Linux

Одной из наиболее распространенных причин отсутствия Windows 10 в загрузочном меню «Grub» является установка Windows не на тот же физический диск, на который устанавливается Linux. Если нужно установить на один компьютер Windows и Linux, устанавливайте их по возможности на один физический жесткий диск, причем первой необходимо установить Windows. Если сперва будет установлена Linux, а затем Windows, то есть большая вероятность, что загрузчик Windows затрет «Grub».

Способ 2: Обнаружение раздела Windows

Если переустановка Windows 10 по какой-то причине невозможна, попробуйте обнаружить ее из среды Linux и добавить в загрузчик последней.

  1. Определите в Linux название раздела, на который установлена Windows. Получить сведения о дисках и разделах в Linux можно как из «Терминала», так и с помощью штатного приложения «Дисковая утилита». Скопируйте или запомните название устройства. Например, это будет «/dev/sda1».
  2. grub не видит Windows 10.1

  3. Откройте «Терминал» и примонтируйте раздел с Windows 10, для чего выполните команду sudo mount -t ntfs-3g -o ro /dev/sda1, где /dev/sda1 — полученный на предыдущем этапе путь к тому с Windows.
  4. Чтобы обнаружить Windows 10, выполните тут же в «Терминале» команду sudo os-prober.
  5. grub не видит Windows 10.2

  6. В случае успешного обнаружения Windows обновите конфигурацию «Grub» командой sudo update-grub либо же sudo grub2-mkconfig -o /boot/grub/grub.cfg.
  7. grub не видит Windows 10.3

Способ 3: Ручное добавление загрузчика

При использовании первого способа вероятность сходу обнаружить и прописать Windows 10 в линуксовый загрузчик довольно невелика. Более сложным, но и более эффективным способом восстановления записи Windows 10 в загрузочном меню Grub является ручное добавление. Способ универсальный, использовать его можно не только при потере Windows 10, но и других операционных систем Windows.

  1. Узнайте название раздела с Windows как было показано в первом пункте предыдущего способа.
  2. Определите UUID раздела, на котором установлена Windows 10, для чего выполните в «Терминале» команду blkid /dev/sda1, где /dev/sda1 — название раздела с Windows.
  3. grub не видит Windows 10.4

  4. Откройте любым текстовым редактором файл /etc/grub.d/40_custom и вставьте в него следующий код, где XXXXXXXXXXXXXXXX — полученный на предыдущем шаге UUID:

    menuentry "Windows 10" {
    insmod ntfs
    set root='(hd0,1)'
    search --no-floppy --fs-uuid --set XXXXXXXXXXXXXXXX
    chainloader +1
    }
    .
    Сохраните файл.

  5. grub не видит Windows 10.5

  6. Обновите конфигурацию Grub командой sudo update-grub, перезагрузите компьютер и посмотрите, появилась ли Windows в загрузочном меню Grub.

Если восстановить/добавить запись Windows 10 в загрузочное меню «Grub» не удалось, проверьте, не удален ли на диске служебный 100 МБ NTFS-раздел с загрузочными файлами. Если удален, можно будет попробовать его восстановить, но будет гораздо проще переустановить Windows и Linux. В том случае, когда используется «Grub 2» на UEFI, попробуйте включить в BIOS режим «Legacy».

Наша группа в TelegramПолезные советы и помощь


0

1

Здравствуйте, установил вчера кое как арч линукс второй системой на ноут. Теперь не могу запустить windows. Grub не видит её.
В общем устанавливал я не с первого раза, использовал новый установщик archinstall. Попыток наверно 5 сделал и все заканчивались красным страшным текстом на весь монитор, что что то там не получилось, как я понял не получалось efi раздел смонтировать или не туда он монтировался, я испробовал много разных вариантов, которые раньше работали, но сейчас почему то не вышло.
Установил я арч без загрузчика и потом из chroot смонтировал /dev/nvme0n1p1 (efi раздел 4гб) в /boot, и там появилась папка EFI. Далее установил grub (он сам нашел efi раздел) и о чудо все заработало. Но в grub нет windows. Погуглил я и не нашел решения моего вопроса, везде советуют #grub-mkconfig -o /boot/grub/grub.cfg, но grub.cfg у меня нет в системе в принципе.

Вот дерево /boot:

/boot
├── EFI
│   ├── arch
│   ├── Boot
│   │   └── bootx64.efi
│   ├── grub
│   │   └── grubx64.efi
│   ├── Lenovo
│   │   └── BIOS
│   │       └── SelfHealing.fd
│   └── Microsoft
│       ├── Boot
│       │   ├── BCD
│       │   ├── BCD.LOG
│       │   ├── BCD.LOG1
│       │   ├── BCD.LOG2
│       │   ├── bg-BG
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── bootmgfw.efi
│       │   ├── bootmgr.efi
│       │   ├── BOOTSTAT.DAT
│       │   ├── boot.stl
│       │   ├── cs-CZ
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── da-DK
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── de-DE
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── el-GR
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── en-GB
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── en-US
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── es-ES
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── es-MX
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── et-EE
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── fi-FI
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── Fonts
│       │   │   ├── chs_boot.ttf
│       │   │   ├── cht_boot.ttf
│       │   │   ├── jpn_boot.ttf
│       │   │   ├── kor_boot.ttf
│       │   │   ├── malgun_boot.ttf
│       │   │   ├── malgunn_boot.ttf
│       │   │   ├── meiryo_boot.ttf
│       │   │   ├── meiryon_boot.ttf
│       │   │   ├── msjh_boot.ttf
│       │   │   ├── msjhn_boot.ttf
│       │   │   ├── msyh_boot.ttf
│       │   │   ├── msyhn_boot.ttf
│       │   │   ├── segmono_boot.ttf
│       │   │   ├── segoen_slboot.ttf
│       │   │   ├── segoe_slboot.ttf
│       │   │   └── wgl4_boot.ttf
│       │   ├── fr-CA
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── fr-FR
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── hr-HR
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── hu-HU
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── it-IT
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── ja-JP
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── kd_02_10df.dll
│       │   ├── kd_02_10ec.dll
│       │   ├── kd_02_1137.dll
│       │   ├── kd_02_14e4.dll
│       │   ├── kd_02_15b3.dll
│       │   ├── kd_02_1969.dll
│       │   ├── kd_02_19a2.dll
│       │   ├── kd_02_1af4.dll
│       │   ├── kd_02_8086.dll
│       │   ├── kd_07_1415.dll
│       │   ├── kd_0C_8086.dll
│       │   ├── kdnet_uart16550.dll
│       │   ├── kdstub.dll
│       │   ├── ko-KR
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── lt-LT
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── lv-LV
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── memtest.efi
│       │   ├── nb-NO
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── nl-NL
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── pl-PL
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── pt-BR
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── pt-PT
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── qps-ploc
│       │   │   └── memtest.efi.mui
│       │   ├── Resources
│       │   │   ├── bootres.dll
│       │   │   ├── en-US
│       │   │   │   └── bootres.dll.mui
│       │   │   └── ru-RU
│       │   │       └── bootres.dll.mui
│       │   ├── ro-RO
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── ru-RU
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── sk-SK
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── sl-SI
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── sr-Latn-RS
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── sv-SE
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── tr-TR
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   ├── uk-UA
│       │   │   ├── bootmgfw.efi.mui
│       │   │   └── bootmgr.efi.mui
│       │   ├── winsipolicy.p7b
│       │   ├── zh-CN
│       │   │   ├── bootmgfw.efi.mui
│       │   │   ├── bootmgr.efi.mui
│       │   │   └── memtest.efi.mui
│       │   └── zh-TW
│       │       ├── bootmgfw.efi.mui
│       │       ├── bootmgr.efi.mui
│       │       └── memtest.efi.mui
│       └── Recovery
│           ├── BCD
│           ├── BCD.LOG
│           ├── BCD.LOG1
│           └── BCD.LOG2
└── System Volume Information

51 directories, 142 files

Вот вывод fdisk -l:

Disk /dev/nvme0n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: SAMSUNG MZVLB1T0HBLR-000L2              
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 406BE08F-2983-4B8D-976D-A6BB8EE68842

Device             Start        End    Sectors   Size Type
/dev/nvme0n1p1      2048    8194047    8192000   3.9G EFI System
/dev/nvme0n1p2   8194048    8226815      32768    16M Microsoft reserved
/dev/nvme0n1p3   8226816  928724961  920498146 438.9G Microsoft basic data
/dev/nvme0n1p4 928724992  929791999    1067008   521M Windows recovery environment
/dev/nvme0n1p6 937984000 2000408575 1062424576 506.6G Linux filesystem

Я допускаю, что я рукожоп и криво установил grub, но даже теперь не знаю что делать, нужно что бы в grub был выбор windows и arch. Хелп!

Warp Terminal

One of the issues I encountered after dual booting Windows with Linux is the missing Windows entry from the grub menu.

Here’s the scenario. Windows was present on the computer. I installed CachyOS alongside Windows. I selected to install the Grub bootloader that allows booting into Linux, Windows (and any other OS present on the system) along with the option to access UEFI.

Only this time, Grub did not show Windows in the menu 😔

Windows missing from grub bootloader in dual boot

Missing Windows from Grub bootloader

That was disappointing but not surprising because I am aware that this is a feature.

Let me show you how you can fix this by enabling os-prober feature in Grub and then updating it.

Step 1: Enable os-prober in grub

Grub config file is located at /etc/default/grub. If you open it via Nano or some editor, you’ll see at the end of this file that os-prober is disabled by default sighting security reasons.

Grub config file showing that OS prober is disabled

If you are familiar with any terminal-based text editor, use it to uncomment the line # GRUB_DISABLE_OS_PROBER=false by removing the # at the beginning of the line.

However, if you are absolutely new to the command line, you can use this command in the terminal:

echo "GRUB_DISABLE_OS_PROBER=false" | sudo tee -a /etc/default/grub

It will ask for your password. It should be the same account password you use to log in to the system.

🚧

When you type the password in Linux terminal, nothing is reflected on the screen. It feels as if your system is hanged, as there is no visible feedback. Don’t worry. It’s a security feature and most Linux terminals won’t even show asterisks (*) as you enter the password. Just type it in and enter.

With os-prober enabled, Grub will look for the presence of other operating systems in EFI folder and will add them in the bootloader menu.

There is one little problem. The config changes won’t take place unless you update grub.

Step 2: Update grub

On Ubuntu and some other distributions, there is a dedicated command to update grub:

sudo update-grub

However, on Arch and some other distributions, you’ll end up with update-grub command not found error.

That’s because update-grub is not a standard command. It is just la stub for this command:

sudo grub-mkconfig -o /boot/grub/grub.cfg

Run the above command if your system doesn’t have update-grub.

It should show an output like this:

Run update grub command to see the effect of os prober finding Windows boot manager

And as you can see in the above output, grub is probing for other OS and has found Windows boot manager. This is an indication that when you reboot the system, grub should show Windows in the available option.

Getting Windows back in Grub bootloader

And Windows is back in Grub

Still no Windows boot manager?

See, this method only works when dual boot succeeded properly and you have all EFI settings located in the same folder under the same ESP partition.

If that’s not the case, you could try accessing the UEFI settings, go to boot order. Windows boot manager should be present there and if you move it up the order, you can boot from it into Windows.

This is not the most convenient option, I understand but it’s a workaround until you figure out why Grub bootloader could not see Windows.

💡 Bonus tip: The time synchronization issue

Since we are discussing dual booting Windows and Linux, let me share another potential issue you’ll encounter. You’ll notice that system time changes when you switch between Windows and Linux. You can fix it, if you want.

[Solved] Wrong Time in Windows 10 After Dual Boot With Linux

If you dual boot Windows and Linux, you’ll notice that often one of them shows incorrect time. Here’s why that happens and what you can do to fix it.

It’s FOSSAbhishek Prakash

💬 I hope this little trick helps you get a better dual booting experience. Let me know in the comments if you were able to get Windows back in Grub.

About the author

Abhishek Prakash

Created It’s FOSS 11 years ago to share my Linux adventures. Have a Master’s degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries 🕵️‍♂️

#1 2022-02-13 18:00:28

mohammadreza99a
Member
Registered: 2022-02-13
Posts: 10

Grub does not detect Windows UEFI but efibootmgr finds it

This problem is getting kind of repetitive but I couldn’t actually find a solution to my specific problem. I have installed Arch along side Windows and I have made a FAT32 partition which host Grub and Windows boot loader. The problem is that when I run efibootmgr, the Windows shows up but when I run os-prober, there is nothing and hence my grub can’t detect Windows boot loader. I can boot into Windows only if I put my BIOS priority to Windows. I have checked and I have Windows installed with UEFI. Does anybody know what could be the cause of this problem?

Here are some outputs.

For efibootmgr I get:

BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 2001,0001,0003,2002,2003
Boot0001* Arch_Linux	HD(1,GPT,576e6cae-b67b-584b-886d-aa127636a7cc,0x800,0x82000)/File(\EFI\Arch_Linux\grubx64.efi)
Boot0003* Windows Boot Manager	HD(1,GPT,576e6cae-b67b-584b-886d-aa127636a7cc,0x800,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)RC
Boot2001* EFI USB Device	RC
Boot2002* EFI DVD/CDROM	RC
Boot2003* EFI Network	RC 

For lsblk I get:

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
nvme0n1     259:0    0 953.9G  0 disk 
├─nvme0n1p1 259:1    0   260M  0 part /boot/efi
├─nvme0n1p2 259:2    0 300.6G  0 part /run/media/mohammadreza/Windows
├─nvme0n1p3 259:3    0   251G  0 part /run/media/mohammadreza/Partition1
├─nvme0n1p4 259:4    0   151G  0 part /run/media/mohammadreza/Partition2
├─nvme0n1p5 259:5    0   150G  0 part /
├─nvme0n1p6 259:6    0    93G  0 part /home
└─nvme0n1p7 259:7    0     8G  0 part [SWAP]

#3 2022-02-13 22:50:23

mohammadreza99a
Member
Registered: 2022-02-13
Posts: 10

Re: Grub does not detect Windows UEFI but efibootmgr finds it

os-prober was enabled by default in /etc/default/grub. I have tried to add manually the Windows boot loader to grub but it does not work. Could it be related to some kind of mount issues?

#4 2022-02-15 06:37:14

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,842
Website

Re: Grub does not detect Windows UEFI but efibootmgr finds it

How exactly did you attempt to manually add the Windows menuentry? Please post the configuration file that was added or edited and also the full content of /boot/grub/grub.cfg,

Please also share the output of

#5 2022-02-17 11:35:31

mohammadreza99a
Member
Registered: 2022-02-13
Posts: 10

Re: Grub does not detect Windows UEFI but efibootmgr finds it

Here is the output of

/dev/nvme0n1p7: UUID="522fb482-ee75-40c8-9819-d0078a04c71f" TYPE="swap" PARTUUID="443d2b6c-d02d-564b-ac4c-38062f147832"
/dev/nvme0n1p5: UUID="fc20a978-2012-456d-8a38-debbddc18320" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="260fd788-e554-554d-9659-cec33efe8f16"
/dev/nvme0n1p3: LABEL="Partition1" BLOCK_SIZE="512" UUID="A4EC3CE6EC3CB500" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="87f2f298-8c1e-41b8-9d28-3d65efa000cb"
/dev/nvme0n1p1: LABEL_FATBOOT="NO_LABEL" LABEL="NO_LABEL" UUID="E23D-EDCC" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="576e6cae-b67b-584b-886d-aa127636a7cc"
/dev/nvme0n1p6: UUID="0e15e6f2-5842-4f47-a24e-b04c51f1f07e" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="8e420e0c-19e6-6048-a0f8-0d79e82fa411"
/dev/nvme0n1p4: LABEL="Partition2" BLOCK_SIZE="512" UUID="A0507F78507F53CE" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="756fa30e-9fa5-42c1-88f5-4843d5e30960"
/dev/nvme0n1p2: LABEL="Windows" BLOCK_SIZE="512" UUID="9E9044E49044C50D" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="6e3de74a-3ed0-4bcb-a711-acf4adb4f13b"

To add the entry menu for windows, I put blew code into

:

 
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
if [ "${grub_platform}" == "efi" ]; then
	menuentry "Microsoft Windows Vista/7/8/8.1 UEFI/GPT" {
		insmod part_gpt
		insmod fat
		insmod chain
		search --no-floppy --fs-uuid --set=root $hints_string $fs_uuid
		chainloader /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
	}
fi

and after this i ran the command

and here is the content of my

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root fc20a978-2012-456d-8a38-debbddc18320
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
insmod part_gpt
insmod ext2
search --no-floppy --fs-uuid --set=root fc20a978-2012-456d-8a38-debbddc18320
insmod gfxmenu
loadfont ($root)/usr/share/grub/themes/Vimix/dejavu_32.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/dejavu_sans_12.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/dejavu_sans_14.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/dejavu_sans_16.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/dejavu_sans_24.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/dejavu_sans_48.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/terminus-12.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/terminus-14.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/terminus-16.pf2
loadfont ($root)/usr/share/grub/themes/Vimix/terminus-18.pf2
insmod jpeg
insmod png
set theme=($root)/usr/share/grub/themes/Vimix/theme.txt
export theme
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-fc20a978-2012-456d-8a38-debbddc18320' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod ext2
	search --no-floppy --fs-uuid --set=root fc20a978-2012-456d-8a38-debbddc18320
	echo	'Loading Linux linux ...'
	linux	/boot/vmlinuz-linux root=UUID=fc20a978-2012-456d-8a38-debbddc18320 rw  quiet resume=UUID=522fb482-ee75-40c8-9819-d0078a04c71f loglevel=3 audit=0
	echo	'Loading initial ramdisk ...'
	initrd	/boot/intel-ucode.img /boot/amd-ucode.img /boot/initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-fc20a978-2012-456d-8a38-debbddc18320' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-fc20a978-2012-456d-8a38-debbddc18320' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		search --no-floppy --fs-uuid --set=root fc20a978-2012-456d-8a38-debbddc18320
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=fc20a978-2012-456d-8a38-debbddc18320 rw  quiet resume=UUID=522fb482-ee75-40c8-9819-d0078a04c71f loglevel=3 audit=0
		echo	'Loading initial ramdisk ...'
		initrd	/boot/intel-ucode.img /boot/amd-ucode.img /boot/initramfs-linux.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-fc20a978-2012-456d-8a38-debbddc18320' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod ext2
		search --no-floppy --fs-uuid --set=root fc20a978-2012-456d-8a38-debbddc18320
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=fc20a978-2012-456d-8a38-debbddc18320 rw  quiet resume=UUID=522fb482-ee75-40c8-9819-d0078a04c71f loglevel=3 audit=0
		echo	'Loading initial ramdisk ...'
		initrd	/boot/intel-ucode.img /boot/amd-ucode.img /boot/initramfs-linux-fallback.img
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
	fwsetup
}
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###

#6 2022-02-17 11:45:14

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,360

Re: Grub does not detect Windows UEFI but efibootmgr finds it

You need to actually write out the entry to standard out e.g.

echo 'menuentry "Microsoft Windows Vista/7/8/8.1 UEFI/GPT" {
		insmod part_gpt
		insmod fat
		insmod chain
		search --no-floppy --fs-uuid --set=root $hints_string $fs_uuid
		chainloader /EFI/Microsoft/Boot/bootmgfw.efi
	}'

Note that i dropped the /boot/efi from the chainloader line because you need to write paths relative to the ESP root.

Also grub-mkconfig without the -o argument will write to stdout, make sure you properly write the correct config file as well.

#7 2022-02-17 14:54:52

mohammadreza99a
Member
Registered: 2022-02-13
Posts: 10

Re: Grub does not detect Windows UEFI but efibootmgr finds it

I did this and the problem is that when I click on the Windows entry in grub menu, it says that this path does not exist. Why this is happening? Because I can enter to Windows if I just change boot orders in my BIOS. Is this happening because the Windows boot loader is not correctly put into the correct path ?

Here is the content of my /boot/ folder:

drwx------    - root  1 Jan  1970  efi
drwxr-xr-x    - root 17 Feb 15:51  grub
.rw-r--r--  51k root 10 Feb 14:22  amd-ucode.img
.rw-------  24M root 16 Feb 22:07  initramfs-linux-fallback.img
.rw------- 6.8M root 16 Feb 22:06  initramfs-linux.img
.rw-r--r-- 4.7M root  8 Feb 22:07  intel-ucode.img
.rw-r--r--  10M root 16 Feb 22:05  vmlinuz-linux

Last edited by mohammadreza99a (2022-02-17 14:59:10)

#8 2022-02-17 15:14:22

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,842
Website

Re: Grub does not detect Windows UEFI but efibootmgr finds it

V1del wrote:

You need to actually write out the entry to standard out.

No, the stanza can be added directly, as stated on the linked ArchWiki page.

mohammadreza99a wrote:

when I click on the Windows entry in grub menu, it says that this path does not exist.

Please share the updated /boot/grub/grub.cfg that contains the Windows entry.

Did you replace $hints_string & $fs_uuid with the actual, correct string & UUID? The ArchWiki page shows how to do that.

mohammadreza99a wrote:

Is this happening because the Windows boot loader is not correctly put into the correct path ?

Check under /boot/efi and see if /EFI/Mircosoft/Boot/bootmgfw.efi is present. It should be there, the Arch & Windows NVRAM entries are both using the same PARTUUID (/dev/nvme0n1p1).

#9 2022-02-17 17:15:11

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,360

Re: Grub does not detect Windows UEFI but efibootmgr finds it

@HoaS if you directly edit /boot/grub.cfg sure, if you intend /etc/grub.d/40_custom to be picked up by grub-mkconfig you’ll definitely need to echo out the intended text somewhere.  But still yes, the correct replacement variables have to be replaced anyway.

#10 2022-02-17 17:23:00

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,842
Website

Re: Grub does not detect Windows UEFI but efibootmgr finds it

V1del wrote:

if you intend /etc/grub.d/40_custom to be picked up by grub-mkconfig you’ll definitely need to echo out the intended text somewhere

Nope:

archie:~$ cat /etc/grub.d/40_custom                      
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "Microsoft Windows Vista/7/8/8.1 UEFI/GPT" {
		insmod part_gpt
		insmod fat
		insmod chain
		search --no-floppy --fs-uuid --set=root $hints_string $fs_uuid
		chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
archie:~$ doas grub-mkconfig 2>/dev/null | grep -A6 Vista
menuentry "Microsoft Windows Vista/7/8/8.1 UEFI/GPT" {
		insmod part_gpt
		insmod fat
		insmod chain
		search --no-floppy --fs-uuid --set=root $hints_string $fs_uuid
		chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
archie:~$

Even 40_custom disagrees with you

#11 2022-02-17 18:42:38

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,360

Re: Grub does not detect Windows UEFI but efibootmgr finds it

I stand corrected

#12 2022-02-17 19:54:06

mohammadreza99a
Member
Registered: 2022-02-13
Posts: 10

Re: Grub does not detect Windows UEFI but efibootmgr finds it

Head_on_a_Stick wrote:

Did you replace $hints_string & $fs_uuid with the actual, correct string & UUID? The ArchWiki page shows how to do that.

While running grub-probe —target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi in order to get$hints_string, I get this error:

grub-probe: warning: unknown device type nvme0n1.

For $fs_uuid I get a response.

I mean this is just a warning but it is weird that there is not any output.

#13 2022-02-17 20:02:39

mohammadreza99a
Member
Registered: 2022-02-13
Posts: 10

Re: Grub does not detect Windows UEFI but efibootmgr finds it

mohammadreza99a wrote:

Head_on_a_Stick wrote:

Did you replace $hints_string & $fs_uuid with the actual, correct string & UUID? The ArchWiki page shows how to do that.

While running grub-probe —target=hints_string /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi in order to get$hints_string, I get this error:

grub-probe: warning: unknown device type nvme0n1.

So I have a fix for this issus. What i did was to copy the output in the wiki and I changed hd0 to nvme0n1 and I can finally successfully load into Windows from Grub. But the main issus always remains. The fact that os-prober is not able to find Windows loader.

Here is my /etc/grub.d/40_custom for those that might have the same issus:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
if [ "${grub_platform}" == "efi" ]; then
	menuentry "Microsoft Windows Vista/7/8/8.1 UEFI/GPT" {
		insmod part_gpt
		insmod fat
		insmod chain
		search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=nvme0n1,gpt1 --hint-baremetal=ahci0,gpt1 E23D-EDCC
		chainloader /EFI/Microsoft/Boot/bootmgfw.efi
	}
fi

Thank you both for helping me.

Last edited by mohammadreza99a (2022-02-17 20:02:58)

#14 2022-02-17 20:29:41

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,842
Website

Re: Grub does not detect Windows UEFI but efibootmgr finds it

The —hint options are only needed if you have multiple partitions with the same filesystem UUID.

All I have ever needed is

menuentry 'Windows' {
   search.fs_uuid $uuid
   chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

search.fs_uuid is an alias for search —fs-uuid and the root variable is the presumed default.

#
1 год, 8 месяцев назад

Темы:

4

Сообщения:

9

Участник с: 07 августа 2023

Всем ку!!! помогите, пожалуйста, поставил дуалбут, а граб Винду не видит…

перепробовал эти гайды:

https://lumpics.ru/grub-does-not-see-windows-10/

https://askubuntu.com/questions/216215/invalid-efi-file-path

и вроде в меню винда появляется, но либо не грузит, либо пишет «Invalid EFI file path»

помогите, прошу…

vasek

#
1 год, 8 месяцев назад

(отредактировано

1 год, 8 месяцев назад)

Темы:

47

Сообщения:

11922

Участник с: 17 февраля 2013

Информации мало, гадать никто не будет …
Для начала посмотри этот топик — возможно причина и в os-prober

Ошибки не исчезают с опытом — они просто умнеют

arruka

#
1 год, 8 месяцев назад

Темы:

4

Сообщения:

9

Участник с: 07 августа 2023

решение через os-prober тоже пробовал, но ничего не получилось т_т
весь интернет перерыл — ничего не помогает _(

однако!!!
если же проблема в грабе, то может снести граб и поставить systemd-boot?

zotkindm

#
1 год, 8 месяцев назад

Темы:

73

Сообщения:

590

Участник с: 21 мая 2014

arruka
если же проблема в грабе, то может снести граб и поставить systemd-boot?

У всех работает у одного тебя нет. EFI раздел монтировал?

Natrio

#
1 год, 8 месяцев назад

Темы:

48

Сообщения:

4771

Участник с: 08 января 2011

Для начала надо неплохо было бы выяснить, что за Windows, и загружается ли она из BIOS/UEFI (и жива ли вообще).
Видно ли там в вариантах загрузки «Windows boot manager»? Видно ли grub, arch или что-то в этом духе? В каком режиме (BIOS/UEFI) запускается GRUB?
Чтобы запустить загрузчик Windows из GRUB, они должны быть одинакового типа (BIOS-BIOS или UEFI-UEFI).

kononow

#
1 год, 8 месяцев назад

Темы:

0

Сообщения:

2

Участник с: 23 января 2022

arruka
решение через os-prober тоже пробовал, но ничего не получилось т_т
весь интернет перерыл — ничего не помогает _(

До того как в вики появилось я с этим столкнулся:
«os-prober might not work properly when run in a chroot. Try again after rebooting into the system if you experience this.»
Если всё правильно смонтировано(и т.д.), то должно работать.

acid_raccoon

#
1 год, 8 месяцев назад

Темы:

10

Сообщения:

111

Участник с: 08 мая 2020

Всем привет. Извините что немного не по теме. У кого dualboot win10 и arch в uefi режиме.
Поделитесь примером menuentry для win10 из grub.cfg которая создана командой
# grub-mkconfig -o /boot/grub/grub.cfg. Спасибо.

«Load universe into cannon. Aim at brain. Fire.» ©

RusWolf

#
1 год, 8 месяцев назад

Темы:

11

Сообщения:

2868

Участник с: 16 июля 2016

acid_raccoon
которая создана командой
# grub-mkconfig -o /boot/grub/grub.cfg.


### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Pro 11' --class windows --class os $menuentry_id_option 'osprober-efi-EC96-E1AD' {
	insmod part_gpt
	insmod fat
	set root='hd0,gpt2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  EC96-E1AD
	else
	  search --no-floppy --fs-uuid --set=root EC96-E1AD
	fi
	chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/30_os-prober ###

https://t.me/arch_linuxru

acid_raccoon

#
1 год, 8 месяцев назад

(отредактировано

1 год, 8 месяцев назад)

Темы:

10

Сообщения:

111

Участник с: 08 мая 2020

RusWolf
chainloader /EFI/Microsoft/Boot/bootmgfw.efi

Судя по этой строчке у тебя общий esp раздел для win и linux, и оба загрузчика находятся на нём.

А как chainloader должен выглядеть если win на отдельном диске, со своим esp и bootmgfw.efi не нём.
А arch тоже на отдельном диске со своим esp и grub соответственно на нём.

Если записываю так:

menuentry 'Windows10 PRO {
 insmod part_gpt
 insmod fat
 set root='hd0,gpt3'
 chainloader +1
}

получаю:

error: invalid EFI file path.
Press any key to continue...

[raccoon@acid ~ ]$ lsblk -lf
NAME      FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
nvme1n1
nvme1n1p1 vfat   FAT32       123D-8B24
nvme1n1p2
nvme1n1p3 ntfs               70E63E3AE63E00C0
nvme1n1p4 ntfs               E460541E6053F630
nvme0n1
nvme0n1p1 vfat   FAT32 esp   9022-2042                              98,2M     0% /boot/efi
nvme0n1p2 btrfs        btrfs 364ae37a-9425-45df-9dc8-6df2b49df020    899G     3% /
nvme0n1p3 swap   1           da6259fd-18f4-47b8-b98f-94491e732eb6                [SWAP]

«Load universe into cannon. Aim at brain. Fire.» ©

RusWolf

#
1 год, 8 месяцев назад

(отредактировано

1 год, 8 месяцев назад)

Темы:

11

Сообщения:

2868

Участник с: 16 июля 2016

acid_raccoon
Судя по этой строчке у тебя общий esp раздел для win и linux, и оба загрузчика находятся на нём.

Нет. На разных дисках.

acid_raccoon
А как chainloader должен выглядеть если win на отдельном диске, со своим esp и bootmgfw.efi не нём.

Так же:
chainloader /EFI/Microsoft/Boot/bootmgfw.efi

acid_raccoon
set root=’hd0,gpt3′

У тебя ESP раздел, совсем не на третьем разделе, из вывода твоего lsblk -lf.

https://t.me/arch_linuxru

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

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Вернуть компьютер в исходное состояние windows 10 останется ли виндовс
  • Скорость сети в трее windows 11
  • Брандмауэр windows заблокировал некоторые возможности этой программы что делать
  • Showkeyplus windows 10 pro
  • Какие программы по умолчанию windows 10