Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Win 8.1 Uefi mode autmtcly changing BO order ? [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
spidark
n00b
n00b


Joined: 01 Sep 2011
Posts: 16

PostPosted: Tue Jan 07, 2014 8:08 pm    Post subject: Win 8.1 Uefi mode autmtcly changing BO order ? [SOLVED] Reply with quote

Hello to all,
It has been a while for me using Gentoo, but i decided to give it another try, with my i7 machine, just to get that edge of speed i need for Blender,Gimp and all of that cool CG stuff.
I know i Know ......Gentoo is not about speed!! :wink:
First of all let me apologize for the grammatical errors in my English Lingo,
My new pc has a Uefi BIOS and supports legacy mode booting.
I switch to Windows to use a popular CG software, known to many.
And i kick ass at Fifa14 :lol: ,making those young lads quit the game :D
Ok 8O Intro to long.. i know.

After much eye bleeding research, reading on the net, i manage to install Windows 8.1 and Gentoo Linux side by side in EUFI mode.
My Gentoo resides on a ssd drive which is the first drive /dev/sda
And my Windows 8.1 on /dev/sdb

I managed to get GRUB2 dual booting both OS
Fisrt I installed Gentoo on /dev/sda
Got the UEFI thing working
And second created a UEFI usb with an WIN_8.1 X64.iso file
Installed it on /dev/sdb
rebooted , and grub was gone with the wind.
Chrooted back into Gentoo i ran the grub-install command to /dev/sda and grub was back.
Funny thing after that reboot, my windows 8.1 boot manager entry vanished from my EUFI boot menu.
So i had to get back on the eye bleeding thing
Tweaked something from Arch combined with Gentoo site and walla , i could boot windows 8.1 true GRUB2, which is what i want.
I do not want to pres F11 each time the system boots to access the EUFI boot menu to choose Gentoo.
I want Gentoo to be the first OS to boot.
So i dropped into my BIOS and change the boot order setting ,spotlighted Gentoo.

But here is the thing, if is choose Windows from the GRUB menu and reboot out of Windows, my lcd lights up with those blue Windows... no GRUB-menu, im back to Windows starting as the main OS :roll:
So Windows has the power to rearrange my boot order settings in my BIOS ?? 8O
or is this a standard thing i know nothing about ??

I did a probe to get the UUID on the file that appeared after installing windows 8 which resides in /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi

Code:

grub2-probe --target=fs_uuid /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi


Funny Probing this file gives me a different UUID than probing the bootmgfw.efi file on the Windows disk itself.
What puzzles me is that this file was created after installing Windows 8, who put it there ???

Forgive me if this is a repost topic.
But anybody has any experience with this ?
Hope some one can point me in the right direction.

My /etc/grub.d/40_custom config

Code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
#menuentry "Windows 8 UEFI/GPT"
#{
#insmod part_gpt
#insmod search_fs_uuid
#insmod chain
#search --fs-uuid --no-floppy --set{{=}}root 28cf-35de
#chainloader ($root)/EFI/MICROSOFT/BOOT/bootmgfw.efi
#}
if [ "${grub_platform}" == "efi" ]; then
        menuentry "Microsoft Windows 8 x86_64 UEFI-GPT" {
                insmod part_gpt
                insmod fat
                insmod search_fs_uuid
                insmod chain
                search --fs-uuid --set root $hints_string  2C51-E570
                chainloader /EFI/Microsoft/Boot/bootmgfw.efi
                #chainloader /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi
        }
fi


My /etc/default/grub config
Code:
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.4 2013/09/21 18:10:55 floppym Exp $
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub2-mkconfig -o /boot/grub/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DISTRIBUTOR="Gentoo"

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10

# Append parameters to the linux kernel command line
# GRUB_CMDLINE_LINUX=""

# Append parameters to the linux kernel command line for non-recovery entries
GRUB_CMDLINE_LINUX_DEFAULT="quiet"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal.
# Note that you can use only modes which your graphic card supports via VBE.
# You can see them in real GRUB with the command `vbeinfo'.
GRUB_GFXMODE=1024x768

# Path to theme spec txt file.
# The starfield is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
GRUB_THEME="/boot/grub/themes/starfield/theme.txt"

# Background image used on graphical terminal.
# Can be in various bitmap formats.
#GRUB_BACKGROUND="/boot/grub/mybackground.png"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY=true
/etc/default/grub lines 1-46/46 (END)



My board is a Asrock B-75
Thanks in advance.


Last edited by spidark on Wed Jan 08, 2014 10:14 pm; edited 2 times in total
Back to top
View user's profile Send private message
WorBlux
n00b
n00b


Joined: 07 May 2011
Posts: 35

PostPosted: Tue Jan 07, 2014 9:44 pm    Post subject: Reply with quote

what does efibootmgr tell you about the menu entries?


I remember reading that some bioses look for bootmgfw.efi by name.

Just for kicks and giggles I would try the following

Rename it to something else and rename grub.efi to bootmgfw.efi

update the entries appropriates with efibootmgr.

http://www.zdnet.com/my-experiments-with-multi-boot-selection-with-uefi-boot-manager-7000013627/


You probably also want to make sure to install an efi shell just in case
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 6254
Location: Goose Creek SC

PostPosted: Tue Jan 07, 2014 11:56 pm    Post subject: Reply with quote

in windows8 administator command window, run
Code:
powercfg /h off

alternatively, if that fails,:
http://wiki.gentoo.org/wiki/UEFI_Dual_boot_with_Windows_7/8 works;
swap drive connectors so windows drive becomes sda, gentoo sdb, install rEFInd per the wiki on the windows ESP, use efi stub kernel, no need for grubs or lilo
_________________
Defund the FCC.
Back to top
View user's profile Send private message
spidark
n00b
n00b


Joined: 01 Sep 2011
Posts: 16

PostPosted: Wed Jan 08, 2014 12:03 am    Post subject: Reply with quote

WorBlux wrote:
what does efibootmgr tell you about the menu entries?


I remember reading that some bioses look for bootmgfw.efi by name.

Just for kicks and giggles I would try the following

Rename it to something else and rename grub.efi to bootmgfw.efi

update the entries appropriates with efibootmgr.

http://www.zdnet.com/my-experiments-with-multi-boot-selection-with-uefi-boot-manager-7000013627/


You probably also want to make sure to install an efi shell just in case


Hi WorBlux
Thanks for your Reply, been doing some testing
renaming the file does not work yet,
im having issues with efibootmgr adding new entry, need to read more on how UEFI works, directory structure , file location etc etc.
I lost my Gentoo entry messing around in my UEFI shell v2.
I know now when you enter the command
Code:
bcfg boot dump

you get a list of the entries, to delete a entry
Code:
 bcfg boot rm (entry)
works, but after this command you need to retype the dump command, because it works like a stack.
Also if i issue the command
Code:
efibootmgr -c -d /dev/sda( or 1 2) -p 1 -L "TESTME3" -l "\EFI\TESTME\grubx64.efi"
does not give the expected result.
The entry is added, but still boots to Windows 8.
Renaming the file to bootmgfw.efi still nogo.
I read the article and i wil let you know 2morrow if i succeeded or not
For now im going to dreamland.
Thanks anyway.

My efibootmgr output
Code:
gen2desk14t ~ # efibootmgr
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0005,0004,0003,0002,0000,0010,0011,000D,000E,000F
Boot0000* gentoo
Boot0002* GENTOO_LINUX_TEST15
Boot0003* TESTME
Boot0004* TESTME2
Boot0005* TESTME3
Boot000D* Hard Drive
Boot000E* CD/DVD Drive
Boot000F* USB
Boot0010* UEFI: USB 2.0 USB Flash Drive 0.00
Boot0011* UEFI: Philips USB Flash Drive PMAP


My efibootmgr -v output

Code:
gen2desk14t ~ # efibootmgr -v
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0005,0004,0003,0002,0000,0010,0011,000D,000E,000F
Boot0000* gentoo   HD(2,1800,64000,d278e60f-6f8a-4a48-aa0c-ba38f0498d48)File(\EFI\gentoo\grubx64.efi)
Boot0002* GENTOO_LINUX_TEST15   HD(1,0,0,00000000)File(\EFI\gentoo\grubx64.efi)
Boot0003* TESTME   HD(1,800,1000,00173940-2a71-49e8-868d-c7b778a0d5c4)File(\EFI\TESTME\grubx64.efi)
Boot0004* TESTME2   HD(1,0,0,00000000)File(\EFI\TESTME\grubx64.efi)
Boot0005* TESTME3   HD(1,0,0,748d0801)File(\EFI\TESTME\grubx64.efi)
Boot000D* Hard Drive    BIOS(2,0,00)AMGOAMNO........o.L.I.T.E.O.N.I.T. .L.C.T.-.1.2.8.M.3.S....................A...........................>..Gd-.;.A..MQ..L.W.T.K.0.1.1.F.M.5.5.8.0.2.5.P.4.7.4.1.1......AMBOAMNO........o.S.T.3.2.5.0.3.1.0.C.S....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .R.6.9.Y.8.C.V.L......AMBOAMNO........o.S.T.3.2.5.0.3.1.0.C.S....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .R.6.9.Y.9.6.8.4......AMBOAMNO........o.S.T.3.2.5.0.8.2.0.S.C.E....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .Q.9.6.E.Y.T.7.S......AMBO
Boot000E* CD/DVD Drive    BIOS(3,0,00)AMGOAMNO........o.H.L.-.D.T.-.S.T.D.V.D.+.-.R.W. .G.S.A.-.H.3.1.L....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . . . . . . . . . ......AMBO
Boot000F* USB    BIOS(5,0,00)AMGOAMNO..........U.S.B. .2...0. .U.S.B. .F.l.a.s.h. .D.r.i.v.e. .0...0.0....................A.............................N..Gd-.;.A..MQ..L.U.S.B. .2...0. .U.S.B. .F.l.a.s.h. .D.r.i.v.e. .0...0.0......AMBOAMNO..........P.h.i.l.i.p.s. .U.S.B. .F.l.a.s.h. .D.r.i.v.e. .P.M.A.P....................A.............................N..Gd-.;.A..MQ..L.P.h.i.l.i.p.s. .U.S.B. .F.l.a.s.h. .D.r.i.v.e. .P.M.A.P......AMBO
Boot0010* UEFI: USB 2.0 USB Flash Drive 0.00   ACPI(a0341d0,0)PCI(1a,0)USB(1,0)USB(2,0)HD(1,149d0,f800,0d738582)AMBO
Boot0011* UEFI: Philips USB Flash Drive PMAP   ACPI(a0341d0,0)PCI(1a,0)USB(1,0)USB(3,0)HD(1,ac,2750,5513338d)AMBO
gen2desk14t ~ #
Back to top
View user's profile Send private message
spidark
n00b
n00b


Joined: 01 Sep 2011
Posts: 16

PostPosted: Wed Jan 08, 2014 8:41 pm    Post subject: Reply with quote

Hello WorBlux and DONAHUE,

Microsoft is smarter than i thought. :lol:
I haven't tried rEFInd and the other command in Windows yet, don't think im going into it yet.
My Partial Solution just works for me and i can live with it.

What i did was.

recompile my kernel , created a kernel with EFi stub support.
added it with efibootmgr
Code:
efibootmgr -c -d /dev/sda -p 2 -L "Gentoo_stub" -l "\EFI\gentoo_stub_boot\gentoo_stub.efi"


i also added WIN8 (or WIN7 whatever)
Code:
efibootmgr -c -d /dev/sda -p 2 -L "WIN8" -l "\EFI\Microsoft\Boot\bootmgfw.efi"


It maybe overkill ,because i also have GRUB2 installed ,so also added it to the party
Code:
efibootmgr -c -d /dev/sda -p 2 -L "Grub_Gentoo_Loader" -l "\EFI\gentoo\bootmgfw.efi"


Now i have a boot party 8)
Booting into Windows wil still change the boot-order ,hence the name change in the Grub_Gentoo_Loader's efi file.
Changing the Grub filename to bootmgfw.efi, does not stop Windows or My Uefi Bios from reordering things.
Its like Windows, or my Bios/UEFI, is checking these files for a signature or something, because it places the WIN8 entry right after its own Windows Boot Manager entry.

