Vous êtes sur la page 1sur 10

Operating System Boot Process.

Hard Disk and Partitions:Partitioning is a process of dividing the Hard disk into several chunks, and use any one of the partition to install OS or use two or more partitions to install multiple OSes. But you can always have one partition, and use up the entire Hard disk space to install a single OS, but this will become data management nightmare for users of large Hard disks. This is where advantage of partitioning lie! Now, because of the structure of the Master Boot Record (MBR), you can have only four partitions, and these four partitions are called Primary Partitions. Again, If we have a large hard disk, we can not have only four primary partitions, hence Extended Partition is introduced. This Extended Partition is not a usable partition by itself, but its like a container and it is used to hold Logical Drives! That is this Extended Partition can be subdivided into multiple logical partitions. In order to boot into a Partition, it must be designated as bootable partition or Active Partition. Active Partition is that partition which is flagged as bootable or which contains OS, this is generally a Primary Partition. Boot Records: Master, Partition, Extended, Logical Extended:Master Boot Record (MBR):- MBR is a small 512 bytes partition which is at the first physical sector of the hard disk. The location is denoted as CHS 0,0,1 meaning 0th Cylinder, 0th Head and 1st Sector. MBR contains a small program known as bootstrap program which is responsible for booting into any OSes. MBR also contains a table known as Partition Table. This Partition Table is a table which lists the available Primary Partitions in the hard disk. So it can have only four entries. This rises another question, what if we have more than four partitions? This is solved by Extended Partition principle. Partition Table considers whole Extended Partition as one Primary partition and lists it in the table! So a Partition Table can have two possible entries:up to 4 Primary Partitions . up to 3 Primary Partitions and 1 Extended Partition.(Total not exceeding 4) . Partition Boot Sector (PBR):- This is the logical first sector, that is sector at the start of a Primary Partition. This is also 512 byte area, which contains some programs to initialize or run OS files.All Primary Partitions have its own PBRs.

Extended Boot Sector (EBR):- This is the logical first sector, that is the sector at the start of the Extended Partition. This EBR contains a Partition Table, which lists the available Logical Partitions inside Extended Partition. That is it contains the Starting addresses of each Logical Partitions. Logical Extended Boot Sector (LEBR):- This is the logical first sector residing at the start of each Logical Partition. This is similar to PBR for Primary Partitions. Single OS Boot Process:Whenever PC is turned ON, BIOS takes the control, and it performs a lot of operations. It checks the Hardware, Ports etc and finally it loads the MBR program into memory (RAM). Now, MBR takes control of the booting process. Functions of MBR, when there is only one OS is installed in the system are as given below:The boot process starts by executing code in the first sector of the disk, MBR. The MBR looks over the partition table to find the Active Partition. Control is passed to that partition's boot record (PBR) to continue booting. The PBR locates the system-specific boot files (such as Win98's io.sys or WinXPs ntoskrnl). Then these boot files continue the process of loading and initializing the rest of the OS. Multiple OS Boot Process:Whenever there are multiple OSes, be it multiple Windows or Windows with Linux, then Boot process will be slightly different. Actually, there can be two different types of Boot Process in multiple OS environment, Microsoft way and Non-Microsoft way (or Third Party Boot Loader way!). Microsoft way:- Microsoft Master Boot loaders doesnt recognize other types of OSes like Linux (in default, that is!), hence using Microsoft MBR in the presence of Linux is ruled out. Consider the case that (this is the general case), there is one Primary partition and some Logical Partitions inside Extended Partition. Now if Win98 is installed in the Primary Partition, and afterwards WinXP is installed in a Logical Partition, then theoretically both OS should have their own Boot Records, i.e PBR for Win98 and LEBR for WinXP, which contain program to boot the respective OS, so that each individual OS can be booted up by the MBR by passing control to respective PBR of the OS as described in previous section.

