Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Changing the default boot partition (solved)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
<3
Veteran
Veteran


Joined: 21 Oct 2004
Posts: 1081

PostPosted: Tue May 16, 2017 10:57 am    Post subject: Changing the default boot partition (solved) Reply with quote

I have a dual boot Gentoo Linux & Windows 7 computer. As some of you may know, recently Microsoft has required that some critical updates for Windows to check that the windows partition is the default boot partition before installing, if that partition is not the default partition the critical update will not install and your computer will reboot with an error message and will then start automatically uninstalling. That means in order to install these patches I need to set the windows partition and the boot partition. I have tried to do this using the KDE partition Manager (KDE frontend for parted) [I disabled the boot flag on the grub2 partition and enabled it on the Windows partition]. For some reason my computer still boots to GRUB instead of directly to Windows. Can someone please tell me how to set my Windows partition to be the default partition? Also I need to revert thing thing back to the way they were after these Windows updates are installed so that grub2 is boot manager after I'm finished.

Last edited by <3 on Sun Jul 09, 2017 11:15 pm; edited 3 times in total
Back to top
View user's profile Send private message
BonezTheGoon
Bodhisattva
Bodhisattva


Joined: 14 Jun 2002
Posts: 1408
Location: Albuquerque, NM -- birthplace of Microsoft and Gentoo

PostPosted: Tue May 16, 2017 1:46 pm    Post subject: Reply with quote

Going to need some more details. Specifically are these both on the same disk? If not then physically disconnect your Gentoo disk during the process and then reconnect it when done.

If they are on the same disk please provide partition layout details.
_________________
mcgruff wrote:
I can't promise to be civil.


pjp wrote:
The greater evil is voting for the "lesser evil."
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10589
Location: Somewhere over Atlanta, Georgia

PostPosted: Tue May 16, 2017 5:16 pm    Post subject: Reply with quote

Moved from Off the Wall to Other Things Gentoo as it really is a Gentoo-related technical support question and I think it warrants a larger technical audience than OTW provides.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
<3
Veteran
Veteran


Joined: 21 Oct 2004
Posts: 1081

PostPosted: Tue May 16, 2017 7:08 pm    Post subject: Reply with quote

Both OSes are on the same drive I will post partition information when I get back on that computer.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Tue May 16, 2017 7:24 pm    Post subject: Reply with quote

You have to figure out what is "Windows default boot partition" for Windows. Not really a Linux or Gentoo question at all.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3137

PostPosted: Tue May 16, 2017 7:39 pm    Post subject: Reply with quote

Doesn't windows install its bootloader directly in MBR?
Deactivate all partitions and bios will go for MBR.
And actually... What partition table do you use? MBR or GPT?
Do you use a proper tool for your partition table? Like in, tools that are good with mbr-style do not necessarily even support GPT, and GPT tools don't have to be particularly good at manipulating MBR (though they _should_ fail safe...)
It's good habit to provide some basic information about your setup in advance, perhaps someone will know what to do next, even though this problem doesn't really fit this forum.
Back to top
View user's profile Send private message
jonathan183
Guru
Guru


Joined: 13 Dec 2011
Posts: 318

PostPosted: Tue May 16, 2017 8:31 pm    Post subject: Re: Changing the default boot partition Reply with quote

<3 wrote:
Can someone please tell me how to set my Windows partition to be the default partition? Also I need to revert thing back to the way they were after these Windows updates are installed.

When I used system with dual/multi-boot on mbr I used the supergrub disc to fix Windows or Linux boot. I have used dd in the past to write mbr but supergrub was less prone to user error.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Wed May 17, 2017 6:11 am    Post subject: Re: Changing the default boot partition Reply with quote

<3 wrote:
Can someone please tell me how to set my Windows partition to be the default partition?
Do you use UEFI boot or Legacy boot?

EDIT:
In case of UEFI, this article might help.
Back to top
View user's profile Send private message
<3
Veteran
Veteran


Joined: 21 Oct 2004
Posts: 1081

PostPosted: Wed May 17, 2017 11:27 pm    Post subject: Reply with quote

szatox wrote:
Doesn't windows install its bootloader directly in MBR?
Deactivate all partitions and bios will go for MBR.
And actually... What partition table do you use? MBR or GPT?
Do you use a proper tool for your partition table? Like in, tools that are good with mbr-style do not necessarily even support GPT, and GPT tools don't have to be particularly good at manipulating MBR (though they _should_ fail safe...)
It's good habit to provide some basic information about your setup in advance, perhaps someone will know what to do next, even though this problem doesn't really fit this forum.


