Vous êtes sur la page 1sur 4

Dual boot Ubuntu 7.04 with XP (Ubuntu 7.

04 already installed)

Install Windows XP

Once the CD has loaded, press Enter to install Windows XP, then F8 to accept the license agreement.

When the partition screen loads, you can see that Windows Setup can see the two existing Ubuntu
partitions and has interestingly assigned them drive letters (even though it can't read them.)

The space we’ve just created is also there, so select that and hit Enter.

Because the primary active partition (/dev/hda1) has been marked as bootable, Windows can’t be
installed until this partition has been marked inactive so that the new partition can take over. This is
pretty much the same as installing Windows Vista. Hit Enter to make this change and then format the
new partition.

Unfortunately because XP detected the two Ubuntu partitions and assigned them drive letters, the new
partition which Windows is going to be installed on will be assigned drive letter F:, which is definitely
a non-standard drive letter for Windows.

However, it’s not that much of a problem – at least as far as Windows and therefore most other
intelligent applications go.

It could be a problem for older apps which don’t look to the Windows settings and make assumptions
about where they can install themselves (for example, apps that are hard coded to install to Drive C).

Reboot the system once Windows is installed and you’ll see that it boots straight into XP. Ubuntu’s
GRUB bootloader in the MBR (Master Boot Record) has been overwritten, so Ubuntu isn’t bootable at
this point in time.

There are ways to make the Ubuntu partition bootable while still using XP’s bootloader in the MBR.
However this is fiddly and involves using FAT32 partitions, as FAT32 is readable by both XP and
Ubuntu. Wherever possible I avoid using FAT32 – it’s nowhere near as optimised as NTFS, and you
lose out on all the enhanced security and permissions features.

Reinstating GRUB as the system bootloader is a much better alternative – it handles pretty much any
operating system you care to throw at it, and it’s very easy to administer.
Reinstall GRUB to the MBR

The next step is to reinstate GRUB as the system bootloader. Boot the system using the Ubuntu Live
CD.

Go into the GNOME Partition Editor and you can see that the Windows XP Partition is detected as
/dev/hda2 and has been marked as the boot partition.

It can actually stay as the boot partition, but as we’re going to reinstall GRUB it makes sense to change
this – it doesn’t adversely effect XP.
Right-click the Windows partition and select Manage Flags.

Untick “boot” and select Close.

Then right-click the primary Ubuntu partition (/dev/hda1), select Manage Flags and tick “boot”, then
Close. Done.

GParted - Manage FlagsGParted - Manage Flags

GParted - Mark BootableGParted - Mark Bootable

Now to reinstall GRUB. Open up Terminal (Applications, Accessories, Terminal) and type in:

sudo grub

GRUB - sudo grub

This will launch the GRUB application. Now type in:

find /boot/grub/stage1

GRUB - find grub

This will search for where GRUB has been installed, and you should get the result hd(0,0).

Change the active root to this location by typing in:

root (hd0,0)

Now we’re going to reinstall GRUB to the MBR rather than the Ubuntu partition.

If we were going to use the Windows XP bootloader then we’d reinstall GRUB to hd(0,0), but as we’re
not, type in:

setup (hd0)

GRUB - reinstall grub to MBR

This restores GRUB to the MBR. Type in QUIT and then EXIT to get out of GRUB and Terminal
respectively, then reboot the system. Ubuntu will load by default.
Modify the Boot Menu

What we need to do now is modify the GRUB boot menu to allow Windows XP to load. Boot the
system into Ubuntu and go to Terminal. Type in:

sudo gedit /boot/grub/menu.lst

GRUB - MENU.LST

This loads the GRUB menu file (which is basically a text file) within GEdit.

Navigate down to the section which after “## ## End Default Options ##".

These are the individual menu items in the GRUB menu.

Ubuntu & XP - GRUB MenuUbuntu & XP - GRUB Menu

To create a new entry, navigate down to the end of the list (although it can go anywhere really) and
enter the following lines:

title Windows XP

root (hd0,1)

makeactivechainloader +1

GRUB - Windows XP boot option

This places an item in the boot menu to launch Windows XP from its own partition (hd0,1).

If you like, scroll up to the top of MENU.LST and find the line called TIMEOUT.

The numerical value assigned to TIMEOUT dictates how long you’ve got to go into the boot menu (in
seconds) before the default boot item loads.

When configuring a dual-/multi-boot system I find it better to increase this value.

GRUB - timeout
Just above TIMEOUT is DEFAULT. This specifies which boot entry is the default.

The numbering system starts at 0 and counts upwards, so the DEFAULT = 0 means that Ubuntu is
always the default entry.

If you want Windows XP to be the default, replace the value.

GRUB - default

Save MENU.LST and exit from GEdit, then restart the system.

Hit ESC when prompted to bring up the boot menu, and there’s the newly-created Windows XP entry.

Navigate to this boot item and hit Enter – Windows XP will load.

Uninstalling Windows XP

If you decide after a while that this dualbooting situation is no good and you wish to scrap Windows
XP, it’s actually very easy.

Go through the process outlined above to modify the MENU.LST and remove the Windows boot entry.

Then boot off the Ubuntu Live CD and go into GNOME Partition Editor. Right-click the Windows
partition (/dev/hda2) and select Delete.

GParted - Delete Partition

Then right-click the main Ubuntu partition (/dev/hda1) and select Resize/Move.

Drag the edge of the partition to reclaim the space you’ve just freed up by deleting the Windows XP
partition and click Resize.

There will now be two actions waiting in the Operations window. Hit Apply and these changes are
made.

GParted - Remove Windows XP

This take your system right back to the start before Windows was installed, and is actually quite a
graceful exit from the dualboot scenario.

Vous aimerez peut-être aussi