Ubuntu grub не видит windows

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

.

Многие новички и опытные пользователи 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, интересуюсь всем, что связано с информационными технологиями и современной наукой.

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

.

Была установлена Windows7, которой я пользовался достаточно длительное время. Захотел освоить убунту. Т.к. нельзя было уничтожать инфу и пока не разберусь с убунтой, решил оставить винду на всякий случай.
Разбивка получилась бредовая, но по другому никак(
вот результат fdisk -l
7e71f7e4ccdb473a91d309a5b19e6b85.png

sda1 — /boot/
sda2 — мой диск E в винде
sda3 — windows
sda5 — мой диск D в винде
sda6 — swap
sda7 — /
sda8 — /home/

grub-update делал, но он не видит винду. Появляется только убунту и 2 штуки сканирования памяти.
Установил пакет boot-repair.
Попытался востановить MBR винды, но после этого вылезла такая штука минуя граб:
BOOTMGR is missing
Press ctrl+alt+del to restart

лог: ЛОГ

Обратно всё вернулось после выбора рекомендуемых параметров boot-repair. Лог от boot-repair: ЛОГ

Подскажите пожалуйста как подружить ubuntu и Windows7 в моей ситуации. Целый день карачился и ничего так и не получилось.


  • Вопрос задан

  • 10945 просмотров

Все предложенные варианты — не помогли((
Пришлось переразбивать винт и нормально, последовательно всё ставить.

Пригласить эксперта

Нормальная практика;) последовательность действий следующая-> востанавливаете загрузчик винды(для этого нужен образ винды) после этого будет загружаться винда, после востанавливаете grub с помощью live-cd ubuntu

Возможно поможет

sudo -s
apt-get install os-prober
update grub

Это стандартные проблемы, которые связанны с MBR и различными флагами.

Если хотите быстро и просто решить проблему, грузите Ubuntu и устанавливайте Boot-Repair:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo sed 's/trusty/saucy/g' -i /etc/apt/sources.list.d/yannubuntu-boot-repair-trusty.list
sudo apt-get update
sudo apt-get install -y boot-repair && (boot-repair &)

Если нужны детали, обращайтесь сюда: Boot Repair

Добавте в /etc/grub.d/40_custom , (или создать, пример, 50_windows)

menuentry 'Windows' {
	insmod part_msdos
        insmod fat
 	insmod ntfs
        insmod ntldr
 	set root='hd0,msdos1'
        search --no-floppy --file --set=root /bootmgr
	ntldr /bootmgr
}

update-grub

Скорее всего, у Вас UEFI/EFI. У меня такое было после установки линукса паралельно с Windows 7 на EFI. Grub просто не «подхватил» нужную запись.
В линуксе сделайте в терминале, пот рутом:

~# update-grub
~# reboot

Если не появился нужный пункт в списке систем, продолжаем. Выполните под рутом:

~# grub-probe —target=fs_uuid /boot/*/*/Microsoft/Boot/bootmgfw.efi
выводом будет Ваш идентификатор диска с виндой — выпишем его на бумагу

затем выполните (я использую vim, если не знакомы — любой другой консольный редактор:
~# vim /etc/grub.d/40_custom
и в самый конец допишите, после всех комментариев с новой строки:

menuentry «Windows x86_64 UEFI-GPT» {
insmod part_gpt
insmod fat
search —fs-uuid —no-floppy —set=root ВАШ_ИДЕНТИФИКАТОР_С_БУМАГИ
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

После этого выполните от рута:
~# update-grub
~# reboot

Profit!


  • Показать ещё
    Загружается…

09 окт. 2023, в 10:05

30000 руб./за проект

09 окт. 2023, в 10:04

60000 руб./за проект

09 окт. 2023, в 10:01

10000 руб./за проект

Минуточку внимания

  • Печать

Страницы: [1] 2 3 7  Все   Вниз

Тема: Grub не видит Windows с жесткого диска  (Прочитано 9837 раз)

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

Оффлайн
vovih

Всем привет!
Столкнулся с проблемой отображения Windows7 в grub2.
Windows7 установлена на SSD120гб, ubuntu на HDD1000
Несколько недель назад устанавливал ubuntu (live cd запущенной without installing), устанавливал в рабочего стола live-cd и у меня в меню grub2 всё отображалось:
Ubuntu, memtest86+, windows7 и тп.

Переустановил Ubuntu, выбрал приоритет загрузки с флешки и нажал install Ubuntu, установилась Ubuntu и меню выбора ОС вообще не вылезало, я изменил конфигурационный файл и выбор стал появляться, но в окне Grub2 только две графы Ubuntu и дополнительные настройки.
Что делал:

sudo update-grub — не помогло, ничего не изменилось

blkid /dev/sda1 — узнал UUID и добавил в файл /etc/grub.d/40_custom следующее

menuentry "Windows 7" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set B4A6AEB7A6AE7A0E
chainloader +1
}
не помогло.

sudo update-grub
Отдельно я также монтировал диск и виндой в папку mnt:

mount /dev/sda1 /mnt/после этого os-prober ничего не выдаёт
Дерево дисков:

sda      8:0    0 111,8G  0 disk
└─sda1   8:1    0 111,8G  0 part /mnt
sdb      8:16   0 465,8G  0 disk
├─sdb1   8:17   0   205G  0 part
└─sdb2   8:18   0 260,8G  0 part
sdc      8:32   0 931,5G  0 disk
├─sdc1   8:33   0   512M  0 part /boot/efi
└─sdc2   8:34   0   931G  0 part /
sdd      8:48   1   3,8G  0 disk
└─sdd1   8:49   1   3,8G  0 part /media/veles/UBUNTU 18_0

Посдкажите, что можно сделать?
На некоторых форумах нашёл инфу, что можно поставить grub на два жестких диска, но тут вопрос — нужно ли мне создавать ещё один раздел (200-300мб EFI) на диске с Windows?

« Последнее редактирование: 26 Ноября 2020, 16:29:13 от vovih »


Оффлайн
Pilot6

Не видит потому, что винда установлена не в uefi режиме. Так что проще Ubuntu так же поставить. Тогда увидит.

Я в личке не консультирую. Вопросы задавайте на форуме.


Оффлайн
vladimirzhuravlev

нажал install Ubuntu, установилась Ubuntu и меню выбора ОС вообще не вылезало

Вот вы любители ставить Ubuntu на другой диск ? Неужели у винды немного отнять нельзя было ? И что значит установилась ? Установщик предлагает несколько типов установки … полностью на диск, рядом с виндой, свой (другой) вариант, выбирать нужно последнее. Если-бы на диске с виндой присутствовал виндовый загрузчик ESP, вот на этот раздел и нужно было натравить установку граба ? НО… у тебя ведь вин 7 установлена на sda1 в режиме легаси ? Тогда и Ubuntu нужно было ставить в легаси и путь для граба на весь sda. Вот тогда после перезагрузки ты и увидел-бы меню вожделенное. Сколько уже везде понаписано что обе системы устанавливать нужно в одном режиме ? Как у тебя выйдет меню выбора, если грузишся например в уефи (в которой установил Ubuntu), естественно виндовый загрузчик биос не увидит, так как он для легаси.
У меня тоже такой-же ssd и у тебя винде с её приложениями вполне хватит 20-30 Gb (у меня порезанная на раздел 10 Gb установлена), остальное можно разметить для Ubuntu… ну или хотя-бы пополам поделить. А HDD1000 под файлопомойку в ntfs ( у меня полторашка для этого).


Оффлайн
vovih

Не видит потому, что винда установлена не в uefi режиме. Так что проще Ubuntu так же поставить. Тогда увидит.

У меня были такие предположения, но я не помню, чтобы я её ставил в режиме legacy.
Как тогда объяснить тот факт, что неделю назад но с другой ubuntu у меня было меню grub2?
Мне просто очень интересно.


Оффлайн
vladimirzhuravlev

Как тогда объяснить тот факт, что неделю назад но с другой ubuntu у меня было меню grub2?

Наверное устанавливал не в автомате, а с ручной разбивкой и граб присунул туда, где виндовый загрузчик.


Оффлайн
vovih

нажал install Ubuntu, установилась Ubuntu и меню выбора ОС вообще не вылезало

Вот вы любители ставить Ubuntu на другой диск ? Неужели у винды немного отнять нельзя было ? И что значит установилась ? Установщик предлагает несколько типов установки … полностью на диск, рядом с виндой, свой (другой) вариант, выбирать нужно последнее. Если-бы на диске с виндой присутствовал виндовый загрузчик ESP, вот на этот раздел и нужно было натравить установку граба ? НО… у тебя ведь вин 7 установлена на sda1 в режиме легаси ? Тогда и Ubuntu нужно было ставить в легаси и путь для граба на весь sda. Вот тогда после перезагрузки ты и увидел-бы меню вожделенное. Сколько уже везде понаписано что обе системы устанавливать нужно в одном режиме ? Как у тебя выйдет меню выбора, если грузишся например в уефи (в которой установил Ubuntu), естественно виндовый загрузчик биос не увидит, так как он для легаси.
У меня тоже такой-же ssd и у тебя винде с её приложениями вполне хватит 20-30 Gb (у меня порезанная на раздел 10 Gb установлена), остальное можно разметить для Ubuntu… ну или хотя-бы пополам поделить. А HDD1000 под файлопомойку в ntfs ( у меня полторашка для этого).

Я установил ubuntu на другой диск из тех соображений, что у меня ubuntu больше недели не работает, постоянно падает grub2, на форучах советовали на другой диск установить её.
Windows он такой у меня там свободно сейчас совсем немного места, на винде оно всегда куда то пропадает.

Я имел ввиду то, что когда я устанавливал ubuntu с рабочего стола live-cd у меня работал grub
А в этот раз я начал установку Ubunty не с рабочего стола ubuntu, а с того момента когда когда появился выбор действий при загрузке live-cd


Оффлайн
andytux

Все должно быть в одном режиме: УЕФИ, загрузчики, системы.

На некоторых форумах нашёл инфу

Зачем далеко ходить. Едва-ли не ежедневно здесь появляются такие темы.
Последняя, здесь, вот. И таких тем десятки.

Я имел ввиду то…

…что ты запутался.

когда я устанавливал ubuntu с рабочего стола live-cd у меня работал grub

Просто угадал с режимом установки. Но это связано не с тем, откуда ты запустил установку, с рабочего стола или из меню груб. Все происходит раньше.

Как тогда объяснить тот факт, что неделю назад

Есть УЕФИ, в которых включается либо ЕФИ-режим, либо легаси-режим. Есть такие, в которых активны сразу оба режима, похоже у тебя такой.
В каком режиме пойдет загрузка, зависит от того, какое устройство будет выбрано. Если выбрано ЕФИ-устройство, то пойдет загрузка в ЕФИ-режиме, если БИОС-устройство, то пойдет загрузка в легаси-режиме.
Ефи-устройства обычно называются типа «windows boot manager», «ubuntu…», «grub…»
БИОС-устройства обычно называются по марке HDD, типа «WD…».
Тип загрузочного устройства зависит от того, как оно создано. В программах создания загрузочных флешек это можно указать.
Например, если флешка создана командой dd, то УЕФИ увидит два устройства, ЕФИ и легаси. Хотя это зависит от конкретного УЕФИ. Некотороые могут увидеть только то, которое попадется первым.

установил ubuntu на другой диск

В принципе, хорошая идея. Я всегда за нее. Особенно в легаси-режиме, где в MBR может быть только один загрузчик.

ubuntu больше недели не работает, постоянно падает grub2

Похоже, как-будто Виндовс обновляется и затирает загрузчик. Хотя вроде в семерке уже нечего обновлять.
В этом случае и хорош вариант, когда каждая система полностью на своем диске. *бунту не затрагивает виндовс-загрузчик, виндовс не знает о грубе. Можно диски использовать раздельно.


Оффлайн
vladimirzhuravlev

хорош вариант, когда каждая система полностью на своем диске

Хорош для тебя, т.к. ты прилично в настройках граба разбираешся, у себя я даже и сообразить не могу куда загрузчик ставить если систему на второй диск поставлю, ну и даже и на него, то не знаю как грузится всё будет, если конфиги не подправлять.
 В моём случае у меня на одном ssd в 120Gb, на mbr несколько лет работает вин 7, а linux рядышком ставил раз пять разных. Установлены в легаси. Ни каких проблем, ничего править не нужно, меню появляется автоматом после первой перезагрузки, сразу правлю его кастомайзером оставляя пару строчек основных, меняя шрифт и картинку.

« Последнее редактирование: 26 Ноября 2020, 20:06:27 от vladimirzhuravlev »


Оффлайн
andytux

vladimirzhuravlev, твой неудачный опыт только подтверждает правильность моего. Как получится с грубом, это на воде вилами писано, особенно если не разбираешься.
Вот тут и есть плюс моего подхода. Ты не портишь то, что было до этого. Если была винда, то она останется со своим загрузчиком и будет грузиться. А при твоем подходе, ты затрешь ее загрузчик. И если груб не заработает, то не будет грузиться ничего.
Удобней этого только иметь груб вообще независимый от системы.

на mbr несколько лет работает вин 7

Если интересно, посмотри эту тему. Там описаны назначение разделов и расположение файлов. Там не сказано, но на разделе sda2 установлена Виндовс 7, «заводская установка».

« Последнее редактирование: 27 Ноября 2020, 09:46:21 от andytux »


Оффлайн
vladimirzhuravlev

И если груб не заработает, то не будет грузиться ничего.

Ерунда какая… в ремонтной виндовой флешке есть опция поправить загрузку винды, в некоторых дистрибутивах linux опция восстановления загрузчика ubuntu, установку груба вручную тоже никто не отменял. Что-бы перестало грузится всё нужно Биос попортить, а если железо в порядке, то с флешек грузится всё. А уж там можно выйти в инет, читать советы, пробовать и т.д.
Желающий заиметь в параллели 2 системы должен понимать, что не всё так просто, должен покурить бамбук в сети. После десятка переустановок будет делать всё в автомате не задумываясь.


Оффлайн
andytux

«…потому, что в кузнице не было гвоздя.»

в ремонтной виндовой флешке

Это у тебя в подушке пара ремонтных флешек, у меня груб, как «двое из ларца», выскакивает из любого места.
Посмотри на форуме. Чуть «ой загрузка», сразу «как создать флешку», пока гром не грянет, мужик не перекрестится.
По сути, твоя ремонтная флешка и есть «система на отдельном диске, со своим загрузчиком», а на каком конкретно она диске — это дело пятое.


Оффлайн
vovih

Есть УЕФИ, в которых включается либо ЕФИ-режим, либо легаси-режим. Есть такие, в которых активны сразу оба режима, похоже у тебя такой.

Привет. Ты оказался прав, у меня разрешены два режима были.
Я в принципе подозревал, что Windows в Legacy установлен, но я давно его устанавливал и не помнил этого.
Спасибо за сообщение после него некоторые пазлы встали в нужное место и сформировалась картина.
Проблема решена. Спасибо Pilot6, vladimirzhuravlev, andytux.

Переустановил я Ubuntu в legacy режиме, и теперь у меня начались танцы с бубнами.
Не могут же так все с linux мучаться как я.
Только переустановил систему и на неё сразу пакеты не накатывались, один из пакетов битый бил, порешал это дело.
Каждые несколько перезагрузок у меня система становится только для чтения, и опять падает grub, часто перед загрузкой приходится запускать fsck.


Оффлайн
andytux

аждые несколько перезагрузок у меня система становится только для чтения…часто перед загрузкой приходится запускать fsck.

Проблемы с винчестером.


Оффлайн
vovih

аждые несколько перезагрузок у меня система становится только для чтения…часто перед загрузкой приходится запускать fsck.

Проблемы с винчестером.

Я специально купил новый жесткий диск.


Оффлайн
ALiEN175

Я специально купил новый жесткий диск.

не показатель. Может глючить sata-порт, плохой кабель, плохое соединение, плохой БП.

« Последнее редактирование: 24 Декабря 2020, 22:27:07 от ALiEN175 »

🖥 AsRock B550M Pro4 :: AMD Ryzen 5 3600 :: 16 GB DDR4 :: AMD Radeon RX 6600 :: XFCE
💻 ACER 5750G :: Intel Core i5-2450M :: 6 GB DDR3 :: GeForce GT 630M :: XFCE


  • Печать

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

  • Uathelper packaging windows error cook failed
  • Ubuntu ftp for windows domain
  • Uac windows 10 отключить для одной программы
  • Ubuntu desktop remote desktop from windows
  • Tweaking com windows repair русификатор