I don't understand what you are saying. What information would you need? I am using MBR and this is an older computer that does not use UEFI it has a BIOS, what other information do you need? What are these MBR-tools you speak of? I am just using the KDE Partition editor program which is basically a front end to parted.
Back to top
View user's profile Send private message
<3
Veteran
Veteran


Joined: 21 Oct 2004
Posts: 1081

PostPosted: Wed May 17, 2017 11:33 pm    Post subject: Reply with quote

here is the fdisk printout of the partitions on the hard drive I am using.
Code:
Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            2048 409602047 409600000 195.3G  7 HPFS/NTFS/exFAT
/dev/sda2       409602048 511848447 102246400  48.8G  7 HPFS/NTFS/exFAT
/dev/sda3  *    511848448 512053247    204800   100M 83 Linux
/dev/sda4       512053248 937701375 425648128   203G  5 Extended
/dev/sda5       512055296 536631295  24576000  11.7G 82 Linux swap / Solaris
/dev/sda6       536633344 937701375 401068032 191.3G 83 Linux


Windows is installed on sda1 and Grub is on sda3 gentoo is on sd6
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Thu May 18, 2017 10:08 pm    Post subject: Reply with quote

the short boot flag option explains
when your computer boot, the bios look at disk mbr to load the bootloader
the first one found is run. bios work end there.

if no bootloader is found, bios then look for first partition with bootflag enable and then try kick the bootloader from that partition. if none is found result depend on bios, it vary from just staying stuck to a message or offer to reboot...

anyway, windows bootloader is set on a partition
grub could be set on partition, but also in the disk mbr

if you set grub in the disk mbr, then bios run grub, and story end, bios is done, no bootflag is use.
if you set windows partition with the bootflag, but grub is in mbr, the bootflag is of no use for the bios
bios start grub, and default partition to boot depend on grub.

if your windows update really stupidly need it, just set bootflag over its partition so it will be happy, for bios it won't change a thing, it will found grub in mbr and run it
for grub it won't change a thing, grub don't care about bootflag, the bootflag for grub is 'root' (the grub command, not / the partition)
set bootflag to partition sda2, windows use a small partition now so it must that one.

nothing will change for you, and your windows update will be happy (if you correctly assume it just need the bootflag set)
Back to top
View user's profile Send private message
<3
Veteran
Veteran


Joined: 21 Oct 2004
Posts: 1081

PostPosted: Sat May 20, 2017 1:12 am    Post subject: Reply with quote

I am sorry krinn, I don't mean to be rude but I don't understand what you said.
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Sat May 20, 2017 1:49 am    Post subject: Reply with quote