But this does not happen in Microsoft Boot loader! It does a peculiar thing, that it always considers the current Active Partition as the default System/Boot Partition. That is Primary Partition in which Win98 was installed is the Active Partition, then when WinXP is installed another partition, instead of writing the code for booting in it's partition, WinXP writes the code in current Active Partition (that is, where Win98 is installed)! Program responsible for loading the WinXP is ntldr standing for NTLoader. Theoretically, this should be in its partition, but this copied to that of Win98. Then files responsible for Win98 booting is combined into a single file called bootsect.dos and this is also placed in the Win98 partition. Then, WinXP creates another file called boot.ini which contains the names of Microsoft OSes installed and path for System files of each OS. After all this prelims, Windows multiboot can be represented as below:When BIOS hands over control to Microsoft MBR , this program looks into Partition Table for Active Partition. Then it hands over the control to the PBR of Active Partition. In this case, the Active Partition is where Win98 was installed. But Win98 PBR has been altered by WinXP, and it no longer contains Win98 boot program (like io.sys or msdos.sys). But it contains ntldr! Peculiarity is that one OSs Boot program is in another OSs Partition! ntldr looks into boot.ini file and finds out the Microsoft OSes installed in the System and displays the option menu. When user slects Win98, the file bootsect.dos (which is in same partition) is executed, and if WinXP is selected, ntoskrnl is executed (which is in another partition!). The good thing about Microsoft way is that, its very easy to configure (you dont have to configure at all!). But the bad thing about Microsoft MBR is that, the two OSes are not independent of each other.It is because, that Microsoft MBR always boots into the Active Partion (that is it always boots into Win98 Partition, but executes WinXP program!) and from here other OSes are loaded. This does not provide flexibility of installing multiple Microsoft OSes in a random order, because here older version of OS should be installed first and then newer versions of OSes should be installed. This boot process also has two limitations:There can be only one Real Mode DOS based OSes like Win95/Win98 along with NT based OSes. If you want both

Win95, Win98 with any NT based OS, then its simply not possible. Microsoft MBR looks for Active Status in Primary Partitions only and not in Logical Partitions. This means, Microsoft OSes should be installed in Primary Partitions only if it should be bootable (For this reason itself, WinXP boot file ntldr is placed in Primary Partition of Win98 instead of its own Logical Partition). But this has led to misconception that only OSes in Primary Partitions can be booted. But by replacing Microsoft MBR by any other sophisticated MBR program which also looks for Active Status in Logical Drives, we can boot into OSes which are in Logical Drives directly. This is where third party Boot Loaders come into picture! Non-Microsoft way:- Third-party Boot Loader load before the OS, so they are independent of the OS. Therefore, they work fine with all versions of Windows and DOS. In this system, installing multiple OSes is conceptually simple. First make as many Primary Partitions and Logical Partition as you want. Then set the status of one of the Partition as Active, and install on OS. After this set the status of that partition as Hidden (or Inactive ) and set another Partition as Active and install another OS and this can be done for all Partitions. By this older versions of Windows can be installed after the installation of new ones. Then Third Party Boot Loader reads all Partitions (including Logical Partitions)from the Partition Table and provides with an option of OSes to boot. The functions of a Third Party Boot Loader can be stated as below:Display a list of all OSes present in both Primary and Logical Partitions. When an user selects one OS, Boot Loader makes the Partition of that OS as Active, and passes the control to it. This step is the most important deviation from Microsoft way, because in Microsoft MBR, the Active Partition always remains same and after booting into it, OSes in other (Logical) Partitions are booted. But here, a Partition is flagged as Active at the time of the selection by the user, by this way, any OS can be booted directly, by toggling its Inactive/Active Status when an user selects it. Then, the Boot Sector of the corresponding OS takes control and loads the OS. This Boot Sector may be PBR of a Primary Partition or LEBR of a Logical Extended Partition. By this way, each OS remains independent of each other. That is, boot programs (ntldr) of WinXP can remain in WinXPs partition and Win98 boot programs (io.sys, msdos.sys) can remain in its partition..

