enabling boot to windows

Archived topics about LMDE 1 and LMDE 2
Locked
asper

enabling boot to windows

Post by asper »

Hi
I installed LMDE some time ago on my desktop. Although it came with a fully working Win7 install, after LMDE installation (resized the win partition, also kept the win recovery partition plus an existing 500mb FAT partition[edit: I created this FAT partition, sda3, on prompting from the Mint installer]) no Windows entry appeared in GRUB.
I had no need for Windows until now. In attempting to re-enable windows, I've tried to follow this tutorial, http://forums.linuxmint.com/viewtopic.php?f=42&t=163126 thinking it might be an EFI issue, to no avail. I even made a second lmde install (see sda9 in the bootinfo output below) following the instructions in the tutorial, but that didn't work either.

Also attempted to install rEFInd http://forums.linuxmint.com/viewtopic.php?f=46&t=97221, but windows still didn't come up.

The last thing I tried was to manually add a windows entry into grub, but it yields a "wrong EFI command" if memory serves right.

This is the output from bootinfo: http://paste2.org/6M3eC8kL

I've probably muddled things up quite a bit, any help in sorting them out will be much appreciated!

Some specific questions:
1- How do I know whether my system uses EFI? I do get a "run EFI command" in the BIOS boot menu.
2- I think this is EFI related, as I've never had this issue on other LMDE or other linux installs, but this is the first time I've installed onto a possibly EFI computer. Right?
3- From the bootinfo output:
- Is the bootsector info for sda3 (lines 28-30) relevant?
- Why is grub-efi not selected (line 809)?

Thanks
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
kc1di
Level 18
Level 18
Posts: 8178
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: enabling boot to windows

Post by kc1di »

Question # 1 can be answered by the following command in a terminal:

Code: Select all

dmesg | grep "EFI v"
it will return a line similar to this if it's uefi enabled.

Code: Select all

[ 0.000000] EFI v2.00 by American Megatrends
Good Luck
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
asper

Re: enabling boot to windows

Post by asper »

kc1di wrote:Question # 1 can be answered by the following command in a terminal:

Code: Select all

dmesg | grep "EFI v"
it will return a line similar to this if it's uefi enabled.

Code: Select all

[ 0.000000] EFI v2.00 by American Megatrends
Thanks!

My sda8 install reports nothing, my sda9 install reports EFI v2.1.

How do I find out about the windows install? Do I trust boot-info saying it is non-EFI?
In that case, how do I go about enabling booting to Windows?
User avatar
kc1di
Level 18
Level 18
Posts: 8178
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: enabling boot to windows

Post by kc1di »

have you tried boot repair yet?

you can find it here:
https://help.ubuntu.com/community/Boot-Repair

Follow the instructions carefully and it should find your windows install.
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
asper

Re: enabling boot to windows

Post by asper »

kc1di wrote:have you tried boot repair yet?
Thanks, I did. The bootinfo I mention in the OP is from Boot Repair.

It states it will do this

Code: Select all

The default repair of the Boot-Repair utility would reinstall the grub2 of disk/by-uuid/a63ef724-98b0-4aeb-970e-3064f3c61568 into the MBR of sda.
Grub-efi would not be selected by default because: no-win-efi
Additional repair would be performed: unhide-bootmenu-10s fix-windows-boot
But despite the additional fix-windows-boot repair it mentions, it did not fix the problem.

Further ideas?
User avatar
kc1di
Level 18
Level 18
Posts: 8178
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: enabling boot to windows

Post by kc1di »

from what you say it looks like you have one partition that is non UEFI and one that is. This will not work even if they are seperate disks.
both have to be the same. ethier efi enabled or both efi disabled. since your using widows 7 which does not really require efi I would install both systems in non efi mode. that should solve your problem.
Easy tips : https://easylinuxtipsproject.blogspot.com/ Pjotr's Great Linux projects page.
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608
asper

Re: [belated reply] Re: enabling boot to windows

Post by asper »

Thanks!

To make a long story short, I've found out the following:
1) there is no need for EFI on my computer. However, the Mint installation requires that I set up an EFI partition - I created sda3 as per that requirement. (I found this out when trying to reinstall from scratch)
2) upgrading to LMDE2 removed rEFInd (which I had installed thinking I was on an EFI system)
3) executing boot repair (from LMDE2 - I'm unsure whether that is relevant) with the "purge grub before installing" option ticked yielded the field below in grub.cfg . This boots into windows through the sda1 recovery partition. It would be great to have direct boot to sda2, but I can live with this.

Code: Select all

 ### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-689C048F9C045A48' {
	insmod part_msdos
	insmod ntfs
	set root='hd0,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  689C048F9C045A48
	else
	  search --no-floppy --fs-uuid --set=root 689C048F9C045A48
	fi
	parttool ${root} hidden-
	chainloader +1
}
Again, thanks for your help!
User avatar
Pierre
Level 21
Level 21
Posts: 13224
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: enabling boot to windows

