Добавить Windows 10 в список GRUB OS
Я недавно получил компьютер из школы. Он пришел с установленной Windows 8.1. Затем я установил еще одну копию Windows 8.1 (чтобы она использовала встроенную лицензию Windows Pro) и обновил ее до Windows 10. Затем я установил Ubuntu вместе с Windows 8 и 10.
Обратите внимание, что я сделал отдельный раздел ext2 размером 255 МБ для /boot.
Теперь, когда я загружаю компьютер, я сначала вижу приглашение GRUB (я уже разархивировал приглашение grub, потому что оно мне так нравится) с параметрами Windows 8 и Ubuntu. Тем не менее, нет варианта Windows 10. Если я выберу Ubuntu, компьютер загрузится в Ubuntu. Однако, если я выберу опцию Windows 8, меня затем отправят в загрузчик Windows, где он затем дает мне возможность загрузить либо Windows 8, либо Windows 10. (Однако к этому моменту компьютер уже загрузил ядро и все Очевидно, Microsoft неправильно поняла концепцию загрузчика и решила, что это означает «загрузить практически всю систему перед тем, как на самом деле показать загрузчик». Типичный Microsoft.)
Как отключить загрузчик Windows и добавить опцию Windows 10 в GRUB? РЕДАКТИРОВАТЬ: Кто-то ответил, сказав мне, чтобы отключить загрузчик Windows. Однако я до сих пор не знаю, как добавить Windows в список ОС GRUB. Может кто-нибудь помочь с этим?
РЕДАКТИРОВАТЬ 2: После удаления Windows 10 из загрузчика Windows с EasyBCD, казалось, что после нескольких перезагрузок он будет постоянно показывать себя, и Windows 10 появится снова. Однако позже я удалил Windows 10 из списка операционных систем в msconfig, и он, похоже, остался удаленным.
Тем не менее, я все еще не смог заставить Windows 10 появиться в GRUB. Как будто GRUB просто не обнаруживает это.
Кроме того, я поставлю это в вопросе, чтобы люди видели это — я попытался использовать boot-repair Однако, это не помогло никому.
6 ответов
Команды в терминале Ubuntu, возможно, это решит вашу проблему.
По этой команде система автоматически обнаружит установку окон и добавит их в список grub.
Иногда os-prober не прав.
Посмотрите на UUID вашего раздела Windows 10, например:
Затем отредактируйте /etc/grub.d/40_custom и в конце файла добавьте:
Не забудьте изменить UUID.
И, наконец, обновите ваш конфигурационный файл grub:
Используйте это приложение EasyBCD для Windows http://neosmart.net/EasyBCD/ скачать бесплатную версию и установить ее.
Когда вы откроете его, вы увидите запись для Windows 8 и один для Windows 10.
удалите запись Windows 8, и вы будете в порядке.
Обновите после выполнения вышеуказанных шагов, вернитесь в Ubuntu,
открыть терминал, нажав Ctrl + Alt + T
затем скопируйте эти команды одну за другой,
и тем самым вы установите инструмент под названием boot-repair.
откройте восстановление загрузчика из тире, и вы получите это окно
выберите рекомендуемый ремонт и следуйте инструкциям.
Обратите внимание, что вы должны быть подключены к Интернету при использовании boot-repair.
Это решение обеспечивает правильный вход в меню grub2 и загружает цепочки непосредственно в Windows 10 без ссылки на BIOS. Это происходит от https://ihaveabackup.net/article/grub2-entry-for-windows-10-uefi поэтому я не претендую на кредит. Было таким облегчением найти рабочее решение
Вкратце, отредактируйте /etc/grub.d/40_custom и добавьте:
Чтобы найти UUID для корневой строки —set= (в примере CC66-4B02), вы используете sudo fdisk -l для идентификации раздела EFI, затем sudo blkid /dev/sda1 (или любой другой) для поиска UUID раздела EFI, Обратите внимание, что вам нужен не раздел Windows, а EFI. После сохранения изменений запустите sudo update-grub, чтобы сгенерировать файл /boot/grub/menu.cfg, а затем перезапустите для проверки.
Насколько я понял ваш вопрос, у вас есть две разные установки Windows на одном или нескольких жестких дисках, и вы не хотите, чтобы загрузчик Windows мешал или управлял обеими установками Windows. Я помню, что на старых установках было возможно напрямую загрузить ядро Windows из Grub (я могу ошибаться здесь), но я не смог сделать это на установках UEFI. Наличие двух независимых конфигураций загрузчика Windows, которые можно вызывать из Grub независимо, должно быть очень близко к тому, что вы ищете.
Он пришел с установленной Windows 8.1.
Я собираюсь предположить, что это компьютер с поддержкой UEFI.
- Проверьте, действительно ли компьютер поддерживает UEFI (я удалю свой ответ, если это не так) и ознакомьтесь с различиями между BIOS и UEFI ( разные режимы загрузки, efibootmgr, разные таблицы разделов, системный раздел EFI (ESP), загрузчики EFI. ).
- Затем убедитесь, что все операционные системы установлены в режиме UEFI, и убедитесь, что у вас есть таблица разделов GPT. Вы можете использовать Windows dism чтобы выполнить резервное копирование и восстановление разделов в новом макете таблицы разделов и использовать командную строку с последнего установочного носителя Windows для переустановки загрузчика, подробнее об этом см. в следующем пункте.
- Поскольку вам было рекомендовано попробовать различные другие инструменты, которые не решают вашу проблему, вы должны вернуть эти изменения в первоначальное состояние, иначе это будет становиться все более и более запутанным. Извини за это.:(
- Вы можете использовать мой ответ из раздела Как загрузить Windows 8 с устаревшего раздела MBR в режиме UEFI через GRUB?
- Этот ответ устанавливает независимую конфигурацию загрузчика Windows через bcdboot в другом месте, где Grub будет называть это. Для удобства я выбрал корневой раздел Windows. Это необходимо сделать для каждой установки Windows, чтобы каждая установка Windows имела свою собственную и загружалась только сама (очистите отдельные меню загрузки Windows от других записей).
- Помните, что вам нужно создать отдельную запись для каждой установки Windows, в которой вы хотите загрузиться /etc/grub.d/40_custom и следуйте инструкциям и объяснениям относительно UUID, разделов и таблиц разделов.
- Вероятно, отключите все полу-умные функции, которые обнаруживают различные ОС, такие как OS-Prober в Grub ( GRUB_DISABLE_OS_PROBER ) или устранение неполадок при загрузке с Windows или загрузку-восстановление (или ручную очистку после них).
NB: Ваш запрос состоял в том, чтобы иметь возможность управлять всеми операционными системами с помощью Grub, однако в UEFI традиционный термин «двойная загрузка» становится почти неправильным. UEFI позволяет сосуществовать нескольким загрузчикам на ESP, и вы можете выбрать, какой из них загружать (если они были зарегистрированы в прошивке UEFI, а прошивка производителей не идет на попечение, как только загрузка Windows). Печально то, что очень немногие могут подумать об установке более чем одной (независимой) версии Windows, Linux или одного выпуска Ubuntu на один компьютер (или жесткий диск, который используется на нескольких компьютерах и загружает другую установку одна и та же версия ОС на каждом компьютере). Большая часть этого уже возможна, но механизмы в Windows и Ubuntu (Fedora,…) явно предпочитают перезаписывать то, что находится в их пространстве имен, при ложном предположении, что их может быть только один.
(Я загружаю Windows8/10, Ubuntu, Ubuntu LTS и Fedora на одном компьютере и несколько раз возился с загрузкой UEFI в соответствии с различными требованиями.)
How do I manually add windows 7 to grub list?
I am desperate to add Windows 7 to grub. I have tried sudo update-grub, I have run sudo os-prober, but I can’t seem to get windows to be added to grub.
Can someone please explain how to manually add windows 7 to my grub?
4 Answers 4
sudo nano /etc/grub.d/40_custom
by appropriately modifying the location of windows 7 in your computer.
Note If you are not careful these operations can mess up your computer.
grub-customizer helped me. It auto-detected Windows 7 for me and I was able to add it and change position and title in the menu.
Before you attempt anything further, I suggest you go to a terminal by pressing Ctrl + Alt + T and enter the following:
This should scan your system for all existing OS’s and add them to the Grub menu (See Note¹)
Next download and run boot-repair
The program should launch automatically or you can open it from the Apps list.
If none of the above works, see Note² to manually add a Windows entry to the GRUB menu.
If you have multiple Windows systems installed on the same hard drive, you will likely only see one Windows system in the resulting GRUB menu when it boots up. This is because that option is referring to the Windows boot loader which resides on the boot sector of the hard drive and/or at the beginning of each Windows partition. When that option is invoked it will run the Windows boot manager which will allow you to select your other Windows environments.
You should understand there’s a difference between a boot manager and a boot loader. For the most part both GRUB and the Windows Boot Manager (BOOTMGR) perform both duties. However Windows Boot Manager cannot load a Linux environment and vice versa, GRUB can’t actually load a Windows environment.
Hence if you’re using GRUB as your primary boot manager and you select a Windows environment at boot-up, it will load BOOTMGR as the boot loader for any Windows system you have installed and will be taken to a BOOTMGR screen which allows you to select either Windows 10 or Windows 7 from the list.
Similarly if you instead are using BOOTMGR as the primary (using bcdedit ), when you select the Linux distribution from the menu it will not boot directly into the system: it will just run GRUB (which should then reside at the beginning of the root partition instead of the boot sector of the HD) and allow you to select the desired system from there.
If none of the above works you can manually add windows entry. This solution provides a proper entry in the grub2 menu to boot into Windows 10.
A requisite word of caution, editing the GRUB menu is not recommended because it can break your system. But if you need to do it, here’s how.
First check on which disk and partition is the Windows EFI boot:
Now find the UUID of the partition. E.g:
Then you can edit the /etc/grub.d/40_custom grub file to add the lines which will help you to boot into your Windows system
Add the following modified according to your configuration:
note that entry is configured to boot from the 2nd partition gpt2 of the 1st hard drive hd0 or ahci0. If you are working on legacy, then replace all gpt with msdos
Add Windows 10 to Grub2 bootloader
I’ve gone through the usual steps for adding Windows to the bootloader options by modifying 40_custom and adding the following:
However, when I select Windows in the bootloader, it says «Error: invalid signature. Press any key to continue». I don’t know why I’m getting this error. How can I fix it? EDIT: It says there are syntax errors here but I can’t see any. if [ «$
search —fs-uuid —set=root —hint-bios=hd0,msdos1 —hint-efi=hd0,msdos1 —hint-baremetal=ahci0,msdos1 XXXXXXXXXXXXXXXX ntldr /bootmgr > fi
EDIT2: Output of sudo fdisk -l
3 Answers 3
It looks like you’ve followed an old guide that expects Windows to use MBR partitioning.
The «invalid signature» error suggests Secure Boot is enabled. When Secure Boot is enabled, all bootloaders must be signed with a private key, and a matching public key must be included in the Secure Boot variables in the firmware NVRAM. GRUB is dutifully reading the first sector of the partition you’ve specified, but since it does not contain the appropriate Secure Boot signature, the firmware refuses to execute it.
Secure Boot requires native UEFI-style boot as a prerequisite. You may be able to disable Secure Boot on your system, but since GRUB already starts for you, there is probably no need to do that.
Your insmod part_gpt suggest you expect the disk to have a GPT-style partitioning which usually goes together with UEFI boot style, but on the other hand, set root=(hd0,msdos2) expects a MBR partition.
On my Debian system with GPT partitioning, the set root line reads: set root=’hd0,gpt1′ . If your system uses GPT partitioning, use the gptN partition identifiers instead of msdosN .
Add Windows 10 to GRUB OS list
I recently got a computer from school. It came with Windows 8.1 installed. I then installed another copy of Windows 8.1 (so it would use the built-in Windows Pro license) and upgraded it to Windows 10. I then installed Ubuntu alongside both Windows 8 and 10.
Note that I made a separate 255MB ext2 partition for /boot.
Now, when I boot the computer, I first see a GRUB prompt (I already un-hid the grub prompt ‘cuz I like it that way) with Windows 8 and Ubuntu options. However, there is no Windows 10 option. If I select Ubuntu, the computer boots into Ubuntu. However, if I select the Windows 8 option, I then get sent to the Windows bootloader, where it then gives me options to boot either Windows 8 or Windows 10. (However, by this point, the computer has already loaded the kernel and all. Apparently Microsoft misunderstood the concept of a bootloader and decided that that meant «boot practically the entire system before actually showing the bootloader». Typical Microsoft.)
How can I disable the Windows bootloader and add a Windows 10 option to GRUB?
EDIT: Someone has answered telling me to disable the Windows bootloader. However, I still do not know how to add Windows to the GRUB OS list. Can anyone help with this?
EDIT 2: After removing Windows 10 from the Windows bootloader with EasyBCD, it seemed that, after a few reboots, it would continually unhide itself and Windows 10 would reappear. However, I then later deleted Windows 10 from the list of OSes in msconfig, and it seems to have stayed deleted.
However, I STILL have not managed to get Windows 10 to appear in GRUB. It’s as if GRUB simply doesn’t detect it.
Also, I’ll put this in the question so that people see it — I have tried using boot-repair , however, it has NOT helped any.
9 Answers 9
Sometimes os-prober is wrong.
Look at the UUID of your Windows 10 partition, for exemple:
Then edit /etc/grub.d/40_custom , and at the end of the file add:
Don’t forget to change the UUID.
And finally update your grub config file:
commands in terminal of Ubuntu, probably it will solve your problem.
By this command the system will automatically detect your Windows installations and add them to the GRUB list.
This solution provides a proper entry in the grub2 menu and chainloads directly into Windows 10 without reference to the BIOS. It comes from this webpage so I claim no credit. It was such a relief to find a working solution.
Briefly, edit /etc/grub.d/40_custom and add:
To find the UUID for the —set=root line (CC66-4B02 in the example) you use sudo fdisk -l to identify the EFI partition then sudo blkid /dev/sda1 (or whatever) to find the UUID of the EFI partition. Note it’s not the Windows partition but the EFI one you need. Once you’ve saved the edit, run sudo update-grub to generate the /boot/grub/menu.cfg file and then restart to test.
use this app EasyBCD for windows http://neosmart.net/EasyBCD/ download the free version and install it.
when you open it you will see an entry for windows 8 and one for windows 10.
delete the windows 8 entry and you’ll be good to go.
Update after doing the steps above go back to Ubuntu,
open the terminal by pressing ctrl + alt + T
then copy past this commands to it one after another,
and by this you will install a tool called boot-repair.
open boot repair from dash and you’ll get this window
choose the recommended repair and follow the steps.
Note you have to be connected to the Internet when using boot-repair.
As far as I understood your question you have two different Windows installations on one or more harddrives and you don’t want the Windows loader to get in the way or managing both Windows installations. I remember that it was possible on legacy setups to directly boot the Windows kernel from Grub (I may be wrong here) but I haven’t been able to do this on UEFI setups. Having two independent Windows bootloader configurations that can be called from Grub independently should be very close to what you are looking for.
It came with Windows 8.1 installed.
I’m going to assume that this is a UEFI capable computer.
- Please check that the computer actually is UEFI capable (I will remove my answer if it is not) and familiarize yourself with the differences between BIOS and UEFI (different boot modes, efibootmgr, different partition tables, EFI system partition (ESP), EFI loaders…).
- Then check that all OSes are installed in UEFI mode and check that you have a GPT partition table. You can use Windows’ dism to backup and restore partitions to a new partition table layout and use the command prompt from latest Windows installation media to reinstall the bootloader, more details on this in the next point.
- Since you have been recommended to try various other tools that don’t address your issue you have to revert these changes to a pristine condition, otherwise this will get more and more confusing. Sorry about that. 🙁
- You can use my answer from How to boot Windows 8 from a legacy MBR partition in UEFI mode via GRUB?
- This answer does install an independent Windows boot loader configuration through bcdboot in a different location where Grub will call it. For convenience I have chosen the Windows root partition. You will need to do this for every Windows installation, so that every Windows installation has its own and will only boot itself (clean the individual Windows boot menus from other entries).
- Remember that you need to create an individual entry for each Windows installation you want to boot in /etc/grub.d/40_custom and follow the instructions and explanations about UUIDs, partitions and partition tables.
- Probably disable every semi-smart feature that detects different OSes like OS-prober in Grub ( GRUB_DISABLE_OS_PROBER ) or troubleshooting boot issues with Windows or boot-repair (or manually clean up after them).
N.B.: Your request was to be able to manage all OSes with Grub, however with UEFI, the traditional «dualboot» term becomes almost a misnomer. UEFI allows coexistence of several bootloaders on the ESP and you can choose which one to boot (if they have been registered in the UEFI firmware and the manufacturers firmware doesn’t do out of spec patronizing like only booting Windows). The sad thing here is that only very few people can think about installing more than one (independent) version of Windows, Linux or one release of Ubuntu onto one computer (or a harddrive that is used with several computers and boots a different installation of the same OS release on each computer). Most of this is already possible, but mechanisms in Windows and Ubuntu (Fedora,…) plainly choose to overwrite what is in their namespace under the false assumption that there can only be one.
(I do boot Windows8/10, Ubuntu, Ubuntu LTS and Fedora on one computer and have tinkered a few times with UEFI booting under different requirements.)