Since Third Party Boot Loaders are independent of OS, they support all type of OSes like Windows, Linux, Unix, BeOS etc. A good Boot Loader is XOSL, which has a graphical interface and supports upto 24 OSes and it can also boot OSes installed in Logical Partitions. Booting Process Intoduction When a computer starts up ( obviously by pressing the power button), the first thing that occurs is it send a signal to motherboard which in turn starts the power supply. After supplying the correct amount of power to each device, it send a signal called "Power OK" to BIOS which resides on motherboard. Once the BIOS receive the "Power OK" signal, it starts the booting process by first initializing a process called POST (Power On Self Test). POST first check that every device has right amount of power and then it check whether the memory is not corrupted. Then it initialize each devices and finally it gives control to BIOS for further booting. Now the final process of booting begins. For this the BIOS first find 512 bytes of image called MBR (Master Boot Record) or Bootsector from the floppy disk or hard disk which is used for booting. The priority of boot devices is set by the user in BIOS setting. The normal priority is floppy disk first, then hard disk. Once BIOS finds the bootsector it loads the image in memory and execute it. If a valid bootsector is not found, BIOS check for next drive in boot sequence until it find valid bootsector. If BIOS fails to get valid bootsector, generally it stops the execution and gives an error message "Disk boot failure". It is bootsectors responsibility to load the operating system in memory and execute it. Master Boot Record A device is "bootable" if it carries a boot sector with the byte sequence 0x55, 0xAA in bytes 511 and 512 respectively. When the BIOS finds such a boot sector, it is loaded into memory at a specific location; this is usually 0x0000:0x7c00 (segment 0, address 0x7c00). However, some BIOS' load to 0x7c0:0x0000 (segment 0x07c0, offset 0), which resolves to the same physical address, but can be surprising. When the wrong CS:IP pair is assumed, absolute near jumps will not work properly, and any code like mov ax,cs; mov ds,ax will result in unexpected variable locations. A good practice is to enforce CS:IP at the very start of your boot sector. ORG 0x7C00 jmp 0x0000:start

start: or ORG 0 jmp 0x07C0:start start: On a hard drive, the so-called Master Boot Record (MBR) holds executable code at offset 0x0000 - 0x01bd, followed by table entries for the four primary partitions, using sixteen bytes per entry (0x01be - 0x01fd), and the two-byte signature (0x01fe - 0x01ff). The layout of the table entries is as follows: Offset Size (bytes) Description 0x00 1 Boot Indicator (0x80=bootable, 0x00=not bootable) 0x01 1 Starting Head Number Starting Cylinder Number (10 bits) and

0x02 2 Sector (6 bits) 0x04 0x05 0x06 0x08 disk) 0x0C 1 1 2 4

Descriptor (Type of partition/filesystem) Ending Head Number Ending Cylinder and Sector numbers Starting Sector (relative to begining of

Number of Sectors in partition

Kernel Image Now we jump two steps ahead and look at where we want to go: Our kernel image. Your boot record would be easiest if it could just copy the kernel image from disk to memory and jump to some given offset. Unfortunately, unless you take extra precautions, your compiler adds all sort of startup code, relocation tables etc. To get a "flat binary" that can be loaded in this simple copy-and-run way, you have to tell GCC: gcc -c my_kernel.c ld my_kernel.o -o kernel.bin --oformat=binary Ttext=0x100000 The -c switch tells GCC to stop right after compilation, i.e. not to link the object file. The --oformat=binary switch tells the linker you want your output file to be a plain binary image (no startup code, no relocations, ...)

The -Ttext=0x100000 tells the linker you want your "text" (code segment) address to start at the 1mb memory mark. Since you do not link in any relocation tables, the linker has to resolve all references at link time, and has to know where the executable will be loaded to. You are of course obliged to load your kernel image to the correct offset, or the references the linker did set up will be invalid. The Linux Boot Process When a PC is booted it starts running a BIOS program which is a memory resident program on an EEPROM integrated circuit. The BIOS program will eventually try to read the first sector on a booting media such as a hard or floppy drive. The boot sector contains a small program that the BIOS will load and attempt to pass run control to. This program will attempt to read the operating system from the disk and run it. LILO is the program that Linux systems typically use to give users a choice of operating systems to run. It is usually installed in the boot sector which is also called the master boot record. If the user chooses to boot Linux, LILO will attempt to load the Linux kernel causing the following basic events to happen: LILO will have a timeout period for the user to press the TAB key. If the user does not press the TAB key before the timeout occurs, LILO will run the default operating system selected when it was installed. If the user presses the TAB key, LILO will present the user with a choice of systems to boot from based upon the labels and images as set up in the /etc/lilo.conf file that controlled the last LILO install. This is very significant to system administrators. Let's say you have or want to install a multiple boot Linux or Linux/Windows system. Assuming you want LILO to control the boot process and you have two versions of Linux. They are Redhat, called rhl, and Slackware, called slackw. You may set each system to mount the others. Redhat will mount Slackware on a directory called /slackw and Slackware will mount Redhat on a directory called /rhl. If you want to be able to boot both systems and install LILO from Redhat, you will want your /etc/lilo.conf file to be similar to the following: boot=/dev/hda map=/boot/map install=/boot/boot.b prompt timeout=50 default=rhl image=/boot/vmlinuz label=rhl of OS (for the LILO boot menu) # Location of kernel # Name

root=/dev/hda1 partition read-only read only image=/slackw/vmlinuz label=slackw the LILO boot menu) root=/dev/hda2 partition read-only read only

