| Charity is not something only the rich are capable of. No matter how big or small your earnings are, always give some of it to the poor. |
|
Saturday 4 July 2009 06:26:44 Chat with me on Yahoo Messenger |
||
|
|
||||
| ARTICLES | DOWNLOADS | GALLERY | HUMOUR | GUEST BOOK |
|
How To Multi-Boot Operating Systems |
|
|
When IBM was putting together their Personal Computer (PC), they wanted an operating system (OS) to go with it. Gary Kildall, who wrote the popular CP/M (Control Program for Microprocessors) for early Intel Microprocessors, could not be interested to provide a new one for the IBM PC, which was based on the latest Intel processor. So, IBM gave the contract for the new OS to what was then a little-known company called Microsoft. Microsoft bought QDOS (Quick and Dirty Operating System) written by one Tim Patterson based on a manual of CP/M. The first IBM PC was released with QDOS rechristened as DOS (Disk Operating System) from Microsoft. As IBM PC compatibles began to be manufactured by companies like Compaq, Microsoft was no longer dependent on IBM. Soon, it overtook IBM as the leading provider of software for PCs. When a user started an IBM PC or PC-compatible running on MS-DOS, it ended up on the command prompt. (If you want to see how this looked like, then type cmd or command in the Run dialog box of the Start menu of a Windows PC.) The command prompt was the OS of those PCs! To perform ordinary operations like copying a file or deleting one, the user had to type complicated commands (without any syntax errors, of course) on the command prompt. Users also had to remember a number of keyboard shortcuts. The keyboard shortcuts were actually keyboard commands, as they were quite indispensible and not really alternatives. Over time, Microsoft released new versions of DOS but the biggest improvement came when they released Windows. This was a poor imitation of the Apple Macintosh's Graphical User Interface (GUI) but it still managed to become very popular. It had a mouse, which enabled a point-and-click interface come to life, and was more easy to use when compared to DOS. Windows versions from 1 to 3.1 were not real OSs. They worked as just another program that ran on DOS. Each one of them was in effect an "operating environment." So, in 1995, Microsoft released Windows 95, an OS that was fully GUI-based. Microsoft then went on to release newer Windows OSs, such as Windows 98, Windows Me, Windows 2000 and Windows XP. As Microsoft was dominating the OS market, a sly newcomer called Linux (or GNU/Linux to be correct) came to sudden prominence. Finnish programmer Linus Torvalds created a Unix-like Kernel for x86 (Intel) computers, combined it with the software created by the GNU community and released it for free as Linux. It later came to be known as GNU/Linux. Until then, most UNIX implementations such as BSD Unix, SCO Unix, HP Ux, IBM Aix and Solaris OS, were limited to huge multi-user architecture systems such as mainframes. There were notable attempts such as BeOS to break into the Intel PC market but it was Linux that captured the imagination and interest of geeks and novices, and is giving serious competition to Microsoft Windows. Today, various versions of GNU/Linux, called distributions or distros, available for both desktops and enterprise.
Although many of these distros are available as commercial shrink-wrapped software, they can also be freely downloaded and installed any number of PCs. Their source code is also available for free for modification (on the agreement that the modified code will also be available free). So, a lot of people feel they would like to install Linux and tinker with it. Few of them would however be ready to give up their existing Windows installations. Realising this, the distros come with smart bootloader programs which help multiple OSs to coexist on a single PC. However, many people are mortified when they see a Linux bootloader starting up instead of the familiar NTLDR. And, if they delete the linux partition, the PC becomes unbootable. Apart from that, Linux installation remains intimidating for the uninitiated. Terms such as partitions,‡ bootloaders and MBR spook newbies to the point that many of them do not even complete the installation. In this writeup, you will learn to safely and easily dual-boot or multi-boot multiple operating systems. Specifically, you will learn about booting Linux from the Windows boot menu. You will also find explanations for a lot of difficult installation and Linux related terminology in real-world terms. If you have any unanswered queries, you can take it to my discussion forum. You might also find additional info in the writeups PC Hardware Explained, 101 Tips & Tricks To PC Performance and Windows XP Tips & Tricks helpful. Go Down |
|
| Disc Drives & Partitions | ||||||||||||||||||||||||
Most Windows users have more or less the following idea about disk drives.
Sometimes, when there is an extra hard disk drive, then that drive becomes D: and the CD/DVD drive E:. What they do not always know is that the C: and D: are actually only a single disk drive and are technically known as partitions. This is why people blink when a Linux installation asks them to choose a "partition" to install the OS. A hard disc can have a maximum of only four partitions. In the early days of the IBM PCs, this number was thought to be more than sufficient. However, over time, the need for more partitions arose. So, the concept of primary partitions, extended partitions, and logical partitions was introduced. The old-style partitions were then known as primary partitions and one of these primary partitions could be what is known as the extended partition. The extended partition had a very important improvement over ordinary primary partitions. It could house any number of smaller partitions known as logical partitions inside it. Thus, the four-number primary partition limit was kept while the need for more partitions was met. Most people, when they get a new hard disk, create just one primary partition and one extended partition. Whenever a new partition is needed, a new logical partition is created inside the extended partition. Somewhat unrelated to the number scheme above but relevant to booting OSs are active partitions and boot partitions. An active partition is a designated partition that has the files for loading the default OS or the bootloader (the program file that displays the boot menu and loads the required OS). Only one partition on a disk can be an active partition. A boot partition is the partition where the OS is installed. Windows 95/98/Me is adamant about having the first partition on the hard disk as the boot partition. Windows 2000 and Windows XP operating systems (OSs) can be installed on just any partition on the hard disc. The installation procedure actually allows the user to choose the partition on the disk. Similarly, Linux distributions can be installed on any partition. When you install an OS on a partition, it will first format the partition. Formatting essentially creates a file system on the partition that the OS can use. Different OSs use different file systems. DOS/Windows 3.1 used the FAT-16 (File Allocation Table 16 bit) system. Windows 95/98/Me used FAT-32. Windows NT/2000/XP use the NTFS (New Technology File System). Linux distros use the ext2 and ext3 file systems. Apart from OS installation programs, there are third-party utilities like Ranish Partition Manager and Partition Magic, which will create, format, resize, and delete partitions on your hard disc. |
||||||||||||||||||||||||
| Booting a Single OS on a PC | ||||||||||||||||||||||||
|
Now that you know all about partitions, you can move on to the topic of boot loaders. Bootloader programs come into action right after the BIOS (the motherboard code) performs the POST.† Bootloader programs are necessary to load an OS into execution or to display a boot menu where the user can make a choice from the available operating systems installed on the PC. Loading an OS involves two important sectors* of the disk - master boot record (MBR) and the boot sector of the OS. The MBR contains a partition table and some executable code called master boot code (MBC). The partition table contains geometry information about the disk so that all the partitions on it can be identified. The MBC is written by OS installation procedures or a bootloader programs so that they will load the OS or the bootloader program respectively. The MBR is always on the first sector of a disk. The partition table on the MBR is written the first time a partition is created on a hard disk and is independent of the OS(s) installed on the computer. The boot sector is on the first sector of every partition on a disk. On an active partition, the boot sector contains code that will load the default OS or the bootloader program. On other partitions, the boot sector may or may not have executable code. On boot partitions, however, the boot sector has executable code necessary to load the operating system. When you partition a disc, the partitioning utility or the OS installation procedure will allow you designate one of the partitions as an active partition. Without an active partition, you will not be able to boot into an OS from the hard disc. The sequence of loading an OS is as follows:
|
||||||||||||||||||||||||
| Dual-Booting or Multi-Booting Windows OSs | ||||||||||||||||||||||||
|
When you install Windows 2000/XP on a machine that already has Windows 95/98/Me, you have the option of upgrading (overwriting the Windows 9x/Me installation with Windows 2000/XP) or having a dual-boot or multi-boot setup. If you choose the latter, the new OS is installed on a different partition. The installation procedure installs a boot loader program in the boot sector of the active partition. It also modifies the MBC so that the latter can load the bootloader program that was installed on the Windows boot partition. The bootloader program displays a boot menu, which lists the available Windows OSs and lets the user to choose an OS from the menu. The Windows 2000/XP installation procedure makes a copy of the original boot sector that was created by the Windows 9x/Me installation and places it in a hidden file named bootsect.dos. Next, it overwrites the boot sector with its own boot loader program NTLDR (NT Loader). So, every time you start the computer, NTLDR is loaded by the MBC. The NTLDR displays a boot menu that offers booting to Windows 9x/Me or Windows 2000/XP. If you choose the Windows 9x/Me option, then the old boot sector information from the bootsect.dos file is emulated by NTLDR and the computer boots into Windows 9x/Me. ![]() |
||||||||||||||||||||||||
| Boot.ini | ||||||||||||||||||||||||
|
During the installation procedure, a file called boot.ini is created, which contains the choices displayed in the NTLDR boot menu. A typical boot.ini file on a PC that has Windows Me on the active partition (C:) and Windows XP on the second partition (D:) looks like this: In the Boot Loader section, the Timeout parameter represents the number of seconds the boot menu will be displayed. If no option is chosen, the operating system specified by the Default parameter is loaded. In the Operating Systems section, NT-based OS installations are identified by Advanced RISC Computing (ARC)-style pathnames.
|
||||||||||||||||||||||||
| Linux Installation | ||||||||||||||||||||||||
|
You have learned how Windows OSs coexist. The real headache comes when you try to install a non-Windows OS like Linux. NTLDR recognises only Windows partitions (FAT, FAT-32 and NTFS) and is blind to Linux partitions. In other words, NTLDR cannot load Linux. Thankfully, Linux distros come with bootloader programs, such as GRUB (Grand Unified Bootloader) or LILO (Linux Loader), which recognise both Linux and Windows partitions. This means that they can load both Linux and Windows. When you install Linux, the installation procedure replaces the MBC (on the MBR) created for Windows NTLDR with an MBC that is set to load LILO or GRUB. (This means that, after the Linux installation, the user will see LILO or GRUB first instead of Windows or Windows NTLDR everytime the PC is started. This is a scary scenario for new Linux users. If they remove Linux somehow, they are uanble to boot into Windows.) When the Linux installation procedure installs LILO, it automatically creates an option for Windows in its boot menu. This allows the user choose to load Windows at the LILO/GRUB boot menu. When the user chooses the Windows option, LILO loads NTLDR and exits. NTLDR then displays its boot menu and allows the user to load a Windows OS. Now, you should learn about the Linux installation procedure in more detail. The Linux installation procedure uses some special terms to identify hard disc partitions. The MBR is called /dev/hda. Your first partition is treated as /dev/hda1; the second one will be /dev/hda2, and it goes on like that. On a second hard disk on your PC, the partitions will be known as /dev/hdb1, /dev/hdb2,... On a third hard disk, we will have /dev/hdc1, /dev/hdc2... Every Linux installation requires two or three new partitions, which are identified as:
Here, I've got to make a small clarification. The Linux installation procedure will ask you for a location to install the bootloader (LILO or GRUB)? No mater which option you choose, the bootloader files are going to be stored on / or /boot. (None of the locations listed by the procedure is big enough to hold all the files of the bootloader program.)
UPDATE (2 July 2008): On a laptop, you do not have a floppy drive and installers of most recent versions of Linux do not give informative options, such as the one above, limited though they are. Instead, its lists all possible locations where the bootloader can be installed. In the screenshot on the right, the first location (/dev/sda) is the MBR of my hard disk. The second location (/dev/sdb) was the MBR of the temporary RAM drive where the Mandriva 2008 Live CD system was running. (Live CDs create a temporary drive in the system memory (RAM) and temporarily run from there.) The third location (/dev/sda10) is where I installed / (root). The fourth location (dev/sda11) is where I installed /boot (boot partition). So, I asked the bootloader to install on the fourth device.
The install program then asked if I had a bootloader program already installed. In my case, I intend to load Mandriva with NTLDR, and NTLDR (and Windows) was installed in my 160 GB hard disk (sda). |
||||||||||||||||||||||||
| Getting NTLDR to Load Linux | ||||||||||||||||||||||||
|
You have learned how the default Linux installation handles multibooting. Basically, you have LILO loading NTLDR to boot into Windows. However, this involves overwriting the MBR i.e., the MBC (created for Windows NTLDR) being overwritten by an MBC (created for Linux LILO). If you are a Linux newbie, you might feel very apprehensive about this. What if you don't like Linux and want to get rid of it? LILO will be gone and there would be no way to boot into Windows! (Well, you could simply restart the PC with a DOS emergency disk and use the fdisk /mbr DOS command to restore the old Windows MBR.) Now, if there was a way to get NTLDR into loading Linux, wouldn't you like that? Actually, a way exists. Interestingly, this idea was proposed by Microsoft. What you need to do is create a Linux boot sector file and place it in a Windows drive where NTLDR can access it. Next, you add a new entry in the boot.ini file so that NTLDR can use the bootsector file to transfer control to the Linux bootloader. (This is similar to the behind-the-scenes bootsect.dos-file technique that NTLDR uses to load Windows 95/98/Me.) This way, your Windows installations remains available all the time. Here are the steps:
With this setup, dumping Linux and going back to a monogamous relationship with Microsoft involves very little heartburn. Just delete the Linux partitions and remove the C:\mlnxboot.dos="Mandrake Linux 10.1" line from the boot.ini file. ---o0O0o---Update - 15 June 2008: Recently, I bought an Acer Aspire 4520 laptop. I had been planning on installing Mandriva 2008 One on the laptop but a visitor pre-empted me with this message:
Here is my reply to the visitor:
|
||||||||||||||||||||||||
| Other Options | ||||||||||||||||||||||||
|
If NTLDR and LILO drive you mad, you should try eXtended Operating System Loader (XOSL), a standalone Open Source boot loader program. XOSL supports almost all PC operating systems. ![]() Live CDs:If you don't want to play with partitions, you can use Linux Live CD, such as Knoppix. Live CD Linuxes do not require an installation, as they boot from a CD and run off the sytem RAM rather than the hard disk. As the contents of system RAM are lost when the computer is powered off, the Live CD makes no permanent change to your PC. The Linux OS is available only when you boot it from a Live CD. Just set the first boot device as your CD/DVD drive in the BIOS and restart the machine with the Live CD in the CD/DVD drive. † - POST or Power-On Self Test is a series of tests performed by the BIOS when you switch the PC on. POST allows the PC to identify the devices on the PC and and initialize their settings. * - A sector on a hard disc contains 512 bytes of information. A hard disk is divided into numerous sectors. To put in perspective, a 20 GB (20,000,000,000 bytes) hard disk contains 39062500 sectors. ¤ - The Notepad application is a text file editor and will typically open/save files with a .txt extension. So, when you open/save the boot.ini in Notepad, type the complete pathname enclosed with quotation marks - "C:\boot.ini" - in the File name input box. |
||||||||||||||||||||||||
|
© V. Subhash, 2009. All rights reserved. To link to this page, use the URL |
WEBSITES
|
|
|
1,14,823 Since 01/12/2005 |