Ubuntu не видит windows boot manager

Многие новички и опытные пользователи Linux держат также установленной на своем компьютере операционную систему Windows, например, последней, десятой версии. Новичкам это нужно чтобы иметь запасную операционную систему, к которой они смогут вернуться, если их Linux сломается. А для опытных пользователей важно программное обеспечение, которое не поддерживается ни в Linux, ни даже с помощью эмулятора Wine, а таких программ достаточно много.

Но временами случается такая ситуация, что загрузчик Grub не распознает установленную Windows и не отображает ее в списке систем для загрузки. В этой статье мы рассмотрим почему возникает ошибка grub не видит Windows 10 и как ее решить.

Причин такой ошибки может быть несколько, начиная от того, что система установлена на другом жестком диске, и заканчивая неизвестными глюками пакета os-prober, который и занимается определением операционных систем в Linux. Также, если у вас есть несколько версий Windows на компьютере, то программа может видеть только одну из них.

Сначала можно попытаться сделать наш с 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.

Выводы

В этой небольшой статье мы разобрали что делать когда у вас возникнет ошибка grub не видит windows 10 и какими способами ее можно исправить. На самом деле решение очень простое, если вы не используете систему с UEFI. В варианте с EFI загрузка Windows управляется не Grub, а загрузчиком UEFI, но при использовании Linux рекомендуется отключить эту технологию.

Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.

Об авторе

Основатель и администратор сайта losst.ru, увлекаюсь открытым программным обеспечением и операционной системой Linux. В качестве основной ОС сейчас использую Ubuntu. Кроме Linux, интересуюсь всем, что связано с информационными технологиями и современной наукой.

  • Печать

Страницы: [1]   Вниз

Тема: После установки Ubuntu 20.04 пропал Windows 10 из grub2 [Решено]  (Прочитано 10072 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн
mrchals

Здравствуйте. Установил Ubuntu 20.04 рядом в Windows 10, однако grub2 не видит Windows 10.
Изначально пытался решить проблему с помощью boot-repair — он находит Windows 10 (на sda2), однако не может восстановить и пишет

«LegacyWindows detected. Please enable BIOS-compatibility/CSM/Legacy mode in your UEFI firmware, and use this software from a live-CD (or live-USB).».

Я отключил «fast boot» и установил «UEFI and LEGACY» в настройках BIOS, однако это не помогло.

Я подозреваю, что это может возникнуть вследствие того, что Windows 10 находится в состоянии «Hibernation». Отключить этого состояние возможно в настройках Windows, только теперь у меня нет возможности запустить Windows, т.к. его не предлагает grub2. Получается что я застрял?

Я пытался убрать состояние «Hibernation» с помощью:

sudo ntfsfix /dev/sda2Но это не помогло.

Подскажите, можно ли что либо сделать в такой ситуации?


ТС не появлялся на Форуме более трех месяцев по состоянию на 19/03/2021 (последняя явка: 07/11/2020). Модератором раздела принято решение закрыть тему.
—zg_nico

« Последнее редактирование: 19 Марта 2021, 14:30:14 от zg_nico »


Оффлайн
andytux

это может возникнуть вследствие того, что Windows 10 находится в состоянии «Hibernation

Эта беда скажется в другом месте. В данном случае она пока не мешает. Ты нарушил другое правило.

LegacyWindows detected

Вроде как говорит, что Виндовс в режиме легаси.
Все должно быть в одном режиме. Поищи по форуму.
На скорую руку, вот и вот..


Оффлайн
zg_nico

только теперь у меня нет возможности запустить Windows

Документацию к материнской плате посмотрите. Есть такая штука, называется bootmenu. Если у Вас UEFI поддерживает запуск одновременно с EFI-систем и Legacy-систем, не требуя при этом переключений режима загрузки, то при загрузке вызвав это bootmenu (типовые варианты, которые попадались мне: Esc, F5, F8, F12, — одна из этих клавиш при загрузке; свою клавишу смотрите в документации к материнской плате или документации к ноутбуку, если у Вас таковой) Вы можете выбрать с какого источника пойдет загрузка. И windows (если Вы ее разметкой не убили) должна в том перечне присутствовать.

Подскажите, можно ли что либо сделать в такой ситуации?

Как совершенно верно заметил ранее andytux, привести обе системы к одному режиму. Для этого либо переустановить Ubuntu/Windows, либо должным образом настроить Ubuntu/Windows. Смотря что выберете. Переустановка мне видится уж больно радикальным вариантом. Я бы ее отложил на крайний случай, а рассмотрел один из алгоритмов на Вашем месте:
1) Если настраивать Ubuntu. Предполагая, что Windows в режиме legacy, и не желая этого менять, можно установить иной загрузчик на ubuntu и заморочиться с миграцией Ubuntu на legacy. Успех предприятия не гарантирован, т.к. чёткого мануала от и до по сети мне для данного алгоритма не попадалось. Тем не менее, теоретически допускаю что этот вариант возможен, хоть я бы и не рекомендовал по нему идти.
2) Если настраивать windows10. Выходит за рамки данного форума. Можете обратиться на форум, посвященный windows, или создать отдельный топик в разделе «Разговоры обо всем» нашего форума, ибо сказано