# Location of root

# Mount

# Location of kernel # Name of OS (for

# Location of root

# Mount

Note that the Slackware kernel is located on the subdirectory /slackw which is where the Slackware operating system is installed on the Redhat system. Also be aware that the root locations may vary from system to system based upon the system configuration. The administrator will type "lilo" on the command line to install LILO after setting the configuration file up. If doing the same thing from the Slackware system, the configuration file would be as follows: boot=/dev/hda map=/boot/map install=/boot/boot.b prompt timeout=50 default=rhl image=/rhl/boot/vmlinuz # Location of kernel # Name

label=rhl of OS (for the LILO boot menu) root=/dev/hda1 partition read-only read only image=/vmlinuz label=slackw the LILO boot menu) root=/dev/hda2 partition read-only read only

# Location of root

# Mount

# Location of kernel # Name of OS (for

# Location of root

# Mount

Since the Linux kernel is installed compressed, containing a small program to de-compress itself, it will uncompress itself.

If the kernel recognizes that the system has a video card which supports some special text modes (such as 100 columns by 40 rows), Linux may ask which mode to use. The video mode and other options can be specified either during the kernel compilation or with LILO or the rdev program. Therefore the video mode can be preset, so the user is never asked. The kernel checks the hardware (hard disks, floppies, network adapters, etc), and configures some of its device drivers, while outputting messages about its findings. See an example boot output below: LILO boot: Loading linux. Console: colour VGA+ 80x25, 6 virtual consoles Calibrating delay loop... 166.71 BogoMIPS Memory: 62720k/65536k available (1008k kernel code, 412k reserved, 1052k data, 64K init) Checking if this processor honors the WP bit even in supervisor mode... OK. Buffer-cache hash table entries: 65536 (order: 9, 2097152 bytes) Page-cache hash table entries: 16384 (order: 4, 65536 bytes) VFS: Diskquotas version dquot_6.4.0 initialized CPU: Cyrix 6x86MX 2.5 Core/Bus Clock stepping 06 Checking 386/387 coupling... OK, FPU using exception 16 error reporting Checking 'htl' instruction... OK. POSIX conformance testing by UNIFIX mtrr: v1.35a (19990819) Richard Gooch (rgooch@atmf.csiro.au) PCI: PCI BIOS revision 2.10 entry at 0xbf0a0 PCI: Using configuration type 1 PCI: Probing PCI hardware Linux NET4.0 for Linux 2.2 Based upon Swansea University Computer Society NET3.039 NET4: Unix domain sockets 1.0 for Linux NET4.0 NET4: Linux TCP/IP 1.0 for NET4.0

