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.
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.