Home | Posts RSS | Comments RSS | Login

How to Dual-boot windows 7 with Linux (with Linux installed first) -- the step-by-step guide

Saturday, November 21, 2009

Scenario: You have Linux already installed but want to dual boot it with windows 7 on the same hard drive.
Summary of tutorial: We'll dual-boot Ubuntu 9.10 with windows 7. With Ubuntu already installed and owning the entire drive, we'll use the Ubuntu Live CD to shrink the Linux partition to create space for the windows install.
windows 7's MBR will overwrite GRUB during installation.

Instructions: 
1. Obtain a copy of Windows7.
2. Partition your disk with fdisk
3. Install Windows7.
4. Re-install Grub.
5. Edit Grub to List Windows 7.



Details:


4. Re-install GRUB

Now you have windows 7 but it has completely eaten your boot loader so you need to re-install grub.
Boot from the ubuntu live cd and go to terminal.
Type in terminal:

"sudo grub"
"grub> find /boot/grub/stage1"

That should return your Ubuntu partition in the form of (hdX,Y), use that:

grub> root (hdX,Y)
grub> setup (hd0)
grub> quit

(you don’t need to type the grub> bit)

That has re-installed grub but you can no longer see windows7

5. Edit grub.
Go to terminal from normal ubuntu and type :

“sudo gedit /boot/grub/menu.lst”

A large text file will open and at the bottom leave a line and add this:

title windows 7 beta (Loader)
root (hd0,1)
savedefault
makeactive
chainloader +1

(Do not type this line but if that does not work on re-boot try “hdo,0 or hd0,2” and so on until it works.)

thanks to hyperdude111 and James Bannan

0 comments to How to Dual-boot windows 7 with Linux (with Linux installed first) -- the step-by-step guide:

Post a Comment