IP Protocols: ICMP, UDP, TCP, IGMP TCP: Hash tables configured (ehash 65536 bhash 65536) Initializing RT netlink socket Starting Kswapd v 1.5 Detected PS/2 Mouse Port. Serial driver version 4.27 with MANY_PORTS MULTIPORT SHARE_IRQ enabled ttyS00 at 0x03f8 (irq = 4) is a 16550A ttyS01 at 0x02f8 (irq = 3) is a 16550A pty: 256 Unix98 ptys configured apm: BIOS version 1.2 Flags 0x07 (Driver version 1.9) Real Time Clock Driver v1.09 RAM disk driver initialized: 16 RAM disks of 4096K size PIIX4: IDE controller on PCI bus 00 dev 39 PIIX4: not 100%native mode: will probe irqs later ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:pio, hdb:pio ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:pio, hdd:pio hda: ST36422A, ATA DISK drive hdb: ST36422A, ATA DISK drive hdd: FX240S, ATAPI CDROM drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 ide1 at 0x170-0x177,0x376 on irq 15 hda: ST36422A, 6103MB w/256kB Cache, CHS=778/255/63 hdb: ST36422A, 6103MB w/256kB Cache, CHS=778/255/63 hdd: ATAPI 24X CD-ROM drive, 256kB Cache Uniform CDROM driver Revision: 2.56 Floppy drive(s): fd0 is 1.44M FDC 0 is a post-1991 82077 md driver 0.90 MAX_MD_DEVS=256, MAX_REAL=12 raid5: measuring checksumming speed

raid5: MMX detected, trying high speed MMX checksum routines pII_MMX p5_MMX 8regs 32regs : : : : 252.222 MB/sec 291.084 MB/sec

8K byte-wide RAM 5:3 Rx:Tx split, autoselect/Auto negotiate interface. MII transceiver found at address 24, status 7849. MII transceiver found at address 0, status 7849. Enabling bus-master transmits and whole-frame receives. Installing knfsd (copyright (C) 1996 okir@monad.swb.de). nfsd_fh_init : initialized fhcache, entries=1024 NET4: Linux IPX 0.38 for NET4.0 IPX Portions Copyright (c) 1995 Caldera, Inc. The text varies on different systems, depending on the system hardware, the version of Linux being used, and the configuration. The kernel will try to mount the root filesystem. The location of the filesystem is configurable at compilation time, with the rdev program, or with LILO. The filesystem type is detected automatically. If mounting the root filesystem fails, the kernel will panic and halt the system. The root filesystem is usually mounted read-only so that the filesystem can be checked while it is mounted. This feature can also be modified using the rdev program. It is not advised to check a filesystem already mounted as read-write. The kernel starts the program "init" which becomes process number 1. Init will start the rest of the system. DUAL BOOT A dual boot system is a computer system in which two operating systems are installed on the same hard drive, allowing either operating system to be loaded and given control. When you turn the computer on, a boot manager program displays a menu, allowing you to choose the operating system you wish to use. A boot manager works by replacing the original Master Boot Record (MBR) with its own so that the boot manager program loads instead of an operating system. Some popular boot manager programs are LILO, System Commander, and Partition Magic. Common combinations of operating systems used on dual boot systems include Linux and Windows NT and Windows 98 with one install of Windows being in a different language, such as Spanish. Since more than two operating systems can be installed on a computer, the term multiboot system is sometimes used. WindowsDualBoot Contents Introduction Back Up Your Data

176.403 MB/sec 116.967 MB/sec

using fastest function: p5_mmx (291.084 MB/sec) scsi : 0 hosts. scsi : detected total md.c sizeof(mdp_super_t) = 4096 Pattition check: hda: hda1 hda2 hda3 hda4 hdb: hdb1 RAMDISK: Compressed image found at block ) autodetecting RAID arrays autorun ... ... autorun DONE. VFS: Mounted root (ext2 filesystem) readonly. change_root: old root has d_count=1 Trying to unmount old root ... okay Freeing unused kernel memory: 64k freed Adding Swap: 128516k swap-space (priority -1) 3c59x.c:v0.99H 11/17/98 Donald Becker http://cesdis.gsfc.nasa.gov/linux/drivers/vortex.html eth0: 3Com 3c905B Cyclone 100baseTx at 0x6800, 00:10:4b:ca:db:a1, IRQ 10 8K byte-wide RAM 5:3 Rx:Tx split, autoselect/Auto negotiate interface. MII transceiver found at address 24, status 786d. MII transceiver found at address 0, status 786d. Enabling bus-master transmits and whole-frame receives. eth1: 3Com 3c905B Cyclone 100baseTx at 0x6c00, 00:10:4b:ca:db:b5, IRQ 11