Ok, i only visit Windows once in a while for a good Fifa14 adventure ,and to do some cool stuff in that CG program everyone knows.
(Yes i know all about Gimp :wink: )

When im done messing around in Windows, i have to drop into my bios ,to UEFI setup/boot.
I then choose the Gentoo_stub,boot into Gentoo, pop open a Terminal, root myself,do a
Code:
efibootmgr -v

output
Code:
gen2desk14t ~ # efibootmgr -v
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0000,0006,0005,0002,000D,000E
Boot0000* Windows Boot Manager   HD(2,1800,64000,d278e60f-6f8a-4a48-aa0c-ba38f0498d48)File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...d................
Boot0002* WIN8   HD(2,1800,64000,d278e60f-6f8a-4a48-aa0c-ba38f0498d48)File(\EFI\Microsoft\Boot\bootmgfw.efi)
Boot0005* Grub_Gentoo_Loader   HD(2,1800,64000,d278e60f-6f8a-4a48-aa0c-ba38f0498d48)File(\EFI\gentoo\bootmgfw.efi)
Boot0006* Gentoo_stub   HD(2,1800,64000,d278e60f-6f8a-4a48-aa0c-ba38f0498d48)File(\EFI\gentoo_stub_boot\gentoo_stub.efi)
Boot000D* Hard Drive    BIOS(2,0,00)AMGOAMNO........o.L.I.T.E.O.N.I.T. .L.C.T.-.1.2.8.M.3.S....................A...........................>..Gd-.;.A..MQ..L.W.T.K.0.1.1.F.M.5.5.8.0.2.5.P.4.7.4.1.1......AMBOAMNO........o.S.T.3.2.5.0.3.1.0.C.S....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .R.6.9.Y.8.C.V.L......AMBOAMNO........o.S.T.3.2.5.0.3.1.0.C.S....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .R.6.9.Y.9.6.8.4......AMBOAMNO........o.S.T.3.2.5.0.8.2.0.S.C.E....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .Q.9.6.E.Y.T.7.S......AMBO
Boot000E* CD/DV


