PDA

View Full Version : [ubuntu] Windows 7 dual boot grub setup, not detecting Windows 7



ghostal
January 16th, 2017, 11:16 PM
Hi, first post here - hello everyone!


I have a machine with Windows 7 and Ubuntu installed. Each OS is on a separate physical disk. The motherboard is an Asus X99 Deluxe.


These are the steps I went through to reach this point.
Machine starts with one SSD with Windows 7 installed.
I added a second (identical) SSD to the machine, and unplugged the first.
I installed Ubuntu 16.04 from a USB on the second SSD.
Once installed, I plugged the first disk back in.
The situation now is this:
Ubuntu seems to boot without issue, although I don't see any grub menu during boot.
I can boot Windows 7 (or Ubuntu, in fact) without issue by entering the UEFI BIOS and picking a partition to boot from (which pleasantly surprised me the first time!). Once I pick one, any restart will cause that OS to be booted again after a restart, until I go into the BIOS again and pick another.
However, I can't see options for the first (Windows 7) disk in the boot priority listing.


Some while ago when BIOS all looked ugly and blue and text-based I could understand stuff like boot order, but now it seems like I'm completely lost.


My goal is to have grub installed on the second (Ubuntu) disk, and have it deal with booting both operating systems. However, I would also like to have the option of removing the Ubuntu disk, and have the machine boot up as it was before the second disk was added and Ubuntu was installed.


However, grub doesn't seem to be able to detect the Windows 7 installation (although the Windows partition is mounted and files are accessible from within Ubuntu). Here is what I have tried so far:



$ sudo update-grub
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.4.0-59-generic
Found initrd image: /boot/initrd.img-4.4.0-59-generic
Found linux image: /boot/vmlinuz-4.4.0-31-generic
Found initrd image: /boot/initrd.img-4.4.0-31-generic
Adding boot menu entry for EFI firmware configuration
done
$ sudo os-prober
$



As you can see, grub doesn't detect the Windows 7 install, and os-prober provides no output.


I think tried the boot-repair tool, but the automatic repair option generates the following error:



GPT detected. Please create a BIOS-Boot partition (>1MB, unformatted filesystem, bios_grub flag). This can be performed via tools such as Gparted. Then try again.
Alternatively, you can retry after activating the [Separate /boot/efi partition:] option.


The boot info summary generated by boot-repair is here: http://paste2.org/cAYLgLKz

Dennis N
January 17th, 2017, 01:37 AM
sda has a msdos partition table, so Windows was installed in BIOS mode. sdb has a gpt partition table, and ubuntu was installed in UEFI mode. You will have to install Ubuntu in BIOS mode as well in order for grub to detect Windows - the UEFI grub will not include and boot BIOS installs in the grub menu.

Note: You can install in BIOS mode on the gpt-partitioned disk if you create a bios boot partition. The message you show:

"GPT detected. Please create a BIOS-Boot partition (>1MB, unformatted filesystem, bios_grub flag). This can be performed via tools such as Gparted."

explains what that is.

oldfred
January 17th, 2017, 02:41 PM
I would reinstall Windows 7 in UEFI mode since hardware is UEFI.
But you can convert your Ubuntu install to BIOS as mentioned by Dennis N if you add the bios_grub partition & run Boot-Repair.
In Boot-Repair's advanced mode, you can choose the full uninstall/reinstall of grub. It uninstalls grub-efi-amd64 and installs grub-pc for BIOS boot.

Windows 7's default install is BIOS, you have to copy files to flash drive and move some around so it has /EFI/Boot/bootx64.efi as UEFI only boots from that file.

GPT Advantages (older 2010 but still valid) see post#2 by srs5694:
http://ubuntuforums.org/showthread.php?t=1457901
https://wiki.archlinux.org/index.php/GUID_Partition_Table#Advantages_of_GPT
http://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface
http://askubuntu.com/questions/629470/gpt-vs-mbr-why-not-mbr
UEFI Advantages
http://askubuntu.com/questions/647303/uefi-or-legacy-which-is-advised-and-why/647604#647604
http://askubuntu.com/questions/446968/legacy-vs-uefi-help
http://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface

ghostal
August 8th, 2017, 04:59 AM
I know this is somewhat of a necro-post but I've only just found time to reinstall! Up until now I've been using the boot menu from the UEFI console, which is inconvenient but did the job whilst other things were more pressing. This time I made sure that both OS's were installed using the same mode, and this indeed solved the problem, and I now have a lovely convenient dual boot setup using grub. Thanks a lot!