Have a Windows recovery CD/DVD available Getting Recovery Media Install Ubuntu after Windows Install Ubuntu Automatic partition resizing (recommended)

Getting Recovery Media You may need to request a physical recovery/reinstallation CD or DVD directly from your computer manufacturer. Here are some resources: Dell Operating System (OS) Recovery CD Creation and Manual Operating System Reinstall Other related links and information for Dell owners

Manual partitioning Lenovo Product Recovery CD or DVD Master Boot Record and Boot Manager Getting recovery CDs from IBM for a Thinkpad Installing Windows After Ubuntu Recovering GRUB after reinstalling Windows Master Boot Record backup and re-replacement Issues with Windows XP and NTFS Using QtParted from the System Rescue CD Using GParted from UNetbootin-PartedMagic Also see External Links Introduction This page describes how to set up your computer in order to dual boot Ubuntu and Windows. Back Up Your Data Although this may seem obvious, it is important to backup your files to an external backup medium before attempting a dual-boot install (or any other hard drive manipulation), in case your hard drive becomes corrupted during the process. External hard drives, USB flash drives, and multiple DVDs or CDs are all useful for this purpose. Have a Windows recovery CD/DVD available Some computer manufacturers that pre-install Windows provide a Windows recovery/re-installation CD or DVD with the computer. However, many companies no longer ship a physical disc but instead create a hidden partition on the hard drive in which the recovery-disk information is stored. A utility is then usually provided which allows the user to burn a recovery/re-installation CD or DVD from it. If you are buying a new computer and intent on dual-booting, make sure you have (or can make) a physical Windows recovery/re-installation CD or DVD. If neither a CD/DVD nor a recovery partition/burning utility is provided by your computer manufacturer, you may need to telephone your vendor and ask for a CD or DVD (to which you are normally entitled under the Windows EULA). Alternatively, if you own a licensed copy of Windows Vista or Windows 7, you may download a system recovery CD that may be used to access a recovery console free of charge from NeoSmart Technologies. This CD can't be used to reinstall Windows in case things go majorly wrong, but it does contain the needed tools to set boot-related issues right. Install Ubuntu after Windows A Windows OS should be installed first, because its bootloader is very particular and the installer tends to overwrite the entire hard drive, wiping out any data stored on it. If Windows isn't already installed, install it first. If you are able to partition the drive prior to installing Windows, leave space for Ubuntu during the initial partitioning process. Then you won't have to resize your NTFS partition to make room for Ubuntu later, saving a bit of time. When a Windows installation already occupies the entire hard drive, its partition needs to be shrunk, creating free space for the Ubuntu partition. You can do this during the Ubuntu installation procedure, or you can see How to Resize Windows Partitions for other options. If you have resized a Windows 7 or Vista partition and cannot boot up windows, you can use the instructions from WindowsRecovery to fix it. Install Ubuntu Download an Ubuntu LiveCD image (.iso) from Ubuntu Downloads and burn it to a disc (see BurningIsoHowto). Insert the LiveCD into your CD-ROM drive and reboot your PC. Obtaining a Windows Recovery CD or DVD set for HP and Compaq PCs Once you have created a physical backup disc from a restore-image partition on the hard-drive, the restoreimage partition can either be removed or left in place. Ubuntu can be installed with it intact without problems.