Don't know if it works for win 7 because there is considerable change, but for XP, I let windows do it's thing, then install grub (legacy, maybe it won't work for grub 2) in the boot partition, not the mbr. Then dd is used to create a boot.lnx file. The Windows boot menu is editted to boot from that file as a choice. Windows had provided that avenue to allow dual booting with Win 98. It's a Windows method so Windows won't object.

That "security feature" is probably checking the mbr and thinks that grub is a rootkit.


I'll post details if someone can confirm that this works with win 7. I don't want to give instructions that will trash your computer.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sat May 20, 2017 11:35 am    Post subject: Reply with quote

<3 wrote:
I am sorry krinn, I don't mean to be rude but I don't understand what you said.

It's not rude, i'm not english native speaker don't worry ;)
Back to top
View user's profile Send private message
<3
Veteran
Veteran


Joined: 21 Oct 2004
Posts: 1081

PostPosted: Sat May 20, 2017 9:01 pm    Post subject: Reply with quote

yes, that is what I thought. Some people could take what I said as being rude. So anyways how do I make the windows boot manager the default?
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Sat May 20, 2017 10:34 pm    Post subject: Reply with quote

sda3 should not have the bootflag on. sda1 should.

This is because grub doesn't care about bootflags but windows does. You can change the bootflag with gparted. Select the sda1 partition and in the menu, click "manage flags". The rest is obvious.

You still may have to change the MBR, but first see if the boot flag satisfies Windows.
Back to top
View user's profile Send private message
<3
Veteran
Veteran


Joined: 21 Oct 2004
Posts: 1081

PostPosted: Sun May 21, 2017 2:24 am    Post subject: Reply with quote

Yes when I had set sda1 as bootable grub still booted. How do I change the mbr
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Sun May 21, 2017 3:02 am    Post subject: Reply with quote

You would have to boot into windows and have it reinstall its boot loader. This will nuke grub.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
jonathan183
Guru
Guru


Joined: 13 Dec 2011
Posts: 318

PostPosted: Sun May 21, 2017 10:49 am    Post subject: Reply with quote

The Doctor wrote:
You would have to boot into windows and have it reinstall its boot loader. This will nuke grub.

supergrub or supergrub2 ... used supergrub a lot in the past, not so much now as I have mainly uefi systems and only Windows 7 or later running on bare metal.

You can play with
Code:
dd if=/dev/sda of=/any_old_file_system/backup_of_mbr_bootloader_code bs=446 count=1
but supergrub is less prone to user error and would fix either boot from the one cd ... ymmv
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Sun May 21, 2017 11:52 am    Post subject: Reply with quote

Apparently, win 7 uses the same boot procedure as XP. Micro$oft just made it more hidden. In XP you can edit the file, boot.ini, with any text editor. Win 7 requires a more complex procedure. For one thing, they seem to have renamed boot.ini. You can google for "boot linux from windows 7 bootloader". Most responses recommend using a freeware tool called EasyBCD. I have never used this so I hesitate to recommend that you download and run it.

For XP and Win2000, you install grub into a partition rather than the MBR. Then you make a copy of the first 512 bytes using dd.
Code:
dd if=/dev/sda5 of=bootsect.lnx  bs=512 count=1
Assuming that you installed grub on /dev/sda5.

You put the file boot.lnx on a fat or ntfs USB stick (old days floppy disk) and copy it to the C: partition.
Then you edit boot.ini (notepad would do) to read, as a real example.
Code:
[boot loader]
timeout=30
default=C:\BOOTSECT.LNX
[operating systems]
C:\BOOTSECT.LNX="Gentoo Linux"
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /usepmtimer /pae /NoExecute=OptIn
C:\32bitprt.lnx="32 bit Linux"
That last line is a third boot partition image. You don't need it unless you are booting 32 bit linux.
Each line after [Operating systems] is a boot choice, either a boot partition image or some crazy windows thing. The weird line was already there from Windows installation. I changed the default to boot linux. You could leave the default as windows. The timeout line is in seconds. You will note that I have slow reactions.

That's it (for XP / 2000). Win 7 appears similar but more hidden. One google hit says you have to use UUID. I don't know. I've never done it. Apparently the EasyBCD tool is easy, but I've never used it. The general procedure is the same: Install grub on a partition, not mbr. Make a partition image with dd. Install the image as a choice in boot.ini or it's successor.

Hopefully, someone who has done this for win 7/8/10 will answer you as well.

Whatever you do, make sure you understand what you are doing before you do it.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21635

PostPosted: Sun May 21, 2017 3:27 pm    Post subject: Reply with quote

Starting in Windows Vista, and presumably applying to all newer systems, you can use the command line tool bcdedit to manipulate the Windows boot configuration. If I recall correctly, this tool is shipped by Microsoft as part of the base system. It may not be as nice as other editors, but it will let you make the required changes without installing add-on software.
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Sun May 21, 2017 3:53 pm    Post subject: Reply with quote

Thank you, Hu. I have win 7 on one computer but do very little with it. Of the "new technology" Windows versions, I preferred win 2000. After that point, a concerted effort was made to hide the fact that it is an OS running on a computer, not just an "app platform".

Apparently, from reviews, this EasyBCD is easier to use than the raw Windows interface. I preferred just running notepad on C:\boot.ini, but Microsoft doesn't like it to be easy. they want it to be hard so that the user will unquestioningly accept whatever they say.

There is some controversy about this thread in "Report violations ...", but I think that the more we know, the better. The OP has reported what seems to me to be an effort by Micro$oft to keep everything but Window$ off of computers and we have to fight back by helping newbies to ease into Linux. Besides, not everything will run on Linux and Wine seems to be regressing except for games.
Back to top
View user's profile Send private message
<3
Veteran
Veteran


Joined: 21 Oct 2004
Posts: 1081

PostPosted: Sun May 21, 2017 6:32 pm    Post subject: Reply with quote

Really? someone reported this thread to the mods?
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sun May 21, 2017 8:24 pm    Post subject: Reply with quote

reporting a thread doesn't mean anyone wants your death
and as the report is about "user is speaking about a windows problem", and your issue is to fix your windows update, it's somehow logical someone ask it move as all windows support threads.
you shouldn't be scared about the report, but you should be scared your thread end in OTW :)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54244
Location: 56N 3W

PostPosted: Sun May 21, 2017 8:31 pm    Post subject: Reply with quote

This tread started off in OTW.

Several mods/admins have contributed to it and its still in Other Things Gentoo.
Read into that what you will.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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