Windows Boot Manager wil always be 0000 on my Machine.
And my own entry WIN8, always as second, thats why i think there a spy in my Bios, maybe Bond he :D ,007 is checking for a signature, because the Grub_Gentoo_Boot file has the same name as that from Windows, but still the WIN8 entry file, gets second place :?
Maybe its related to my machine, who knows.

What i do next is delete the Windows Boot Manager entry
Code:
efibootmgr -B -b 0000


Run a check to be sure.
Code:
efibootmgr -v


Code:
gen2desk14t ~ # efibootmgr -v
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0006,0005,0002,000D,000E
Boot0002* WIN8   HD(2,1800,64000,d278e60f-6f8a-4a48-aa0c-ba38f0498d48)File(\EFI\Microsoft\Boot\bootmgfw.efi)
Boot0005* Grub_Gentoo_Loader   HD(2,1800,64000,d278e60f-6f8a-4a48-aa0c-ba38f0498d48)File(\EFI\gentoo\bootmgfw.efi)
Boot0006* Gentoo_stub   HD(2,1800,64000,d278e60f-6f8a-4a48-aa0c-ba38f0498d48)File(\EFI\gentoo_stub_boot\gentoo_stub.efi)
Boot000D* Hard Drive    BIOS(2,0,00)AMGOAMNO........o.L.I.T.E.O.N.I.T. .L.C.T.-.1.2.8.M.3.S....................A...........................>..Gd-.;.A..MQ..L.W.T.K.0.1.1.F.M.5.5.8.0.2.5.P.4.7.4.1.1......AMBOAMNO........o.S.T.3.2.5.0.3.1.0.C.S....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .R.6.9.Y.8.C.V.L......AMBOAMNO........o.S.T.3.2.5.0.3.1.0.C.S....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .R.6.9.Y.9.6.8.4......AMBOAMNO........o.S.T.3.2.5.0.8.2.0.S.C.E....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .Q.9.6.E.Y.T.7.S......AMBO
Boot000E* CD/DVD Drive    BIOS(3,0,00)AMGOAMNO........o.H.L.-.D.T.-.S.T.D.V.D.+.-.R.W. .G.S.A.-.H.3.1.L....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . . . . . . . . . ......AMBO
gen2desk14t ~ #