If the computer does not boot from the CD (e.g. Windows starts again instead), reboot and check your BIOS settings by pressing F2, F12, Delete, or ESC. Select "boot from CD". Proceed with installation until you are asked this question: "How do you want to partition the disk?". If you have already partitioned the disk and left space for Ubuntu, install it to that and then follow the rest of the steps. Otherwise, choose one of the next two steps. Automatic partition resizing (recommended) Choose the first option, which should say "Install them side by side, choosing between them each startup". Specify the size of the new partition by dragging the slider at the bottom of the window. Click on "Forward". Continue on to Finishing Ubuntu Installation Manual partitioning Choose "Manually edit partition table". Listed will be your current partitions. Select the partition you want to resize and press Enter. Select "Size:", press Enter. Select Yes, press Enter. Type in a new size in gigabytes for your partition, it's recommended you free up at least 10 GB of free space for your Ubuntu install. Press Enter when happy with your changes. It may take some time to apply the changes. Create a swap partition of at least your amount of RAM (if you don't know, 2000 MB is a good value). Create a partition for your Ubuntu installation. Select "Finish partitioning and write changes to disk". Master Boot Record and Boot Manager GRUB2 is the boot manager installed in Ubuntu by default. If you use the Alternate CD you can choose GRUB or Lilo instead. GRUB2, GRUB and Lilo are open source boot managers that install the main parts of the boot loaders inside Ubuntu. This means Ubuntu is independent and avoids any need for writing to other operating systems. To accomplish this, the only thing in your computer outside of Ubuntu that needs to be changed is a small code in the MBR (Master Boot

Record) of the first hard disk. The MBR code is changed to point to the boot loader in Ubuntu. You will be presented with a list of operating systems and you can choose one to boot. If you do nothing the first option will boot after a ten second countdown. If you select Windows then GRUB or Lilo will chain-load Windows for you at the Windows boot sector, which is the first sector of the Windows partition. If you have a problem with changing the MBR code, you might prefer to just install the code for pointing to GRUB to the first sector of your Ubuntu partition instead. If you do that during the Ubuntu installation process, then Ubuntu won't boot until you configure some other boot manager to point to Ubuntu's boot sector. Windows Vista no longer utilizes boot.ini, ntdetect.com, and ntldr when booting. Instead, Vista stores all data for its new boot manager in a boot folder. Windows Vista ships with an command line utility called bcdedit.exe, which requires administrator credentials to use. You may want to read http://go.microsoft.com/fwlink/?LinkId=112156 about it. Using a command line utility always has its learning curve, so a more productive and better job can be done with a free utility called EasyBCD, developed and mastered during the times of Vista Beta. EasyBCD is very user friendly and many Vista users highly recommend it. Installing Windows After Ubuntu Normally when Windows is installed after Ubuntu the "Master Boot Record", MBR, will be overwritten. You can bootup off a LiveCD and repair the MBR. However, there are 2 different approaches: Recovering GRUB after reinstalling Windows Please refer to the Reinstalling GRUB2 guide. Master Boot Record backup and re-replacement Back-up the existing MBR, install Windows, replace your backup overwriting the Windows boot code: Create an NTFS partition for windows (using fdisk, GPartEd or whatever tool you are familiar with) Backup the MBR e.g. dd if=/dev/sda of=/mbr.bin bs=446 count=1 Install windows Boot into a LiveCD Mount your root partition in the LiveCD Restore the MBR e.g. dd if=/media/sda/mbr.bin of=/dev/sda bs=446 count=1 Restart and Ubuntu will boot

Setup grub to boot windows Issues with Windows XP and NTFS The Ubuntu installer has included support for resizing NTFS partitions since Ubuntu 5.10 (Breezy Badger) was released way back in 2005. Very few problems have been reported relative to the huge number of times that the installer has been used. If you tried the above procedure and have had no luck, it might be that there is a pre-existing problem either in the file system, in the partition table or the hard disk. First you should try running CHKDSK before trying again to resize the partition, and if you are using the Alternate CD, defragging might help. It is recommended that you run CHKDSK once again after resizing your NTFS partition. Also, try the following alternative methods: Using QtParted from the System Rescue CD Boot into Windows and backup any valuable documents/photos etc onto removable media such as CD-R/DVD-R. Run the Windows disk check tool (Error-checking) on C: a couple of times (the results can be seen in the Administrative Tools > Event Viewer > Application under a "Winlogon" entry). Run the Windows defragmentation tool on C: Download the System Rescue CD ISO image (321 MB; has several very useful software tools). Burn the ISO image to a CD. Boot from the CD and hit Enter when you see the message "Boot:". When you get a command prompt, enter: run_qtparted Select your disk on the graphical screen (most likely /dev/hda). Select your NTFS partition to be resized (most likely /dev/hda1). Right click with the mouse and choose Resize. Set the new partition size. Commit your changes in the File -> Commit menu. If your keyboard and mouse stop responding during resizing then please just be patient. Once your changes are saved, remove the System Rescue CD and insert your Ubuntu installation CD.