Тем не менее, установленные в Legacy режиме системы линейки windows 7 [x64], windows 10 [x32/x64] можно перевести из режима legacy в режим uefi практически не заморачиваясь. Вот пример подобной миграции для win7. Действия, в сущности, аналогичные должны предприниматься для всех ОС из перечня выше. Следует понимать, что при экспериментах можно похоронить имеющуюся систему, так что до экспериментов следует обзавестись резервной копией разделов с windows, дабы экспериментировать можно было, не опасаясь.

Thunderobot G150-D2: Intel SkyLake Core i7-6700HQ 2.60GHz, 8Gb DDR4 2133 MHz, Intel HD530, NVidia GeForce GTX 960M 2Gb.  Ubuntu 16.04 64x [Unity], KUbuntu 18.04 64x.


Оффлайн
Дюшик

mrchals,
Загрузитесь в Ubuntu и покажите вывод

sudo parted -l
Вывод можно просто скопировать и вставить в сообщение.


Оффлайн
mrchals

Дюшик,

Вывод после выполнения команды sudo parted -l следующий:

Model: ATA WDC WD10EZEX-00W (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size   Type     File system  Flags
 1      1049kB  525MB   524MB  primary  ntfs         boot
 2      525MB   370GB   370GB  primary  ntfs
 3      370GB   371GB   907MB  primary  ntfs         msftres
 4      371GB   1000GB  629GB  primary  ntfs

Model: ATA WDC WD30EFRX-68E (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system     Name                          Flags
 1      17,4kB  134MB   134MB                   Microsoft reserved partition  msftres
 2      135MB   1515GB  1515GB  ntfs            Basic data partition          msftdata
 3      1515GB  1515GB  1049kB
 4      1515GB  1515GB  538MB   fat32           EFI System Partition          boot, esp
 6      1515GB  2992GB  1477GB  ext4
 5      2992GB  3001GB  8543MB  linux-swap(v1)                                swap

« Последнее редактирование: 13 Июля 2020, 22:52:57 от Aleksandru »


Оффлайн
vladimirzhuravlev

 На диске /dev/sdb: 3001GB всё нормально для двух систем в параллели, что на /dev/sda: 1000GB делает загрузочный раздел ? Отключи временно этот диск. Или у тебя винда есть на sda установленная в легаси, а linux на sdb установлен в режиме UEFI плюс и на этом диске винда установленная в UEFI и  ? Но выше ведь написано, что так не правильно. Зайти в винду отключить гибернацию можно попробовать загрузившись с ремонтной виндовой флешки, обычно там в опциях присутствует поиск винды и её загрузка.
 И на будущее, имхо, две системы заиметь на одном диске проще для новичка, чем разбрасывать их по разным. И не делай установку linux в автомате, применяй свою разметку.


Оффлайн
mrchals

vladimirzhuravlev,

Или у тебя винда есть на sda установленная в легаси, а linux на sdb установлен в режиме UEFI плюс и на этом диске винда установленная в UEFI и  ?

Да, я думаю у меня все таким образом и установленно, как вы выше и описали. Вообще изначально у меня рядом с windows 10 стояла ubuntu 16.04, но затем я решил поставить ubuntu 20.04, только установил ее не рядом с другими ОС, а вместо ubuntu 16.04 (при установке предлагался такой пункт с удалением ubuntu 16.04)

Я проделывал подобную операцию на другом компьютере (ноутбуке) — там в grub2 выбор windows 10 сохранился. Однако, когда попробовал на основном ПК — возникли вышеописанные проблемы.

Постараюсь решить проблему — отключением гибернации с помощью ремонтной флешки (hiren’s bootcd) и отпишусь о результах, хотя маловероятно, что проблема в гибернации, как уже писали выше.


Оффлайн
vladimirzhuravlev

Лично для меня не всё понятно… рядом это на одном компе или на одном диске ? На каких дисках что ранее установлено было и на каких дисках что установлено сейчас, в каких режимах ?

« Последнее редактирование: 14 Июля 2020, 01:09:22 от vladimirzhuravlev »


Оффлайн
Дюшик

Если Винды нет в GRUB, то она должна быть в BIOS (строка Windows Boot Manager). Можно в BIOS назначить загрузку с   Windows Boot Manager, а лучше через Boot Menu (F12 или другая клавиша) выбрать Windows Boot Manager, должна будет загрузиться Винда.

На /dev/sda есть установленная Винда? Если есть, то крайний случай можно в её, добавить загрузку Винды с /dev/sdb.

Во время установки Ubuntu, Вы раздел EFI случайно не отформатировали? Возможно Виндового загрузчика вообще нет, поэтому его не видят GRUB и boot-repair.

« Последнее редактирование: 14 Июля 2020, 14:31:18 от Дюшик »


Оффлайн
mrchals

Дюшик,

К сожалению при выборе boot device нет windows boot manager предложены варианты:

Please select boot device:
- ubuntu
- WDC WD10EZEX-00WN4A0
- WDC WD30EFRX-68EUZN0
- UEFI: Built-in EFI Shell
- Enter Setup

При выборе из этого меню дисков WDC… переходит на консоль:

error: no such device: 545ddbd-baea-...-...4745.
Entering rescue mode...
grub rescure> _


Оффлайн
Дюшик

mrchals,
Если Windows Boot Manager нет, то вариантов только два.

Не понятно так же, почему при выборе в Boot menu диска WDC WD10EZEX-00WN4A0 появляется консоль GRUB. Откуда там взяться GRUB’у.
Я бы предложил такой вариант.

Перезагрузиться, в Boot menu выбрать диск WDC WD10EZEX-00WN4A0 должна будет загрузиться Windows c /dev/sda2. В BIOS должен быть выбран режим загрузки UEFI and LEGACY.

Подключить второй жесткий диск и временно загружать системы через Boot menu. Отписаться о результатах.


Оффлайн
mrchals

Всем спасибо за помощь. Я все таки смог восстановить Windows 10. Теперь я могу загрузить и ubuntu и Windows 10 :coolsmiley:

Изначально я пытался из установленной ubuntu запустить boot-repair
Однако получал сообщение:

«LegacyWindows detected. Please enable BIOS-compatibility/CSM/Legacy mode in your UEFI firmware, and use this software from a live-CD (or live-USB).».

Вчитавшись в сообщение, я понял, что от меня требуется запустить boot-repair из под live-CD (or live-USB).

Я вставил установочную флешку с образом ubuntu и выбрал «Try ubuntu». И уже там я смог запустить boot-repair, который восстановил мне MBR для Windows 10 на жестком диске. Конечно, теперь мне приходится при загрузке выбирать жесткий диск, а не использовать grub, но думаю, если заморочиться, то можно более грамотно настроить grub.

Мне немного помогла эта статья https://askubuntu.com/questions/1088681/how-to-help-grub-find-windows-10-boot-manager


Оффлайн
andytux

я понял, что от меня требуется запустить boot-repair из под live-CD

Неправильно понял. В сообщении говорится, что обнвружена Виндовс в режиме легаси и тебе предлагают включить в УЕФИ этот режим.

думаю, если заморочиться, то можно более грамотно настроить grub.

Нет. Никакие заморочки тебе не помогут.
Повторяю еще раз, все должно быть в одном режиме: УЕФИ, загрузчики, системы.
Только в этом случае ты сможеть без ковыряния в УЕФИ загружать загрузчиком обе системы.
Если уж ориентироваться на Виндовс, она у тебя в режиме легаси.
Нужно загрузить boot-reair в режиме легаси и установить грубПС. Перед этим хорошенько подумать, куда его устанавливать.
Второй вариант может оказаться проще. Переустановить *бунту в режиме легаси. Но обязательно обратить внимание, что она запущена в режиме легаси. При этом уже на этапе разметки она должна увидеть Виндовс. Если не видит, то не в том режиме.


Оффлайн
Дюшик

но думаю, если заморочиться, то можно более грамотно настроить grub.

В зависимости от разрядности Windows есть варианты:
Общий вариант (не зависящий от разрядности Винды), это в GRUB прописать «обманку». Вот эдесь нажать второй способ.
Если Винда х64, то есть нщё вариант, но о нём говорить пока рано (нужно узнать разрядность Винды).

« Последнее редактирование: 25 Июля 2020, 10:27:36 от Дюшик »


  • Печать

Страницы: [1]   Вверх

На ноутбуке с двойной загрузкой (Ubuntu 22.04 + Windows 10) не отображается меню GRUB, в котором можно выбрать операционную систему для загрузки (Linux или Windows). По-умолчанию на ноутбук всегда загружается Ubuntu, а GRUB меню просто не показывается опцию для загрузки Windows 10.

На ноутбук были последовательно установлены Windows и Ubuntu, в качестве загрузчика выбран GRUB. GRUB успешно определил что на компьютере установлены две операционные системы и добавил файл загрузчика Windows (/EFI/Microsoft/Boot/bootmgfw.efi) в список доступных. Но после перезагрузки GRUB меню не отобразилось.

Чтобы показать меню GRUB можно при загрузке зажать:

  • клавишу
    Shift
    (на компьютерах с BIOS)
  • клавишу
    Esc
    (для современных компьютеров с UEFI)

Если это не помогло, нужно отредактировать конфигурационный файл GRUB. Загрузитесь в Linux и включите отображение меню GRUB, добавив (раскомментировав) следующие строки в /etc/default/grub:

$ sudo nano /etc/default/grub

GRUB_TIMEOUT=20

Эта опция включает таймаут 20 секунд, которые должен ждать GRUB при загрузки на этапе выбора операционной системы. Убедитесь, что в конфигурационном файле нет строки GRUB_TIMEOUT=0

Проверьте, есть ли в конфиг файле строка:

GRUB_TIMEOUT_STYLE=hidden

Если такая строка есть, закоментируйте ее или измените на

GRUB_TIMEOUT_STYLE=menu

Если параметра нет, создайте его вручную. Проверьте, что в конфиг файле нет параметров GRUB_HIDDEN.

После изменения настроек в файле grub нужно обновить его конфигурацию командой:

$ sudo update-grub

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-25-generic
Found initrd image: /boot/initrd.img-5.15.0-25-generic
Memtest86+ needs a 16-bit boot, that is not available on EFI, exiting
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Windows Boot Manager on /dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings...
done

sudo update-grub - обновить конфигурацию GRUB

Перезагрузите компьютер.

Если меню GRUB все еще не показывается, возможно GRUB не поддерживает видео режим вашего графической адаптера. Вы можете вместо графического GRUB меню отобразить консольное меню. Для этого добавьте в файл etc/default/grub строку:

GRUB_TERMINAL=console

включить режим консольного меню в GRUB

Сохраните файл и обновите конфигурацию:

$ sudo update-grub

Перезагрузите устройство и убедитесь, что GRUB теперь показывает загрузочное меню.

GRUB меню показывает список доступных операционных систем для загрузки

I have finally installed Ubuntu on my second drive. When I start my computer GRUB only offers me to boot Ubuntu, not Windows 7. What needs to be done so that I can choose between Ubuntu and Windows in GRUB?

When I press F12 for boot menu at startup and I choose Windows Boot Manager it boots into Windows 7.


I ran command sudo fdisk -l and here is log (http://pastebin.com/Cgv1igHc):

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xc3ffc3ff

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1  1953525167   976762583+  ee  GPT
Partition 1 does not start on physical sector boundary.

LiveWireBT's user avatar

LiveWireBT

28.5k26 gold badges108 silver badges221 bronze badges

asked Oct 8, 2012 at 16:20

HyperX's user avatar

2

  1. Boot Ubuntu and mount your Windows partition (simply open the disk on Nautilus)

  2. Run the following on the command line (Ctrl+Alt+t):

    sudo os-prober
    
  3. If your Windows installation was found, you can run:

    sudo update-grub
    

Note that step 2 is just for your convenience. You could just mount the Windows 7 partition and then run update-grub.

Related question

  • Unable to mount Windows (NTFS) filesystem due to hibernation

Community's user avatar

answered Oct 11, 2012 at 10:36

Hermes's user avatar

HermesHermes

1,3371 gold badge7 silver badges2 bronze badges

4

If the os-prober method above doesn’t work try adding a custom grub menu entry. Documented here.

First two steps are for finding your <UUID>.

  1. Run lsblk and find the name of the row with /boot/efi

Example output (here the answer is sda2):

lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda           8:0    0   477G  0 disk 
├─sda1        8:1    0   450M  0 part 
├─sda2        8:2    0   100M  0 part /boot/efi
├─sda3        8:3    0    16M  0 part 
├─sda4        8:4    0    47G  0 part /windows
├─sda5        8:5    0 425,6G  0 part /
└─sda6        8:6    0   3,7G  0 part [SWAP]
mmcblk0     179:0    0  14,9G  0 disk 
└─mmcblk0p1 179:1    0  14,9G  0 part
  1. Run sudo blkid /dev/sdaX where sdaX is the answer from previous step (sda2 in my case).

Example output (here the answer is 58E4-427D):

/dev/sda2: UUID="58E4-427D" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="b81727be-ba90-5f8c-ab98-d3ec67778b7d"
  1. Add the following at the end of the file /etc/grub.d/40_custom:
menuentry "Windows 7" {  
     insmod ntfs  
     set root='(hd0,1)'  
     search --no-floppy --fs-uuid --set <UUID>
     chainloader +1  
}
  1. Run sudo update-grub and reboot.

Carolus's user avatar

Carolus

5964 silver badges18 bronze badges

answered May 29, 2015 at 9:27

Philippe Gachoud's user avatar

Philippe GachoudPhilippe Gachoud

5,8303 gold badges41 silver badges50 bronze badges

2

I had Windows 10 running and then tried dual boot. Once Ubuntu was installed, Win 10 wasn’t showing up in my GRUB loader. I tried the following —

First of all, I disabled Secure Boot in Win10. Then ran the below
commands in Ubuntu :

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

Worked out pretty well. Was able to find both Windows and Ubuntu in GRUB after that.

αғsнιη's user avatar

αғsнιη

35.2k41 gold badges129 silver badges192 bronze badges

answered Oct 23, 2016 at 17:13

Karthik Ubaradka's user avatar

3

I solved a similar problem following steps of Boot-Repair

Install boot-repair

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair

Push «Recommended repair»
And put in a terminal some commands as it suggested.

I think my Grub doesn’t recognize windows due to a bad shutdown, and it solved the problem.

answered Apr 25, 2016 at 14:30

Rutrus's user avatar

RutrusRutrus

1,5011 gold badge9 silver badges10 bronze badges

Slightly different method as I copied from a working example on another computer, posting for my own records.

Append the following to /etc/grub.d/40_custom:

menuentry "Windows 10" {
        insmod part_gpt
        insmod fat
        search --no-floppy --fs-uuid --set <boot_efi_uuid>
        chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

where <boot_efi_uuid> is the UUID of your /boot/efi partition. To find this:

$ lsblk
NAME              MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT                                                  
sda                 8:0    0 119.2G  0 disk
└─md126             9:126  0 357.7G  0 raid0
  ├─md126p1       259:0    0   499M  0 md
  ├─md126p2       259:1    0   100M  0 md    /boot/efi                                                   
$ sudo blkid | grep md126p2 # Replace with your device
/dev/md126p2: UUID=<boot_efi_uuid>

Then of course, once you’re saved the file, run:

sudo update-grub

Reboot, you should now be able to successfully start up Windows.

answered Feb 16, 2019 at 23:45

Christopher Markieta's user avatar

2

If you have previously had a RAID installed that may be causing issues. In my case, I built my desktop in 2010, and I installed two 1.5 TB with a striped RAID. User gracemercy54 mentions here that this is left over metadata from the former RAID configuration.

When I originally tried the steps by Hermes I got an error specifying «wrong number of devices in a RAID set.» So, if this happens to you open a terminal and run:

   sudo dmraid -rE
   sudo os-prober
   sudo update-grub

That fixed this for me.

answered Mar 18, 2017 at 18:56

Adam Drewery's user avatar

2

I had issues like here above and the solution was just to add manual entry as below:

menuentry "WINDOWS10 (on /dev/sda1)" --class windows --class os {
    insmod part_msdos
    insmod ntfs
    set root='(/dev/sda,msdos1)'
    search --no-floppy --fs-uuid --set=root 688EB92384B85968
    drivemap -s (hd0) ${root}
    chainloader +1
}

where UUID above (688E…) was taken from boot windows disk via blkid /dev/sdb1.

ATTENTION: the additional line

set root='(/dev/sda,msdos1)'

refers to sda which is visible under Ubuntu as /dev/sdb even actually it is the first disk in sata bus while /dev/sda is in fact second drive mounted as root /.

Maybe that is why grub scripts could not work properly. I had no time to change the physical order of disks but it is quite possible it would help to resolve the issue, too.

Eliah Kagan's user avatar

Eliah Kagan

117k54 gold badges319 silver badges495 bronze badges

answered Dec 4, 2017 at 22:50

luke's user avatar

I had the same problem with Windows 10. I installed Linux Mint 18.1 Cinnamon 64-bit on my laptop for dual boot with WIN10. After the installation GRUB only offered to boot Linux but not Windows.

I found the video solution for windows 10 missing from grub menu and the forum thread Grub not recognizing Win10 after Update/Repair, but unfortunately neither worked for me so I used a combination of these two to resolve my problem.

Open your terminal and follow these commands and open the file named 40_custom:

sudo gedit /etc/grub.d/40_custom

Add these lines to the end of the file and then save and exit:

menuentry "Windows 10" {
   set root='{hd0,1}'
   chainloader + 1
}

After you save the file update your GRUB with this command:

sudo update-grub

Then restart your machine to see if it works.

Hope this will work for others too!

Eliah Kagan's user avatar

Eliah Kagan

117k54 gold badges319 silver badges495 bronze badges

answered May 30, 2017 at 13:16

Lahiru's user avatar

1

Edit: As @Guss specified, this should be configured in /etc/default/grub, not the built-in script.

Old answer:

Follow these steps if os-prober shows Windows, but GRUB does not.

  • Edit grub-mkconfig
    sudo nano /usr/bin/grub-mkconfig
    
  • Find these lines near the middle
    # Disable os-prober by default due to security reasons.
    GRUB_DISABLE_OS_PROBER="true"
    
  • Change true to false
  • Exit nano (CTRL+X, Y, Enter)
  • Update GRUB
    sudo update-grub
    

answered Mar 11, 2021 at 13:16

nathanfranke's user avatar

nathanfrankenathanfranke

1561 gold badge1 silver badge8 bronze badges

1

I had the same problem and had spent 2 days figuring it out. But today I had this sudden idea in the morning and it worked out.

You should review your bios/uefi settings. In my case I had to let Uefi boot first. Otherwise I wasn’t able to detect windows from ubuntu. What I had to set was ubuntu > Windows Boot Manager > DISK1 > DISK2 > DISK3. Insted DISK1 > ubuntu > Windows Boot Manager > DISK3.

I had 2 ubuntu installations one on hdd and one on ssd. Apparently ssd installation wasn’t showing as UEFI for some reasone but I wanted boot faster disk first.

I wasn’t expecting that order of boot can influence grub in detecting systems. So it is worth to review that.

answered Apr 29, 2017 at 7:08

Bartosz Dabrowski's user avatar

I had the same issue after I installed the updates from ubuntu. The following commands worked for me perfectly:

sudo apt-get install os-prober

First install os-prober to detect windows and then update grub:

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

answered Oct 29, 2019 at 21:02

phoenix007's user avatar

1

In addition to the answer of Bartosz Dabrowski, which lead me to solving my problem:

Be sure that if your Linux uses UEFI Boot/GPT that your other OS (eg. Windows in my case) also uses UEFI Boot/GPT. Coming from an old Win7 to Win10 installation the hard drive still had old school boot and MBR. Somehow os-prober and boot-repair had their problems to fix this.

Ensure that in BIOS / Boot order there is your HDD with ubuntu (eg. uefi: ubuntu) and your HDD with Windows Boot Manager (eg. uefi: Windows Boot Manager) to be found.

If WBM is missing ensure that windows boot disk has GPT. You can check this in Windows using Disk Management (Win + X, then Disk Management).

There is a Windows tool: mbr2gpt which can convert your MBR to GPT. After doing so (and booting via UEFI) os-prober and finally update-grub was able to find my Windows installation and added it to the boot options of grub.

answered Oct 15, 2020 at 6:35

methical's user avatar

Okay, so I had the same problem and couldn’t find a solution for me out there for a long time, finally got it, so here is my little grain of sand to the world. Before you try, remember to check you are booting using UEFI everytime you can:

Apparently, in the process of installing Debian the Windows data inside the EFI partition was lost, so what I did is a System restore using a Windows 10 USB (I tried fixing the boot but somehow it didn’t work, I even tried it on console, anyways I lost no data). After this, now I coulnd’t boot Debian, so I run a Debian live CD, mounted everything and chrooted like this (and don’t forget to boot the USB as UEFI):

mount /dev/your_linux_partition /mnt
cd /mnt
mount -t proc /proc proc/
mount -t sysfs /sys sys/
mount --rbind /dev dev/
mount --rbind /sys/firmware/efi/efivars sys/firmware/efi/efivars/
mount /dev/your_efi_partition /boot/efi/
chroot /mnt /bin/bash

Now, here os-prober didn’t detect Windows 10, but I decided to grub-install /dev/sda and grub-update anyways and restart.

Here is the funny thing, now I couldn’t boot Windows 10 and only Debian, BUT!, I tried once again to grub-update and finally found the Windows 10 boot. This doesn’t make any sense honestly, but I don’t care. Hope it helps anyone as desperate as me :D .

answered Oct 16, 2021 at 18:56

M83OutroFeelings's user avatar

You must log in to answer this question.

Not the answer you’re looking for? Browse other questions tagged

.

Ubuntu 3

In a dual-boot setup, the GRUB (Grand Unified Bootloader) allows you to choose between different operating systems during startup. However, sometimes, GRUB might not detect your Windows installation, preventing you from booting into Windows. This article will guide you through various solutions to fix this issue in a dual-boot setup with Ubuntu and Windows 7.

  1. Solution 1: Use os-prober to Detect Windows
  2. Solution 2: Add a Custom GRUB Menu Entry for Windows
  3. Solution 3: Use the boot-repair Tool
  4. Solution 4: Enable os-prober in grub-mkconfig
  5. Conclusion

Solution 1: Use os-prober to Detect Windows

The os-prober utility can detect various operating systems installed on your machine. Here’s how to use it:

  1. Boot into Ubuntu and open the terminal.
  2. Mount your Windows partition. You can do this by opening the disk on Nautilus (Ubuntu’s default file manager) or by running the following command in the terminal:
sudo mount -t ntfs-3g -o ro /dev/sdaX /media/windows

In this command, replace sdaX with the identifier for your Windows partition (for example, sda2). The ntfs-3g option specifies the file system type, and the ro option mounts the partition in read-only mode.

  1. Run the os-prober command:
sudo os-prober

This command scans your system for other operating systems.

  1. If os-prober successfully detects your Windows installation, update GRUB with the following command:
sudo update-grub

This command generates a new GRUB configuration file based on the currently installed kernels and operating systems detected by os-prober.

Solution 2: Add a Custom GRUB Menu Entry for Windows

If os-prober fails to detect Windows, you can manually add a custom menu entry for Windows in the GRUB configuration file.

  1. Open the terminal and run the lsblk command to list all block devices:
lsblk

Look for the row with /boot/efi in the MOUNTPOINT column. The name of this row is the identifier for your EFI system partition.

  1. Run the blkid command to get the UUID (Universally Unique Identifier) of the EFI system partition:
sudo blkid /dev/sdaX

Replace sdaX with the identifier you found in the previous step.

  1. Open the /etc/grub.d/40_custom file with a text editor such as nano:
sudo nano /etc/grub.d/40_custom
  1. Append the following lines to the file:
menuentry "Windows 7" {
 insmod ntfs
 set root='(hd0,1)'
 search --no-floppy --fs-uuid --set <UUID>
 chainloader +1
}

Replace <UUID> with the UUID you obtained earlier. This block of code creates a new GRUB menu entry named “Windows 7”. The insmod ntfs line loads the NTFS module, allowing GRUB to read NTFS partitions. The set root line sets the root device for GRUB. The search line tells GRUB to search for the partition with the specified UUID. The chainloader +1 line loads the first sector of the specified root device.

  1. Save the file and exit the editor.
  2. Update GRUB:
sudo update-grub

Solution 3: Use the boot-repair Tool

The boot-repair tool is a simple tool to repair frequent boot issues. You can use it to repair the GRUB bootloader.

  1. Install the boot-repair tool by running the following commands in the terminal:
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair && boot-repair
  1. Launch the boot-repair tool and click on the “Recommended repair” option. Follow the instructions provided by the tool to repair the boot configuration.
  2. After the repair process is complete, restart your computer and check if Windows is detected in GRUB.

Solution 4: Enable os-prober in grub-mkconfig

In some cases, os-prober might be disabled in grub-mkconfig, the script used to generate the GRUB configuration file.

  1. Install the os-prober package:
sudo apt-get install os-prober
  1. Open the grub-mkconfig file:
sudo nano /usr/bin/grub-mkconfig
  1. Find the line that disables os-prober and change GRUB_DISABLE_OS_PROBER="true" to GRUB_DISABLE_OS_PROBER="false".
  2. Save the file and exit the editor.
  3. Update GRUB:
sudo update-grub

Conclusion

These solutions should help you fix the issue of GRUB not detecting Windows in a dual-boot setup with Ubuntu and Windows 7. If none of these solutions work, you may need to further troubleshoot your system or seek additional help from the Ubuntu community or forums. Always remember to back up your data before making any major changes to your system.

GRUB (Grand Unified Bootloader) is a boot loader that allows you to choose between different operating systems installed on your computer during startup.

There can be several reasons why GRUB is not detecting your Windows installation. It could be due to a misconfiguration, an issue with the boot loader, or a problem with the Windows partition.

After running the os-prober command, if it successfully detects your Windows installation, you will see the output displaying the detected Windows entry.

Yes, you can manually add a custom GRUB menu entry for Windows by editing the /etc/grub.d/40_custom file and adding the necessary configuration.

The chainloader +1 line in the custom GRUB menu entry loads the first sector of the specified root device, which is required to boot into Windows.

You can use the boot-repair tool by installing it and then launching it. Click on the «Recommended repair» option and follow the instructions provided by the tool to repair the boot configuration.

To enable os-prober in grub-mkconfig, you need to edit the grub-mkconfig file and change the value of GRUB_DISABLE_OS_PROBER from «true» to «false».

If none of the solutions work, you may need to further troubleshoot your system or seek additional help from the Ubuntu community or forums. It’s always a good idea to back up your data before making any major changes to your system.

  • Ubuntu сеть windows папка пуста
  • Ubuntu или windows 10 что быстрее
  • Ubuntu сбивает время в windows
  • Ubuntu и доменная сеть windows
  • Ubuntu после установки загружается только windows