After my check with efibootmgr -v ,i can see that my boot order has changed, the one i want is 0006 ,its number 1 now :lol:


If not ,i can always do a efibootmgr -o order1,order2,etc
It is what it is,and i am at peace with this workaround.


Thank you for your Help.

ps Should i mark this post as SOLVED, and how can i do that :oops:


Last edited by spidark on Wed Jan 08, 2014 10:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 6254
Location: Goose Creek SC

PostPosted: Wed Jan 08, 2014 9:56 pm    Post subject: Reply with quote

edit title of your original post
_________________
Defund the FCC.


Last edited by DONAHUE on Wed Jan 08, 2014 11:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
spidark
n00b
n00b


Joined: 01 Sep 2011
Posts: 16

PostPosted: Wed Jan 08, 2014 10:09 pm    Post subject: Reply with quote

DONAHUE wrote:
edit tite of your original post

Ok Thanks.
Back to top
View user's profile Send private message
WorBlux
n00b
n00b


Joined: 07 May 2011
Posts: 35

PostPosted: Thu Jan 09, 2014 9:07 pm    Post subject: Reply with quote

spidark wrote:

Microsoft is smarter than i thought. :lol:


Proprietary firmware generally sucks. They aren't going to correct implementation, but the least level of effort that works. Stuff made for OEM's even worse they probabaly wanted something they should stick a pre-imaged disk into and have it self-configure. The feature kind of makes sense but why don't they have an off switch in the firmware setup (auto-bootorder-configure [ON OFF])?