Post by Pierre »

what happens - if you copied the entry for sda1 into a new entry, but for sda2 ?.
- and ran from that entry.
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
asper

Re: enabling boot to windows

Post by asper »

Pierre wrote:what happens - if you copied the entry for sda1 into a new entry, but for sda2 ?. - and ran from that entry.
Thanks! Doesn't work, though

It then complains there is no bootmgr

The altered entry :

Code: Select all

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-689C048F9C045A48' {
	insmod part_msdos
	insmod ntfs
	set root='hd0,msdos2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2  644806374806090E
	else
	  search --no-floppy --fs-uuid --set=root 644806374806090E
	fi
	parttool ${root} hidden-
	chainloader +1
}
srs5694
Level 6
Level 6
Posts: 1386
Joined: Mon Feb 27, 2012 1:42 pm

Re: enabling boot to windows

Post by srs5694 »

Here's my post-mortem:
  1. You had Windows installed on the computer in BIOS/CSM/legacy mode on an EFI-based computer. This configuration creates all sorts of potential for problems, as described here, and you ended up going down one of these problem paths. (The usual problem is the opposite in some ways -- Windows in EFI mode and an attempt to install Linux in BIOS mode. The principle is the same in your case, though.)
  2. When you installed Mint, it booted and installed in EFI mode. This is actually a little surprising, since most Linux installers enforce a GPT rule on EFI-mode installs, and your disk uses MBR. I guess Mint doesn't enforce this rule.
  3. The result was an EFI-mode GRUB, which cannot chainload to a BIOS-mode Windows, hence your problem.
Since you say you'd installed rEFInd, one solution at this point would have been to edit the /boot/efi/EFI/refind/refind.conf file: Uncomment the "scanfor" line and ensure that "hdbios" is among its options. This would enable rEFInd to chainload to the Windows boot loader on /dev/sda's MBR. This solution might still work, if you want to try re-installing rEFInd; however, given that you've re-installed a BIOS-mode GRUB, GRUB may now reside in the MBR, so this solution might just chainload to GRUB. You might still be able to get this approach to work if you can get into Windows or a Windows recovery tool and re-install the regular Windows boot loader to the MBR. IIRC, "bootrec /fixmbr" from a Windows Administrator Command Prompt window should do this, but I'm not an expert on this subject. Even if you get this approach working, it will be a strange setup: An EFI-mode boot of Linux from an MBR disk, with rEFInd chainloading to a BIOS-mode Windows. If you like strange and unusual, this is the way to go. If you want something more normal, go another way....

Another potential way to fix the problem is to create an appropriate GRUB stanza to boot Windows, and leave everything in BIOS/CSM/legacy mode. This is certainly the more conventional solution. Unfortunately, GRUB's configuration file format is pretty complex, and the main file is built by automated scripts that pull their data from all over the place, so manually fine-tuning may require editing multiple files. You might try installing GRUB Customizer, which is supposed to help simplify this task, or at least make it more intuitive. I've never used it myself, though, and so I can't give any real guidance on how to use it.

A third, and much more radical, solution is to switch from MBR to GPT and switch both Windows and Linux to boot in EFI mode. This is arguably the cleanest solution, but it's also the hardest to implement and poses the greatest risk. To do it, you'd use "gdisk" to convert the disk from MBR to GPT form (and change the type code of /dev/sda3 to EF00), then use rEFInd (on CD-R or USB drive) to boot Linux. At that point, you could either install rEFInd from PPA or Debian package or install the grub-efi-amd64 package. This should get Linux booting natively in EFI mode from a GPT disk. This leaves the Windows boot loader. The process for installing an EFI Windows boot loader is a bit tedious. There used to be a pretty good site describing how to do that, but it's vanished. Fortunately, it's been archived on the Internet Wayback Machine, so you can still read it. At this point, the system might boot straight to Windows, which you can correct by opening an Administrator Command Prompt window and typing "bcdedit /set {bootmgr} path \EFI\refind\refind_x64.efi". This should reset rEFInd as the default boot loader. (Substitute "\EFI\ubuntu\grubx64.efi" if you install GRUB rather than rEFInd.)
Locked

Return to “LMDE Archive”