LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-22-2010, 03:45 PM   #1
tetractis
LQ Newbie
 
Registered: Jan 2003
Location: Torino, Italy
Distribution: From Slackware 2.1 to Android CM7 nightly build - ubuntu natty on desktop (atm)
Posts: 14

Rep: Reputation: 0
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
 
Old 07-22-2010, 03:54 PM   #2
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
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.

Last edited by saikee; 07-22-2010 at 03:57 PM.
 
Old 07-22-2010, 04:08 PM   #3
tetractis
LQ Newbie
 
Registered: Jan 2003
Location: Torino, Italy
Distribution: From Slackware 2.1 to Android CM7 nightly build - ubuntu natty on desktop (atm)
Posts: 14

Original Poster
Rep: Reputation: 0
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
 
Old 07-22-2010, 04:33 PM   #4
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
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.
 
1 members found this post helpful.
Old 07-22-2010, 05:18 PM   #5
tetractis
LQ Newbie
 
Registered: Jan 2003
Location: Torino, Italy
Distribution: From Slackware 2.1 to Android CM7 nightly build - ubuntu natty on desktop (atm)
Posts: 14

Original Poster
Rep: Reputation: 0
Thank you a lot, saikee!
Your explanation was illuminating

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

Tetra
 
Old 07-22-2010, 07:45 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 16,676

Rep: Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455Reputation: 2455
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make a win7 and backtrack 4 dual boot? kevinx17910 Linux - Newbie 1 06-08-2010 12:09 AM
Dual Boot Win7 and Mint9 using 2 HDDs Honkeychops Linux - Newbie 14 06-07-2010 04:22 AM
Dual boot with Win7 and ICH10r Raid5 badogg Ubuntu 1 02-01-2010 02:29 PM
Dual boot problem - Win7 & Linux defmania Linux - Hardware 3 01-28-2010 06:34 PM
Grub 22 error using dual boot of Win7 and Linux Mint brianste Linux - Newbie 12 12-30-2009 08:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration