Tag Archives: boot

How to boot Linux using Windows bootloader (XP)

You want to setup dual boot on your computer but do not want to install Grub or Lilo (You still are use LILO?), then read on….

Otherwise, if you are tired of Windows over writing Grub or LILO every time you setup Windows, then you can sacrifice the powers of Grub and shift to Windows Boot Loader to boot you into Linux.

Here are the steps: (Ideal case)

Windows XP Loader (NT Loader) needs Linux Master Boot Record (MBR) to boot into Linux.

If you can boot into Linux, grab the first 512 bytes of boot sector from the root partition of Linux  where Grub is installed (/dev/sdaN) to an external drive.

 dd if=/dev/sdaN of=grub.bin bs=512 count=1

Here is the twist!

In my case, I had an existing Linux installation but I could not boot into Linux and I didn’t have a rescue disk. I installed Ext2 IFS For Windows and copied MBR which I had extracted previously before I wiped out Grub  /boot/grub/stage1 and named it grub.bin (Your MBR is nothing but stage1 boot-loader used by GRUB).

To setup Windows bootloader to load Linux, we need to add an entry corresponding to Linux.

Boot into Windows. Set appropriate attributes for boot.ini so that it is editable.

attrib -r -w -s c:\boot.ini

Add the following entry to the file boot.ini

 c:\grub.bin="Ubuntu Linux 7.10"

Restart the machine and Windows XP boot loader shows Ubuntu Linux 7.10 as one of the options.

Select this option and viola! you should see Linux booting 🙂

For more detailed instructions follow this : http://www.tprthai.net/bootmgr.htm

http://www.supergrubdisk.org/ provides a specialized rescue disk to restore Windows/Linux. I haven’t used it anytime though.