jump to navigation

Using Windows Boot Manager or GRUB for Windows(Vista)-Linux system October 30, 2009

Posted by viboon in : MS Windows, Ubuntu , trackback

By installing more than one OS, boot loader will play a significant role to assist and manage the system booting. Basically, the type of applied boot loader follows the last installed OS. For instance, GRUB will take place when Ubuntu is installed after Windows, and Windows Boot Manager will be vice versa. However, we can change the boot loader to be the one we want without reinstalling the OS(s) in a proper sequence. Clearly, only boot loader will be reinstalled separately into the Mater-boot record (MBR).

This article will give you the procedure to reinstall the boot loader which is no matter what OS is installed before or last.

[ Using Windows Boot Manager instead of GRUB ]

If you have not had Ubuntu in your machine, you can go for http://www.ubuntu.com/getubuntu/download-wubi to setup Ubuntu in the Windows environment.

If you already installed Ubuntu and you want to use Windows Boot Manager, please follow the instructions below (MichaelF, 13Oct2006):

1. Install GRUB on the Linux partition (outside of MBR)
– Launch a Terminal with root privileges
– Find the name of the partition Linux is installed on by running:

fdisk –l

the partition you’re looking for is the one whose system is Linux, can be something like /dev/sda1 or /dev/hda1.
– Install GRUB on the Linux partition by running (if the linux partition is /dev/sda1):

grub-install /dev/sda1

2. Get a copy of Linux boot sector
We will need to instruct Windows Boot Manager how to boot correctly Linux using Linux boot sector.
– On Linux, launch a Terminal with root privileges
– Take a copy of Linux boot sector:

dd if=/dev/sda1 of=/tmp/linux.bin bs=512 count=1

– Copy “linux.bin” on a FAT formatted USB key or any storage accessible from Windows Vista.

3. Configure dual booting in Windows Vista
We will create an entry for GRUB in Windows Vista boot configuration data store.
– On Windows Vista, launch a command prompt with administrative privileges (by right clicking on cmd and choosing Run as Administrator)
– Copy Linux boot sector (linux.bin) on the root of the Windows boot (active) partition, namely the one containing bootmgr. If you don’t know for sure you can use “diskpart” or “diskmgmt.msc” to find out which one it is.

4. Create an entry for GRUB

bcdedit /create /d “GRUB” /application BOOTSECTOR

– bcdedit will return an ID for this entry that we will call {LinuxID} below. You will need to replace {LinuxID} by the returned identifier in this step. An example of {LinuxID} is {81ed7925-47ee-11db-bd26-cbb4e160eb27}
– Specify which device hosts a copy of the Linux boot sector

bcdedit /set {LinuxID} device boot

– Specify the path to a copy of the Linux boot sector

bcdedit /set {LinuxID}  PATH \linux.bin

– Add Linux entry to the displayed menu at boot time

bcdedit /displayorder {LinuxID} /addlast

– Let the menu be displayed 10 seconds to allow for OS selection

bcdedit /timeout 10

[ Using GRUB instead of Windows Boot Manager ]

After you install Windows as the last OS in your machine, the boot loader will be changed to Windows Boot Manager automatically by replacing GRUB in MBR. Some of you may not want to use Windows Boot Manager with any reason. Please proceed the instructions below:

1. Boot your machine by using Ubuntu Live CD

2. Run Terminal and enter:

sudo grub

At this stage, you will see “grub>” as a result.

3. Find the system partition to be installed GRUB

find /boot/grub/stage1

4. Setup the GRUB (if the system partition is (hd0,1), for example) and quit

root (hd0,1)
setup (hd0)
quit

5. Add Windows into the boot menu of GRUB

sudo gedit /boot/grub/menu.lst

In the “menu.lst”, add a menu for Windows as an example below:

title Windows Vista
root (hd0,1)
makeactive
chainloader +1

In addition, if you want to make the GRUB menu always available, edit the “menu.lst” file and find the “hiddenmenu” text string and change it to “#hiddenmenu”.


Tags: , , ,

Related posts:

Comments»

no comments yet - be the first?


*