LinuxQuestions.org
Review your favorite Linux distribution.
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 06-13-2010, 10:41 AM   #1
scoob8000
Member
 
Registered: Jun 2003
Distribution: Redhat 8, Redhat 9, Win2k, WinXP
Posts: 64

Rep: Reputation: 15
Grub - Have XP and Ubuntu, want to add Win7


So on one of my rigs I have Windows XP and Ubuntu 8.04 dual booting with Grub. (All on the same HDD)

I want to repartition and add Windows 7 into the mix.

Whats the best way to do this?

I'm not beyond installing 7 to a seperate drive and then moving it's partitions over to my main drive and adding the entry to my menu.lst.

Thanks
 
Old 06-13-2010, 10:50 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,038

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
I think you'll have to install win7 to its own drive, that's the way win works. I think you certainly won't be able to move win7's partitions after the install, win will not like this at all (but what do I know? I don't run win now).

I'd also make sure that the new drive was the only drive in the PC at the time win7 is installed (or XP might be hosed, same for Ubuntu).

Then put your other drive(s) back, make an entry for win7's partition in grub and you should be set to go.
 
Old 06-13-2010, 06:32 PM   #3
scoob8000
Member
 
Registered: Jun 2003
Distribution: Redhat 8, Redhat 9, Win2k, WinXP
Posts: 64

Original Poster
Rep: Reputation: 15
Well I installed 7 into a new partition at the end of the drive. Managed to get grub reinstalled to my ubuntu partition and added the 7 entry to menu.lst.

But upon selecting it, I get the bootmgr is missing. Google says to run "bootrec /fixboot" from recovery, but I'm sure that will wipe out my MBR and grub again.

Ideas?
 
Old 06-13-2010, 08:32 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,500

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
fixboot only updates the boot sector record in the (Win7) partition, not the MBR (fixmbr does that).
Hope you used a primary partition.
 
Old 06-13-2010, 09:10 PM   #5
John VV
Guru
 
Registered: Aug 2005
Posts: 13,524

Rep: Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806Reputation: 1806
dose win 7 let grub and lilo boot them?
i thought the only way was to hack the win7 bootloader on the MBS
and use the MS boot loader to boot all 3
 
Old 06-13-2010, 10:41 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,500

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Win7 chainloads fine.
 
Old 06-14-2010, 06:58 AM   #7
scoob8000
Member
 
Registered: Jun 2003
Distribution: Redhat 8, Redhat 9, Win2k, WinXP
Posts: 64

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by syg00 View Post
fixboot only updates the boot sector record in the (Win7) partition, not the MBR (fixmbr does that).
Hope you used a primary partition.
So I assume 7 needs to be on a primary partition?

XP is my primary partition on this drive, after some putzing around I can pick Ubuntu or Windows from grub. After picking windows (rootnoverify to my XP partition, then chainload) I get the Windows boot menu and can boot XP or 7 from that point.

That works, but it would still be nicer to be able to select all three OS's from grub.
 
Old 06-14-2010, 07:04 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,500

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
You can't - that is a limitation of Windoze.
Win7 replaced the boot code from XP, and sets up the option to boot either - but you only have one lot of boot code.
Nothing grub can do about it.

Windoze (all versions) needs boot code in a primary - they accomplish that in your case by over-laying your XP boot code.
 
Old 06-14-2010, 09:05 AM   #9
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
All NT version of Windows (Win2k and Xp) and the later versions (Vista and Win7) can be installed in logical partitions. That is my setup as I have Win7, Xp, Vista and Win2k in sda6, sda7, sda8 and sda9 respectively.

All MS Windows can be installed in logical partitions "if" there is a primary partition to house their boot loaders. I use a Dos fat32 sda1. Why? because I can put Grub and install a Dos there too.

Check out this thread for the arrangement.

Regarding OP task I suggest two methods

Method A - MS Windows way -easier

Just install Win7 in any disk or any partition. Its installer will find Xp and deposit Win7 boot loader bootmgr there. It will then replace Xp partition's boot sector with WIn7's version and nuke the Grub in the MBR. Bootmgr will boot Win7 directly and Xp indirectly by loading NTLDR if the user specifies an earlier version of MS Windows.

After both Xp and Win7 working normally, boot up Ubuntu CD and do a Grub-install (say Ubuntu is in sda3)
Code:
sudo mkdir /mnt/sda3
mount /dev/sda3 /mnt/sda3
grub-install --root-directory=/mnt/sda3 /dev/sda
Ubuntu's Grub2 will then work as before but if WIndows is chosen there is now a dual boot system for Xp and Win7 inside.

The work is Grub2 boots up Xp's boot secton (from "chainliader +1"). The residing boot sector code loads boogmgr. Win7 or Xp will then be selected by the user.

In this method the OP can see both MS partitions.

Method B - Linux way

Before installing Win7 hide the Xp partition, use any of the partitioning tool to change the partition Type 7 to 17. Create a primary partition, make it bootable and format it in Ubuntu by command, say it is sda2
Code:
mkfs.ntfs /dev/sda2
Install Win7 into it. Its installer will seize sda2 as it is the correct and only partition installable.

Boot up Ubuntu and put Grub2 back in the MBR (step as the above).

Amend grub.cfg

(a) Add Win7 partition to Grub2 menu with the "chainloader +1"
(b) hide Xp, unhide Win7 when booting Win7 and
(c) hide Win7, unhide xp when booting Xp

In this set up one Windows is hidden while booting the other. The advantage is each MS Windows has its own boot loader and not dependent on each other.
 
Old 06-14-2010, 08:54 PM   #10
scoob8000
Member
 
Registered: Jun 2003
Distribution: Redhat 8, Redhat 9, Win2k, WinXP
Posts: 64

Original Poster
Rep: Reputation: 15
saikee,

This is the way to go! I used your linux method with a little variation. Mainly using gparted to hide and make new partitions.

I was able to make a new primary partition to install 7 into. I read that you can also set your new (empty) 7 partition to be bootable and that causes the installer to store it's boot files there.

It all comes down to MS quirks, but alas I now can boot all my OS's from grub and all on the same physical drive.
 
  


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
[SOLVED] No GRUB bootscreen after mint4win install on Win7 Leon14344 Linux Mint 4 09-08-2009 11:39 PM
Lenny Dual Boot w/ Win7 - GRUB problems! Leon W. Malinofsky Debian 3 02-25-2009 10:35 PM
add Ubuntu to the grub of PCLinuxOS james2b Linux - Newbie 3 04-03-2008 12:17 AM
Installed FC5> Wrote over Ubuntu MBR: How do i add Ubuntu Partition to Grub Loader Free_beer Ubuntu 4 10-02-2006 07:11 PM
how can i add winxp to grub in ubuntu mitesh.ever Ubuntu 1 07-14-2006 09:38 AM


All times are GMT -5. The time now is 10:21 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration