Dual-booting all versions of Windows and Linux
How to Multi-boot Windows XP/2K + XP + Ubuntu Linux leaving GRUB in control (one XP/2K installed first)
Last reviewed: September 2008
On this page:
About adding an extra Windows and Ubuntu
This page shows how to correctly install a second Windows XP and then Ubuntu (v8.04) on a computer that already has a Windows XP installed on it. A triple multi-boot of Ubuntu + XP + XP is created with Linux's boot manager (GRUB) in charge of the boot menu. The original Windows XP installation will remain intact in all regards (but on smaller hard disk space unless you use a second hard disk). No commercial utilities are required. The Master Boot Record (MBR) may, or may not, be overwritten depending on where you install Linux's boot loader (GRUB) but GRUB will still be in control.
This page refers to a computer with Windows XP installed. However the original Windows can be Windows 2000 (2K).
When you then boot your computer you will be presented with a boot menu like this :
Ubuntu 8.04.1, kernel 2.6.24-19-generic
If you prefer to keep the existing Windows boot manager (NTLDR) in charge of the bootup menu instead of GRUB, then do not continue here - switch to this page
If you continue here:
A single hard disk can be used if it has sufficient space for all three operating systems plus your present and future software and data. Otherwise a second hard disk must be used. The disk is repartitioned by Ubuntu's own totally-free partition utility, GParted (it's Linux-based but at least as good as the commercial PartitionMagic). You should give serious consideration to the sizes of new partitions before you start. If using two hard disks, the second disk should be in situ before you start.
Each booted Windows XP will appear to be on a C: drive even thought they are actually on different physical partitions. This is quite normal in dual and multi-boots and is desired by the majority of users. Each Windows XP will have its own boot files on its own partition.
In the example shown here, a single 160 GB hard disk was used. Let's call it about 150 GB in total size after Fdisk and Format. It started with a single NTFS partition that used the entire disk, had Windows XP Pro (32-bit) installed, and 110 GB free space. You must adjust the partition sizes in this example to suit your own requirements. The example allows for adding a 32-bit Windows XP to an existing 64-bit Windows XP installation (64-bit has not been actually tested yet by THPC but it will work just fine).
The procedure will be divided into four sections:
Where to Install the GRUB Boot Loader
There are two locations where you can install GRUB.
The first (this is the Default) is on (hd0) which is at the start of the first hard disk. This overwrites the existing Master Boot Record (MBR) of the first disk. However, if required at a later time, the original MBR can easily be restored by using Fdisk /mbr from MS-DOS or Fixmbr from the Recovery Console (read below). The MBR on (hd0) is the most natural location for GRUB. This is THPC's preferred choice because of the simplicity of its implementation and the relative ease of rectification. Restoring/reinstall GRUB here is also quite easy.
Your second choice is to put GRUB at the start of a Primary partition; to put it on (hd0,Y) where Y is the partition number as seen by GRUB. In this situation the original MBR remains untouched. This option is available in the Advanced button during Ubuntu installation. Be sure you select a Primary partition and that partition must not contain another bootable operating system. (hd0,Y) must be made the Active partition ('Boot'). However if (hd0) is later made Active, then GRUB will be ignored and the Windows XP will boot again just as before you made any changes. Many users select the EXT2/3 partition and prefer this method as the MBR is not over-written. Restoring/reinstall GRUB here is marginally more difficult.
In both cases, read Remove GRUB, undo changes, and return to Windows only below to learn how to return to your original Windows-controlled system.
Note for users wishing to use both 64-bit and 32-bit Windows
Installing a 64-bit Windows XP on a system already containing a 32-bit Windows XP is never a problem - provided it has 64-bit hardware! Just install the 64-bit on a different partition and a dual-boot will be created automatically.
In the procedure below there should not be any problem installing a 32-bit Windows XP on a system already installed with the 64-bit version and there should not be any need to take precautions. The existing 64-bit Windows XP partition will be hidden prior to installing the second XP and unhidden later. The second Windows XP is installed as a totally separate OS. A Windows XP + XP dual-boot with shared boot files is never created. When installed, GRUB identifies each Windows XP as a distinct OS and then correctly shows each as a separate boot option.
Summary of Procedure (Advanced users)
Preparation: Matters you must or should attend to before you start
PART 1: Resize the existing hard disk partition without installing anything
The existing 150 GB Primary partition will be resized to 90 GB leaving 60 GB unallocated (free space) towards the end of the hard disk. A new 40 GB NTFS Primary partition will be created at the beginning of the free space (for the new XP installation). The unused 20 GB space will initially be left Unallocated for the Ubuntu Linux installation partition (19 GB) plus its Swap file partition (1 GB). If you want a shared partition, you should allow for that when creating the partitions - you'll probably need to replace the final Primary partition with an Extended partition (containing two or more Logical partitions). All the numbers are approximates and are for example purposes only.
PART 2: Install the second Windows XP
PART 3: Install Ubuntu Linux
When booted to Windows XP_1, remember to re-enable Virtual Memory, and also Hibernation if disabled.
"Checking file system on C: ... " (Chkdsk) should run during the first boot of Windows XP_1. Let it do so and be prepared for the inevitable reboot when it's finished. Windows is adjusting itself to the changes in the hard disk geometry and that's important!
"System Settings Change ('Windows has finished installing new devices') may appear the first time either Windows XP boots. Restart when requested for same reason as the previous item.
If the Ubuntu username/password requests annoys some home users, go to 'System > Administration > Login Window' in Ubuntu and enter your password. Click the Security tab, check the Enable Automatic Login box, and don't forget to select your username in the User: dropdown. Now click the Close button. However, remember that a good password will be very importance if you ever start using SSH networking!
If you wish to have a partition that can be shared between Linux and the Windows XPs or between the two Windows, you need to make more free space early in above procedure. Then you leave more free space when creating the EXT3 partition. Finally, your last (4th) Primary partition is not created.
You create an Extended partition instead of a Primary. This Extended partition can now contain two or more Logical partitions, the Swap (800 MB) partition and another Logical partition for sharing (using FAT/FAT32/ NTFS depending on your needs). Some users use a shared partition for items like My Documents - useful especially if mixing 64-bit and 32-bit Windows!
Remove GRUB, undo changes, and return to Windows only
It's essential that you know how to return to your starting position in the event of a change of mind or perhaps even a mishap. The following procedure will return you to your original Windows XP booting alone with the Windows boot loader (NTLDR) in control again.
Two items may need attention to achieve this.
Note: If you wish the second Windows to be bootable, then make the second Windows' partition Active.
THPC suggests you should follow the sequence shown here i.e. first correct the Active flag and the MBR if necessary and later delete/resize partitions.
How to boot directly to Windows XP when GRUB was put on (hdX,Y) and not on the MBR (hd0)
In this situation the Ubuntu partition remains the Active partition irrespective of which was the last booted Windows.
The original MBR remains unchanged. Therefore, you simply need to make a Windows XP partition Active and then only that Windows will boot. There are a variety of ways of achieving this.
How to boot directly to Windows XP when GRUB was put on the MBR (hd0)
In this situation the Active partition is always that of the last booted Windows irrespective of when Ubuntu was last booted.
The aim here is make the XP_1 partition Active and to 'correct' the MBR on the first hard disk.
If the original Boot.ini file has gone 'missing', you can create a new Boot.ini by logging-on in the Recovery Console to the original Windows, and using bootcfg /rebuild at the prompt. When prompted for Load Identifier enter Windows XP 1, and for Load Options you can use /fastdetect (novices can read Bootcfg Command Usage).
How to retain a Windows Dual-Boot after Removing GRUB
Some users will wish to retain a Windows dual-boot after they have removed GRUB and Linux.
Finished. If you retained the second Windows and wish to dual-boot with the first, just reverse the above process.
How to restore or reinstall GRUB from a Ubuntu Live CD
You may for some reason wish to reinstall GRUB. GRUB can be easily returned to its original location with the following commands. It will be assumed that GRUB was installed on the MBR (hd0) of the first hard disk.
When you reboot, you will have the GRUB boot loader menu at startup.
Remember GRUB starts counting at 0
Notes for novices
Always note the sizes of partitions for accurate identification.
Please remember that you alone are responsible for the consequences of any changes you make to your computer hardware or software.
Copyright © LarryM 1998-2015 firstname.lastname@example.org