Windows7 has been the talk of the town for quite a few months and it will be the favorites due to lower system usage than Vista.. Recently I gave the new Redmond OS a ride and found it reminiscent of Vista, in-addition to few cosmetic changes that it brings with it.
Well we are not here today to talk about what WIn7 is and what it does .This thread is for those people who intend to dual boot Windows 7 with any of the Linux Operating system.
Prerequisites : -
- Windows 7 DVD
- Any Linux distro with latest grub 0.99.x
- A DVD/CD drive..
In this tutorial we will make Linux and Windows7 multi-boot in which Linux has been installed first.
Once you install Windows7 over any Linux installation, the Windows boot-loader will overwrite the existing grub boot loader and you will not get the Linux entry while booting you system.. In order to get a multi boot we have to restore the grub..
After installing Windows 7 over any linux distro. Insert the Linux Live Cd and boot through it. Once the desktop appears open the Terminal in Gnome or Konsole in kde . to open the respective command client you can either gain access from menu's or simply press ALT + F2 and type the following
Gnome - [B]gnome-terminal[/B] KDE - [B]konsole[/B]
Debian based disto - [B]sudo su root [/B] Rpm based distro -[B] su -[/B]
Type the following command as super user/root one by one
grub find /boot/grub/stage1
(hd0,1) # consider 0,1 as X,Y
The second number output 1 say Y list the partition ( partition number -1) in which you have installed the distro..
Now once you get the numbers you have just to re-install the grub inorder to restore the default Linux boot manager
root(hd0,1) setup (hd0)
Once we are done type quit and reboot the system in Linux.. Open the command client again [not in Live disc mode] and type the following commands after gaining root privileges..
[B]For Gnome user[/B][B] -[/B] gedit /boot/grub/menu.lst [B]KDE user -[/B] kwrite /boot/grub/menu.lst
title Windows 7 (Loader) root (hd0,0) savedefault makeactive chainloader +1
Ubuntu 9.10 Onwards : The Grub 2 Mumbo Jumbo
WIth the release of Ubuntu 9.10, the Canonical was quick to adapt with the venerable Grub2, even though the version 2 of the Gnu Bootloader is still under development the people behind ubuntu thought of including it even though its still not in final stage.
Since Ubuntu is one of the most popular distro out there, playing with Grub2 was an essential for almost all those who plan to use uBuntu, even if you don't plan to use it, getting something new under the hood isn't that bad ? Ain't it ?
To recover the grub after installing Windows over the Ubuntu installation, just follow these steps : -
1. Insert Ubuntu Disc 9.10 onward.
2. Enter sudo fdisk -l. Yo u will get output something similar to this :
shashwat@shashwat-desktop:~$ sudo fdisk -l [sudo] password for shashwat: Disk /dev/sda: 640.1 GB, 640135028736 bytes 255 heads, 63 sectors/track, 77825 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x0009e36e Device Boot Start End Blocks Id System /dev/sda1 1 4514 36258673+ 7 HPFS/NTFS /dev/sda2 4515 8473 31800667+ 83 Linux /dev/sda3 * 8474 11802 26740192+ 83 Linux /dev/sda4 11803 77825 530329716+ 5 Extended /dev/sda5 11803 18800 56211403+ 83 Linux /dev/sda6 18801 48903 241802316 83 Linux /dev/sda7 48904 63885 120342883+ 83 Linux /dev/sda8 63886 77518 109507041 83 Linux /dev/sda9 77519 77825 2465946 82 Linux swap / Solaris shashwat@shashwat-desktop:~$
4. df -h should show the following output
shashwat@shashwat-desktop:~$ sudo df -h [sudo] password for shashwat: Filesystem Size Used Avail Use% Mounted on /dev/sda3 26G 22G 2.5G 90% / udev 1.9G 280K 1.9G 1% /dev none 1.9G 2.7M 1.9G 1% /dev/shm none 1.9G 328K 1.9G 1% /var/run none 1.9G 0 1.9G 0% /var/lock none 1.9G 0 1.9G 0% /lib/init/rw /dev/sda7 115G 37G 79G 32% /media/hd0 /dev/sda6 231G 218G 13G 95% /media/hd1 /dev/sda8 105G 32G 73G 31% /media/hd2 /dev/sr0 683M 683M 0 100% /media/cdrom0 shashwat@shashwat-desktop:~$
5. Mount the partition using mount command. Make sure you umount all the partition before doing this.
mount /dev/sdaX /mnt
Now install the grub again using the following command : -
grub-install --root-directory=/mnt /dev/sda
This tutorial is also applicable in case where Windows is installed first. If some distro fails to add grub and windows entries you can use the above stated method to make a multi-boot solution...
I hope this tutorial helps you in multi-booting OS. You can multiboot any linux, windows or mac using the same procedure.
Please feel free to ask your doubts .
Also check : http://www.techenclave.com/guides-and-tutorials/installing-windows-7-rc-7100-ubuntu-137734.html