Grub menu fix for Windows / Ubuntu dual boot
Use this if boot repair does not fix the issue.
adapted from: https://askubuntu.com/questions/197868/grub-does-not-detect-windows
Make sure Windows is installed and the .efi file exists
Get UUID of Windows partition
sudo blkid /dev/<windows partion> #eg: sudo blkid /dev/sda1
Add the following to /etc/grub.d/40_custom
menuentry 'Windows 11' {
search --fs-uuid --no-floppy --set=root <partion UUID>
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
Update grub
Grub (GNU GRand Unified Bootloader) — свободный загрузчик операционных систем, который используется во многих дистрибутивах Linux. Он позволяет выбирать операционную систему для загрузки при старте компьютера и управлять процессом загрузки системы, также поддерживает загрузку различных OS, включая различные версии Linux, Windows, macOS, позволяет настраивать параметры загрузки, создавать различные профили загрузки и выполнять другие задачи, связанные с загрузкой операционных систем.
Grub обычно устанавливается в начало жесткого диска компьютера и запускается при старте системы для предоставления пользователю возможности выбора операционной системы для загрузки. Grub является важной частью многих дистрибутивов Linux и играет ключевую роль в процессе загрузки операционной системы.
GRUB (GNU GRand Unified Bootloader) — мощный и гибкий загрузчик операционных систем, который используется во многих дистрибутивах Linux и других операционных систем, таких как FreeBSD. GRUB предоставляет пользователю возможность выбора операционной системы или ядра, которое нужно загрузить при старте компьютера.
Позволяет загружать различные операционные системы, а также варианты загрузки для конкретной операционной системы, например, в безопасном режиме или с другими параметрами загрузки. Он также поддерживает многоядерные системы и может автоматически обнаруживать установленные операционные системы на жестком диске. Имеет гибкую конфигурацию, которая позволяет пользователям настраивать параметры загрузки, добавлять новые ядра или операционные системы в меню загрузки, а также выполнять другие действия при загрузке системы.
GRUB является одним из наиболее распространенных загрузчиков для систем Linux и используется по умолчанию во многих дистрибутивах Linux, таких как Ubuntu, Fedora, Debian и многих других.
Если Grub не видит Windows 10 при загрузке, возможно, что загрузочная запись Windows была повреждена или удалена. Есть несколько причин, почему так происходит:
- Неправильная конфигурация: если Grub неправильно сконфигурирован или не обновлен после установки Windows 10, он может не видеть новую операционную систему.
- Изменения разделов диска: после установки Windows 10 могли произойти изменения в разделах диска, из-за чего Grub перестал её видеть..
- Проблемы с загрузочным сектором: некорректное обновление загрузочного сектора или MBR (Master Boot Record) могут привести к проблеме.
- Проблемы с UEFI/BIOS: некорректные настройки в UEFI или BIOS компьютера могут привести к тому, что Grub не сможет правильно обнаружить операционную систему.
- Поврежденные файлы загрузки: если файлы загрузки повреждены или отсутствуют, Grub не сможет их обнаружить.
Дальше расскажем, что же делать, если возникла такая проблема.
Сначала можно попытаться сделать наш с Windows раздел более видимым для программы. Для этого примонтируйте его в какую-либо папку. Например, в /mnt/
:
sudo mount -t ntfs-3g -o ro /dev/sda1
Система Windows установлена на разделе, который определяется в Linux, как /dev/sda1
. Дальше запустите утилиту os-prober:
sudo os-prober
Если программа обнаружит Windows, останется обновить конфигурацию загрузчика Grub:
sudo update-grub
Или:
sudo grub2-mkconfig -o /boot/grub/grub.cfg
Если же этот способ не сработает, останется только вручную добавить пункт меню для Windows. Это не самое простое, но зато эффективное решение. Сначала нам нужно узнать UUID раздела диска, на который установлена Windows, например, /dev/sda1
:
blkid /dev/sda1
Затем откройте файл /etc/grub.d/40_custom
и добавьте туда такой код:
menuentry "Windows 10" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set B4A6AEB7A6AE7A0E
chainloader +1
}
Так мы устанавливаем в качестве корня первый раздел первого диска, а затем указываем загрузчику, что нужно найти раздел с нужным нам UUID. Затем передаем управление загрузчику на этом разделе с помощью chainloader. Дальше осталось обновить конфигурацию Grub:
sudo update-grub
Мы использовали такой метод потому что теперь настройка не собьется после обновления ядра или другого процесса, инициализирующего обновление конфигурации. Потому что если бы мы добавили эти строки в /boot/grub/grub.cfg
, то они были бы перезаписаны если не при первом, то при одном из следующих обновлений системы.
Когда конфигурация обновлена вы можете перезагрузить компьютер и загружать Windows с помощью нового пункта. Таким образом, можно добавить несколько пунктов, только для разных разделов нужно указывать их UUID.
Loading
# |
|
Темы: 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 месяцев назад) |
Темы: 47 Сообщения: 11926 Участник с: 17 февраля 2013 |
Информации мало, гадать никто не будет … Для начала посмотри этот топик — возможно причина и в os-prober Ошибки не исчезают с опытом — они просто умнеют |
arruka |
# |
Темы: 4 Сообщения: 9 Участник с: 07 августа 2023 |
решение через os-prober тоже пробовал, но ничего не получилось т_т весь интернет перерыл — ничего не помогает _( однако!!! |
zotkindm |
# |
Темы: 73 Сообщения: 591 Участник с: 21 мая 2014 |
У всех работает у одного тебя нет. EFI раздел монтировал? |
Natrio |
# |
Темы: 48 Сообщения: 4771 Участник с: 08 января 2011 |
Для начала надо неплохо было бы выяснить, что за Windows, и загружается ли она из BIOS/UEFI (и жива ли вообще). Видно ли там в вариантах загрузки «Windows boot manager»? Видно ли grub, arch или что-то в этом духе? В каком режиме (BIOS/UEFI) запускается GRUB? Чтобы запустить загрузчик Windows из GRUB, они должны быть одинакового типа (BIOS-BIOS или UEFI-UEFI). |
kononow |
# |
Темы: 0 Сообщения: 2 Участник с: 23 января 2022 |
До того как в вики появилось я с этим столкнулся: |
acid_raccoon |
# |
Темы: 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 |
# |
Темы: 11 Сообщения: 2869 Участник с: 16 июля 2016 |
https://t.me/arch_linuxru |
acid_raccoon |
# (отредактировано 1 год, 8 месяцев назад) |
Темы: 10 Сообщения: 111 Участник с: 08 мая 2020 |
Судя по этой строчке у тебя общий esp раздел для win и linux, и оба загрузчика находятся на нём. А как chainloader должен выглядеть если win на отдельном диске, со своим esp и bootmgfw.efi не нём. Если записываю так:
получаю:
«Load universe into cannon. Aim at brain. Fire.» © |
RusWolf |
# (отредактировано 1 год, 8 месяцев назад) |
Темы: 11 Сообщения: 2869 Участник с: 16 июля 2016 |
Нет. На разных дисках.
Так же:
У тебя ESP раздел, совсем не на третьем разделе, из вывода твоего lsblk -lf. https://t.me/arch_linuxru |
Grub Doesn’t Detect Windows: A Guide to Fixing the Problem
If you’re dual-booting Windows and Linux, you may have encountered the dreaded “Grub doesn’t detect Windows” error. This can be a frustrating problem, but it’s usually fixable. In this guide, we’ll walk you through the steps to troubleshoot and fix the issue.
We’ll start by explaining what Grub is and how it works. Then, we’ll discuss the common causes of the “Grub doesn’t detect Windows” error. Finally, we’ll provide step-by-step instructions on how to fix the problem.
By the end of this guide, you’ll be able to dual-boot Windows and Linux without any problems.
Problem | Solution | Reference |
---|---|---|
Grub doesn’t detect Windows |
|
|
GRUB is a bootloader that can be used to boot multiple operating systems from a single hard drive. However, there are a number of issues that can cause GRUB to not detect Windows. This guide will discuss the causes of this issue and provide solutions for each one.
Causes of the issue
There are a number of reasons why GRUB might not detect Windows. These include:
- Windows not installed in the MBR
The MBR (master boot record) is a small partition at the beginning of a hard drive that contains the bootloader. If Windows is not installed in the MBR, GRUB will not be able to find it and will not be able to boot it.
- Windows not configured as the default boot option
Even if Windows is installed in the MBR, GRUB might not be configured to boot it by default. This can happen if you have installed another operating system after Windows, or if you have changed the boot order in your BIOS settings.
- Windows bootloader corrupt
The Windows bootloader is a small program that is responsible for loading Windows. If this bootloader is corrupt, GRUB will not be able to find Windows and will not be able to boot it.
- Other issues
There are a number of other issues that can cause GRUB to not detect Windows. These include conflicting bootloaders, incorrect BIOS settings, and hardware problems.
Solutions
The solutions to the issue of GRUB not detecting Windows will vary depending on the cause of the problem. However, the following are some general solutions that may work:
- Reinstall Windows in the MBR
If Windows is not installed in the MBR, you can reinstall it in the MBR using the following steps:
1. Boot from the Windows installation media.
2. Select Custom installation.
3. Select the hard drive where you want to install Windows.
4. Click Next.
5. Select Install now.
6. Follow the on-screen instructions to complete the installation.
- Set Windows as the default boot option
If Windows is not configured as the default boot option, you can set it as the default boot option using the following steps:
1. Open the BIOS settings.
2. Navigate to the Boot section.
3. Select the Windows boot option and move it to the top of the list.
4. Save your changes and exit the BIOS settings.
- Repair the Windows bootloader
If the Windows bootloader is corrupt, you can repair it using the following steps:
1. Boot from the Windows installation media.
2. Select Repair your computer.
3. Select Troubleshoot.
4. Select Advanced options.
5. Select Command Prompt.
6. Type the following command and press Enter:
bootrec /fixmbr
7. Type the following command and press Enter:
bootrec /fixboot
8. Type the following command and press Enter:
bootrec /rebuildbcd
9. Restart your computer.
- Fix other issues
If the above solutions do not work, you may need to fix other issues that are causing GRUB to not detect Windows. These issues could include conflicting bootloaders, incorrect BIOS settings, or hardware problems.
If GRUB is not detecting Windows, you can try the solutions in this guide to fix the problem. If the solutions do not work, you may need to contact technical support for help.
3. Preventing the issue
There are a few things you can do to prevent the issue of Grub not detecting Windows.
- Install Windows in the MBR. The Master Boot Record (MBR) is the first sector of a hard drive, and it contains the bootloader for the operating system that is installed on that drive. When you install Windows, it will automatically install its bootloader in the MBR. However, if you install another operating system (such as Linux) after Windows, it may overwrite the Windows bootloader in the MBR. This can prevent Grub from detecting Windows. To avoid this, you should install Windows first, and then install any other operating systems after that.
- Set Windows as the default boot option. When you install Windows, it will automatically set itself as the default boot option. However, if you change the default boot option to another operating system, Grub may not be able to detect Windows. To avoid this, you should make sure that Windows is set as the default boot option.
- Make sure the Windows bootloader is up-to-date. The Windows bootloader is a file called `bootmgr`. This file can become corrupted or outdated, which can prevent Grub from detecting Windows. To avoid this, you should make sure that the Windows bootloader is up-to-date. You can do this by running the following command in a Command Prompt window:
bcdboot c:\windows /s s:\EFI\Microsoft\Boot
where `c:\windows` is the path to the Windows installation directory, and `s:\EFI\Microsoft\Boot` is the path to the EFI System Partition.
- Avoid conflicting bootloaders. If you have multiple bootloaders installed on your computer, it is possible that they will conflict with each other. This can prevent Grub from detecting Windows. To avoid this, you should only have one bootloader installed on your computer. If you need to have multiple bootloaders installed, you should make sure that they are configured correctly so that they do not conflict with each other.
- Check BIOS settings. The BIOS is a firmware that is responsible for initializing the hardware on your computer. It is possible that the BIOS settings are configured incorrectly, which could prevent Grub from detecting Windows. To check the BIOS settings, you will need to access the BIOS setup utility. The method for accessing the BIOS setup utility varies depending on the motherboard manufacturer. Once you have accessed the BIOS setup utility, you should look for any settings that could affect the bootloader or the boot order. Make sure that these settings are configured correctly.
4. Additional resources
- [Grub documentation](https://www.gnu.org/software/grub/manual/grub.html)
- [Windows documentation](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/bcdedit)
- [Other online resources](https://www.google.com/search?q=grub+doesn%27t+detect+windows)
If you are having trouble with Grub not detecting Windows, you can try the following solutions:
- Install Windows in the MBR.
- Set Windows as the default boot option.
- Make sure the Windows bootloader is up-to-date.
- Avoid conflicting bootloaders.
- Check BIOS settings.
If these solutions do not work, you can try reinstalling Grub or Windows. You can also seek help from a qualified technician.
Q: Grub doesn’t detect Windows
A: There are a few possible reasons why Grub might not be detecting Windows. Here are some common causes and solutions:
- The Windows bootloader is not installed correctly. If the Windows bootloader is not installed correctly, Grub will not be able to find Windows. To fix this, you can try reinstalling the Windows bootloader.
- The Windows partition is not marked as active. The Windows partition must be marked as active in order for Grub to detect it. To check if the Windows partition is active, open Disk Management and look for the partition that is labeled “System Reserved”. If the partition is not marked as active, you can right-click on it and select “Mark Partition as Active”.
- The Windows partition is not formatted correctly. The Windows partition must be formatted as NTFS in order for Grub to detect it. If the partition is formatted as a different file system, you will need to reformat it as NTFS.
- The Windows drive is not connected properly. If the Windows drive is not connected properly, Grub will not be able to detect it. Make sure that the Windows drive is properly connected to your computer and that it is turned on.
- The Windows drive is encrypted. If the Windows drive is encrypted, Grub will not be able to detect it. You will need to decrypt the drive before Grub can see it.
If you have tried all of these solutions and Grub still does not detect Windows, you can try reinstalling Grub. To reinstall Grub, you can follow the instructions in the Grub documentation.
Q: How do I reinstall Grub?
A: To reinstall Grub, you can follow these steps:
1. Boot your computer from a live Linux distribution.
2. Open a terminal window.
3. Type the following command to install the Grub package:
sudo apt-get install grub
4. Type the following command to create a Grub configuration file:
sudo grub-mkconfig -o /boot/grub/grub.cfg
5. Reboot your computer.
Grub should now be able to detect Windows.
Q: What are the benefits of using Grub?
A: There are a few benefits to using Grub:
- It allows you to boot multiple operating systems from the same computer. This can be useful if you want to be able to switch between different operating systems easily.
- It allows you to customize the boot process. You can change the order in which operating systems are booted, and you can also add custom messages or logos to the boot screen.
- It is a reliable and robust bootloader. Grub has been around for many years and has a proven track record of reliability.
If you are looking for a bootloader that allows you to boot multiple operating systems from the same computer, then Grub is a good option. It is easy to use and configure, and it is reliable and robust.
Q: What are the drawbacks of using Grub?
A: There are a few drawbacks to using Grub:
- It can be difficult to configure. Grub has a lot of options, and it can be difficult to figure out how to configure them all.
- It can be slow. Grub can be slower than other bootloaders, especially if you are booting multiple operating systems.
- It is not compatible with all operating systems. Grub does not support all operating systems, so you may not be able to use it with your preferred operating system.
If you are looking for a simple and easy-to-use bootloader, then Grub may not be the best option. However, if you need a bootloader that allows you to boot multiple operating systems from the same computer, then Grub is a good option.
In this blog post, we have discussed the issue of GRUB not detecting Windows. We have provided a detailed overview of the problem, as well as a number of possible solutions. We hope that this information has been helpful, and that you are now able to resolve the issue.
Here are some key takeaways from this blog post:
- GRUB is a bootloader that is used to load the operating system on your computer.
- If GRUB does not detect Windows, it will not be able to load the operating system.
- There are a number of possible causes for this issue, including:
- A corrupt or missing Windows bootloader
- A corrupt or missing GRUB configuration file
- A problem with the boot order in your BIOS
- To resolve this issue, you can try:
- Reinstalling Windows
- Reinstalling GRUB
- Resetting the boot order in your BIOS
- If you are unable to resolve the issue on your own, you can seek help from a qualified technical support professional.
Author Profile
-
Hatch, established in 2011 by Marcus Greenwood, has evolved significantly over the years. Marcus, a seasoned developer, brought a rich background in developing both B2B and consumer software for a diverse range of organizations, including hedge funds and web agencies.
Originally, Hatch was designed to seamlessly merge content management with social networking. We observed that social functionalities were often an afterthought in CMS-driven websites and set out to change that. Hatch was built to be inherently social, ensuring a fully integrated experience for users.
Now, Hatch embarks on a new chapter. While our past was rooted in bridging technical gaps and fostering open-source collaboration, our present and future are focused on unraveling mysteries and answering a myriad of questions. We have expanded our horizons to cover an extensive array of topics and inquiries, delving into the unknown and the unexplored.