Click to See Complete Forum and Search --> : Dual booting MS Windows by Linux explained


saikee
10-21-2007, 12:43 PM
It is often recommended that a PC user wishing to install a MS Windows and a Linux should carry out the installation for Windows first and the Linux later. Like a magic and without moving a finger the Linux seems to be able dual boot both systems.

This is because as one of the many duties an Linux installer is obligated to check each partition in a hard disk to look for a boot loader in its boot sector. If one is found then the Installer must include that partition as one of the booting choices.

By default each MS system, from Dos to Vista, always install its boot loader into the boot sector of the partition it resides and so a Linux can automatically dual boot a Windows. There is no magic involved.

A MS system from Dos to XP shares a common MBR code (MBR changed in Vista) and so a Dos bootable floppy can be used to restore the MBR of a XP. That creates a problem for Linux because Linux may know there is a MS system but could not tell it if it is a Dos or a Windows, let alone which version. Therefore the installer frequently labels its finding typically as "Windows". If it finds several MS systems they will called by the same name even though some of them may be Dos.

There is also an untold secret that Linux boot loader Lilo or Grub cannot read a ntfs partition but both can boot Windows. They achieve this feat by loading the Windows boot loader, always in the boot sector of the partition, and hand over the control of the PC.

The technique of loading another system's boot loader to hand over the control is called "chainloading". It is used by every boot loader of substance. That is exactly how a Windows boot loader like NTLDR boot a Linux too.

Because Linux must chainload a MS Windows so the booting instructions are standardised.

In Grub's menu.lst or grub.conf for a Windows in the first partition of the first disk, know to Grub as (hd0,0) the commands are
title Windows in first partition of the first disk, know to Grub as (hd0,0) as it counts from 0
root (hd0,0)
chainloader +1

Lilo uses the Linux notation so the first partition of the first boot disk sda1 of Windows can be booted by commands in /etc/lilo.conf
other=/dev/sda1
label=Windows

The above is for the standard case. For non-standard cases read Just booting tips. (http://www.justlinux.com/forum/showthread.php?t=144294) or raise a thread in the forum.

ajay.talk
10-22-2007, 05:34 AM
when i boot Linux SUSE 7.3 as a primary slave, with windows 2000 as a primary master.
it dispatch the error message "unable to mount root fs 3:02"
what should i do?

saikee
10-22-2007, 06:02 AM
Yes, but your case is non-standard.

You have two hard disks and installed Windows as the 1st boot disk or the master disk.

When you installed Linux you told the Bios to boot the slave hard disk as the first disk. So Linux was configured to boot from the 1st disk position.

Both systems work perfectly if you tell the Bios to boot its disk first.

Your error has been proved to be self-inflicited by booting Linux from a slave disk (or 2nd disk) position.

The cure is the in the Section A of this thread (http://www.justlinux.com/forum/showthread.php?s=&threadid=130715). It is also explained in Section C of the above mentioned "Just booting tips."

I have answered your case in a separate thread but am trying to explain it here as well.