Reboot and install Ubuntu into the free space. Using GParted from UNetbootin-PartedMagic Another approach to resizing partitions, which does not require a CD, is to load PartedMagic from Windows via the UNetbootin PartedMagic Loader: Download and install the Windows (.exe) file, then reboot. Select the UNetbootin-partedmagic entry after rebooting, and wait as PartedMagic boots up. Start the partition manager by clicking the GParted icon on the the panel. Select your disk (probably /dev/sda) via the drop-down menu on the top-right corner of the interface. Right-click the NTFS partition to be resized (probably /dev/sda1), and select the "resize" option. Drag the slider to specify the new size the NTFS partition should be resized to, then press OK. Press the "Apply" button to resize the disk, then reboot once done. Upon the next Windows boot, click OK when prompted to remove UNetbootin-partedmagic to remove its boot menu entry. Dual Boot Your Pre-Installed Windows 7 Computer with XP So you got your shiny new pre-installed Windows 7 computer over the holidays, but you want to have trusty XP standing by in a dual boot setup. Today well walk through creating a new partition in Windows 7 then installing XP on it. In this process we are going to shrink some free space on the Windows 7 hard drive to allocate toward a new partition. Make sure to take a moment and decide how much space to use for the XP partition. Make sure you have enough space on your hard drive for files youll be adding to each. Create a New Partition The first thing we need to do is create a new partition on the Windows 7 machine. Luckily we can do it without any 3rd party software. To begin, click on Start and type either partition or disk management into the search box and at the top of the menu click on Create and format hard disk partitions.

Install XP on the New Partition Now that you know how to create a new partition on your Windows 7 machine, its time to install XP on it. Here were installing XP Professional on the new partition. Boot from the XP installation disk and start the install process. When it comes to choosing a partition, make sure you select the one you created using the steps above. In this example we made a 10GB partition for the XP install. If the partition you created was already formatted as NTFS you can leave it, or you can choose the FAT file system if you want. Basically you continue through as if you were doing a clean install on any hard drive. Create Boot Loader Once installation of XP is successful you can now go through and install the latest Microsoft Updates and drivers. You will undoubtedly notice that the machine is booting directly into XP at this time. This is due to XP writing its bootloader over Windows 7s. To get both XP and Windows 7 as an option at the boot screen you can use the free utility EasyBCD 1.72 or their new 2.0 Beta. VistaBootPRO 3.3 (free version) will still work too which you can download here. VistaBootPRO is now called DualBootPRO and is no longer free, its $9.95 for a single user license. After getting the bootloader back you should see both XP and Windows 7 as options in the Windows Boot Manager. Conclusion If you want to set a default OS on your dual boot system, check out The Geeks tutorial on how to set it up. To download the EasyBCD 2.0 Beta, youll need to register with the NeoSmart Technologies Forum first. If youre hesitant to try out Beta software, EasyBCD 1.7.2 is also free and will still work as well. Of course there are other ways of creating a dual boot system, but this is the method I have been using and its simple and effective.

The Disk Management window opens, and from here we need to free up space on the (C:) drive Windows 7 is installed on. Right-click on the drive and select Shrink Volume. A window pops up showing the drive is being queried for available space. Now enter the amount of space you want to shrink the volume. Youre shown the total size of the disk and the amount of size that is available to shrink. In this example were freeing up 40GB of space. After the process completes youll see the new Unallocated space. Right-click that and select New Simple Volume. The New Simple Volume Wizard launches which is a straight forward process. When you get to the Format Partition section, NTFS is selected by default as the file system and you can leave that as is. You might want to rename the Volume label something else like XP Partition so its easier to identify when installing XP. Also youll probably want to make sure to check Perform a Quick Format. After the format is complete you will see the new volume as a healthy partition listed. Now when you go into My Computer youll see the the new disk and notice that space has been taken away from the (C:) drive Windows 7 is installed on.

Vous aimerez peut-être aussi