Although I was wondering weather or not you actually had two ESP partitions (one on each disk) that was messing things up. But you seem to have proven that's not the case, or if it is the case, it's not the problem.

You could drop a script into /etc/local.d to check to see if the boot entry is there on boot and delete it.

Or even better find a windows tool to script that hooks into the shutdown process.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 6254
Location: Goose Creek SC

PostPosted: Thu Jan 09, 2014 10:52 pm    Post subject: Reply with quote

Actually, running
Code:
powercfg /h off
in the windows8 administator command window unhooks microsoft's boot rewriter from the shutdown process. Some folks bypass the evil empire by using the reset button.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
spidark
n00b
n00b


Joined: 01 Sep 2011
Posts: 16

PostPosted: Fri Jan 10, 2014 7:16 am    Post subject: Reply with quote

WorBlux wrote:
spidark wrote:

Microsoft is smarter than i thought. :lol:


Proprietary firmware generally sucks. They aren't going to correct implementation, but the least level of effort that works. Stuff made for OEM's even worse they probabaly wanted something they should stick a pre-imaged disk into and have it self-configure. The feature kind of makes sense but why don't they have an off switch in the firmware setup (auto-bootorder-configure [ON OFF])?

Although I was wondering weather or not you actually had two ESP partitions (one on each disk) that was messing things up. But you seem to have proven that's not the case, or if it is the case, it's not the problem.

You could drop a script into /etc/local.d to check to see if the boot entry is there on boot and delete it.

Or even better find a windows tool to script that hooks into the shutdown process.



Hi WorBlux, and DONAHUE,i am guessing that i have 2 ESP partitions on separate disks,one that i created myself, and the other... wel MS creates this one automatically.
So its kinda confusing.
I first installed Gentoo, and then Windows, but when i install Windows i don't think there a choice, not to let windows create this special boot partition.
So im guessing that i indeed have two ESP partitions.
Im not a Windows guru nor am i a Linux guru,but maybe i could try to delete the MS ESP boot partition to see what happens :lol: , im guessing no boot,
I have 4 disks, First Disk Gentoo runs on sharing home on the first Partition of disk2.
Windows is going to be installed on the second partition of disk2
The rest are Data stuff.
But this weekend im going to install Windows again and try DONAHUE suggestion
Code:
 powercfg /h off

I however did noted that , if i restore my boot order to boot Gentoo first, and then boot Windows and as windows is loading (about 2 seconds) , if i press the reset button to stop Windows from loading, my Boot order keep as is, but if boot back into Windows it will inform me that my system was not shutdown correctly as usual, so it starts a recovery process.If i break this process in about 2 seconds or so, Boot order keeps as is, if i don't , Windows rearranges the boot order.

But ill give the
Code:
powercfg /h off
a try.
Thanks again.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum