LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Dual Boot linux/7 saving win7 loader? (https://www.linuxquestions.org/questions/linux-newbie-8/dual-boot-linux-7-saving-win7-loader-821560/)

tetractis 07-22-2010 03:45 PM

Dual Boot linux/7 saving win7 loader?
 
Hi all,
I need to install linux (with Grub) un a disk with windows 7 loader (i have 2x choice on that loader and i need to use it).

I tried to dig to find out some methods but nothing.

It's safe?
It's better to install Grub on another partition - same physical disk?

Thanks a lot in advance.

Tetra

saikee 07-22-2010 03:54 PM

You can install Linux to any partition. Instruct the installer to put its boot loader into the root partition, hence not overwriting Win7's MBR.

You can then use bootmgr to boot Linux. Explanation and steps are here.

Personally I don't think it matters because

(1) You can always restore Win7's MBR using any Vista/Win7 installation DVD by command in Command Prompt
Code:

bootrec /fixmbr
(2) Win7 can be booted without its MBR so use Grub is fine.

(3) Using bootmgr is about 2 to 3 times more work than using Grub to dual boot. If you install the Linux now it will dual boot for you automatically without lifting a finger.

You can use Grub in its Linux partition. Putting Grub on its own is an alternative and useful if you boot several systems and experimenting with it.

I have a Dos partition with Grub, NTLDR and bootmgr inside booting one Dos, 4 MS Windows and 30+ linux. Putting Grub on its own partition is more fun but not necessary.

tetractis 07-22-2010 04:08 PM

Thanks for the prompt answer.

As mentioned above i have the windows 7 loader with "two" choices that i need to maintain and not only one as the 99.9% of windows users :)
Do you think possible, installing grub on the root partition (different from the win boot partition of course) manage to have windows starting offering its proprietary loader?

like: poweron -> grub -> windows -> boot loader choices of windows ??

Tetra

saikee 07-22-2010 04:33 PM

When you install a Linux. It has a boot loader of either Grub1, Grub2 or Lilo. The Linux boot loader always resides inside the /boot directory of the Linux partition but may or may not take control of the partition's boot sector. If you put Linux boot loader inside its root partition (this got nothing to do with Win7 partition which also has a \boot directory) then that Linux can be booted by another operating system. Therefore you can configure Win7's bootmgr.exe to boot Linux. If you elect to put the boot loader in the MBR the boot sector of the Linux partition will be empty.

If you choose Linux's boot loader into the MBR all the damage it will do to Win7 is to overwrite the MBR, which is the first 512 bytes of the hard disk, thereby Linux can it to fire up itself.

It is an "obligation" for every Linux installer to check every partition's boot sector for a boot loader and include it as a booting choice if one is found. MS Windows always put a booting code in the boot sector so that is why every Linux installer will dual boot MS Windows on completion of an installation.

Win7's booting code in the boot sector can also be generated by its installation DVD by the command
Code:

bootsect /nt60 c:
Thus you are pretty safe as every part of Win7 boot loader can be restored with just its installation DVD.

Basically after a Linux has been installed and you elect putting Grub in the MBR the sequence is exactly like you have predicted but I expand it further.

The Bios loads the MBR and so fire up Grub. Grub always has two parts Stage1 is exactly 512 bytes long. Stage2 is inside /boot/grub directory and linked to stage1 by its hard disk address.

If you select Win7 to be booted in the Grub menu then Grub will load the boot sector code of the Win7 partition. That boot sector code will search Win7 partition and load only the bootmgr.exe. It is the bootmgr.exe that displays the Win7 booting choices (also called BCD). From then on you go back to what you were before the Linux installation with whatever booting choices available in Win7.

Linux installation never touch anything inside the Win7 partition. The MBR is not even a part of Win7 partition either. It is a stand alone entity of the hard disk.

tetractis 07-22-2010 05:18 PM

Thank you a lot, saikee!
Your explanation was illuminating :)

i'll experimenting tomorrow morning.
Have a good we.

Tetra

jefro 07-22-2010 07:45 PM

If worse comes to worse (as it usually does) you can easily return the W7 loader and edit it to allow linux. Assumes you put grub or lilo on the partition that you have linux on, otherwise you will have to then add in grub or another loader to load linux.


All times are GMT -5. The time now is 06:59 PM.