|It's Not Logical|
Sunday, July 4, 2010
Lilo & Grub
Linux and Lilo/GrubWhen you install Linux you will usually get an option during setup of where to place Lilo or Grub. The choices will include to the MBR of the boot hard drive or to the Linux partition. If you choose the MBR then part of Lilo/Grub will replace the Microsoft IPL and the other part will remain on the Linux partition and be configured to operate as a bootmanager for the other OSes on the computer. If you already have a Windows dual/multiboot using the Microsoft bootmanager then Linux may only add the Windows system partition to its boot menu. If you have various independent Windows installs you may still have to add most of them yourself to the Linux bootmanager.
Boot sequence for a Windows OS when Lilo/Grub is in the MBR.
If you instead choose to have Lilo or Grub installed entirely to the Linux partition then you can use your preferred bootmanager to start Linux by way of its own PBR, in exactly the same way as you start independent Windows by their PBRs. It's a cleaner method of doing things and also removes the certainty of breaking the boot sequence chain to your Windows OSes if you later decide to reinstall or remove the Linux OS. Unlike Windows an independent Linux install will not overwrite your MBR bootmanager.
If you want to have more than three Windows OSes and an extended partition per hard drive then you will need to put Windows onto a logical partition. With Linux you are able to install a fully independent and stand alone OS directly to a logical partition or to a second or higher hard drive, because the Linux IPL is clever enough to be able to pass control to that OS. Unfortunately Microsoft have never introduced such abilities in their IPL and so have never seen the need to allow you to do a fully independent install of Windows to a logical partition or other drive. Their IPL can only work with primary partitions on its own boot hard drive, so if you want to install to anything other than one of these primaries then you can only do it by allowing a boot drive primary to become a system partition where ntldr or bootmgr will operate as a bootmanager. The Windows setup will simply refuse to continue if there is not a suitable boot drive primary that it can use.
This of course means that getting an independent install of Windows on a logical partition or another hard drive requires a little work around. For a second or higher hard drive it only requires making that drive the boot drive during the install. For a logical partition the easiest and cleanest way is to simply clone it there. See Dan Goodell's excellent guide to Booting Windows from an Extended Partition.The Windows logical partition PBR needs one small tweak to make it bootable, but you may not have to do this as many recent cloning tools will do it automatically and Vista and Win7 don't appear to require it. After cloning XP/2K etc you have to make a simple edit to the boot.ini file in notepad so that it points to the changed drive and/or partition. With Vista you have to edit the new BCD file, which is explained on the cloning page.