TweakHomePC

Dual-booting all versions of Windows and Linux

   Dual-Boot    |    Win 8    |    Win 7    |    Vista    |    Win XP/2K/NT    |    Win9x/Me    |    How to    |    Legacy 9x Tweaks    |    SiteMap   


 

Here: Home > Dual-Boot > Dual-Boot Windows 7 with other Operating Systems >


Install Dual-Boot of Ubuntu 10.04 (Lucid Lynx) on Windows 7 computer (Win7 installed first and Linux's GRUB2 on MBR controlling startup after installation)

Last reviewed: May 2010

October 2013: This is the new location for this page on this site. Please update your link or bookmark.

Introduction

This guide shows how to correctly and safely create a natural dual-boot of Windows 7 and Linux Ubuntu 10.04 on a computer with Windows 7 already installed. The Linux GRUB2 boot loader will overwrite the existing MBR and will be in control of startup (not Windows' BCD). You can then select either OS from a Linux GRUB2 menu during bootup. No data loss will occur and a third-party boot utility is not used.

If you prefer not to overwrite the Windows-created MBR, you should go to this page.

In this procedure you can install Linux Ubuntu on a Logical partition if you prefer because that partition is not marked as Active. You will also need a Logical partition for the Linux Swap area.

In creating this dual-boot you need to shrink the Windows 7 drive to make Unallocated space for Linux. For this reason it's best to create the Ubuntu partition(s) at the end of the hard disk so you do not interfere with Windows' disk management of the rest of the disk.

32 and 64-bit versions of Windows 7 Home Basic, Enterprise and Ultimate were used in testing so this will also work with Windows 7 Premium and Professional. The computers used were (1) a 32-bit Dell Optiplex with Pentium 4 (2.26GHz), 1.5 GB RAM, 160 GB ATA hard disk, and (2) AMD Athlon 64-bit (2.4GHz), 2.0 GB RAM, 1 TB SATA hard disk.

Following these instructions correctly should always succeed. However, any change to your computer should not even be considered unless your have a rescue plan. This guide also contains that rescue plan - just in case!

The procedure used is suitable for moderately experienced computer users.

If you just want a simple method to try Ubuntu for a period, you should go to this page


Important Installation Notes

Shrinking a Windows 7 or Vista drive
If possible, you should avoid resizing a Windows 7 or Vista partition with a third-party partitioning utility like GParted. Windows partition editors often use different disk geometry than that used in Linux. Therefore resizing a Windows partition outside of Windows control could sometimes make Windows unbootable.

Shrinking a Windows 8, 7 or Vista drive. You should use Shrink in Windows' Disk Management to resize the Windows partition. You can read Shrink the Windows 8. 7 or Vista Partition for instructions on completing this task successfully. Use the free GParted Live CD to gain disk space only if you must - read the page Use GParted to Resize the Windows 8, 7 or Vista Partition to learn how.


SUMMARY of Procedure (Advanced Users)

  1. Backup.
  2. Create sufficient Unallocated space for Ubuntu 10.04 at end of Windows disk (use Shrink in Disk Management).
  3. Start installing from the Ubuntu CD and select "Specify Partitions manually (advanced)" in "Prepare disk space".
    Create Ubuntu (Primary or Logical) partition (use / for Mount Point) - leave enough space for the Swap,
    and then create the Swap (Logical) partition in the rest of Free Space.
    Click the Advanced button and confirm GRUB will be on the partition currently Active, like /dev/sda or /dev/hda.
    Install Ubuntu and then restart computer.

That's it! Linux's Boot Loader menu will boot either Linux Ubuntu 10.04 or Windows 7 and the original MBR has been overwritten by GRUB2's.

[top of page]

STEP-BY-STEP: Install Linux Ubuntu 10.04 when Windows 7 is installed first

Installing other operating systems on your Windows 7 computer may invalidate your warrantee.

It's important to follow the instructions exactly as stated and you should have a properly working Windows.


Requirements

  • Installation CD/DVD for Linux.
  • 1 download.
  • A first hard disk that uses only NTFS and contains a properly working Windows 7.

A. Make your preparations

  1. Backup important data before making any changes to a partition. You can burn files to a CD, clone an image of your hard disk, copy files to a USB flash/pen/thumb drive, or use an USB external drive (a good choice)
  2. Download the 700 MB Ubuntu 10.04, standard or 64-bit version from www.ubuntu.com (or request the totally free CD). You can use the free and excellent GetRight download manager to help with the large download. Create the Ubuntu Live CD from the downloaded .ISO file.
  3. Disconnect all unnecessary external devices before you start.

B. Make disk space available for Linux Ubuntu

The single 160 GB disk usually used in testing initially had: System Reserved (100 MB, Primary, Hidden, NTFS), Windows 7 (150 GB, Primary, NTFS). The Windows 7 drive was shrunk leaving about 20 GB Unallocated space at the end of the disk (to the right) and a partition created there and Formatted. After repartitioning it had: System Reserved (100 MB, Primary, Hidden, NTFS), Windows 7 (130 GB, Primary, NTFS), Unallocated (20 GB).

  1. Restart computer correctly (close all programs before you Restart computer).
  2. Open Disk Management in Windows 7 (right-click Computer, select Manage, click Disk Management).
    • Right-click the Windows 7 volume, and click Shrink Volume.
      • In Enter the amount of space to shrink in MB: enter enough for Ubuntu and its Swap file.
      • Click the Shrink button (it may take some time!).
      If Shrink does not give you sufficient Unallocated space, read how to Shrink the Windows 8, 7 or Windows Vista Partition for instructions or use the free GParted Live CD. Then return here.
  3. Restart to Windows 7.
    • Open Disk Management and check that the change made is correct.

C. Install Linux Ubuntu 10.04

  1. Bootup from the Linux Ubuntu 10.04 live CD and select Install.
    (ignore any error during bootup - it cannot find any free space!).
    • In the Welcome screen, select your Language, and click Forward.
    • In Where are you, select your Time Zone, and click Forward.
    • In Keyboard layout, select your Country, and click Forward.
    • In Prepare disk space, select Specify Partitions manually (advanced), and click Forward.
      The Prepare partitions screen will open.
       
  2. In Prepare partitions, Highlight the free space, and click the Add button.
    The Create partition window will open.
    • In Type for the new partition (if present), select Logical or Primary.
    • In New partition size ..., select all available space less twice your RAM size (for Swap File). Allow less than twice the RAM size if you have a lot of RAM.
    • In Location for the new partition, select Beginning.
    • In Use as:, select EXT3 journaling file system.
    • In Mount Point, select / (a forward slash).
    • Click the OK button.
    Make sure the Format box is ticked for the new EXT3 partition and make sure the Mount Point is / (if not, right-click the EXT3 partition, select Change, and correct it).
    Make a note of the Device name allocated to the ext3 partition, like /dev/hda3 or /dev/sda3.
     
  3. Now highlight the remaining Free space, and click the Add button.
    The Create partition window will open again. Now create the Swap partition.
    • In Type for the new partition (if present), select Logical.
    • In New partition size ..., use all available space.
    • In Location for the new partition, select Beginning.
    • In Use as:, select Swap area.
      A Mount Point is not set for Linux's swap file partition.
    • Click the OK button.
    Click Forward when ready, or click Back a few times to remake them.
     
  4. In Who are you? enter and remember your username and password, optionally enable Log in automatically, click Forward.
    Deal with the Migrate Documents and Settings as suits you, and click Forward.
     
  5. Read the contents of the Ready to install window.
    • Click the Advanced button and the Advanced Options windows will open.
    • Make sure the Install boot loader box is ticked.
    • You'll see the Linux boot loader (GRUB) will be installed, by default, at the start of the first hard disk (/sda or /hda) replacing the Windows loader. That's what we want so leave it alone if it's correct.
    • Click the OK button to exit Advanced Options.
       
  6. Click the Back buttons if you're unhappy with your selections or if the previous OK button was greyed-out.
    Click the Install button when you're ready to install Ubuntu.
    Linux Ubuntu 10.04 will now install itself on the new EXT3 partition and GRUB2 will overwrite the current MBR.
     
  7. Restart computer when installation is complete. Windows 7 is now automatically a boot menu option.

Congratulations! You have created a natural dual-boot of Windows 7 and Linux Ubuntu 10.04 when Windows 7 was installed first, the original MBR has been overwritten by GRUB2 and the Linux Boot Loader menu is shown on bootup.

[top of page]

Repair Windows 7 Startup

You will not have any problem if you follow the instructions as stated above. However you might encounter some freak occurrence like a power failure during an installation. Also, Linux Ubuntu is wonderful, regularly updated, and it's free! Nevertheless you may wish to remove it at some stage. Removing Ubuntu and regaining its disk space is quick and painless.

Windows 7 will boot again as previously if you execute the following procedure.

Return boot control to Windows

  1. Bootup any Windows 7/Vista installation DVD or even from NeoSmart's free Windows 7 System Recovery Disk.
    It must be a 64-bit version if a 64-bit Windows is installed.
    • Press a key when you see Press any key to boot from a CD or DVD.
    • Select your Time... and click Next.
    • Select Repair your computer (bottom left of the Install now screen).
      An automatic check of your system may run.
    • In System Recovery Options click Command Prompt.
      At the prompt, type (it's not case-sensitive)
      bootrec /FixMbr
      EXIT
  2. Now click Restart and remove the DVD or CD.

Windows 7 will boot normally and without any boot menu if none existed previously.

Reclaim the hard disk space used by Linux

  1. First make sure Windows controls the startup (see previous item).
  2. Boot to Windows 7
    and open Disk Management (right-click Computer, select Manage, click Disk Management).
    • Right-click the Swap partition, select Delete Volume..., click Yes.
    • Right-click the Linux partition, select Delete Volume..., click Yes.
    • Right-click the Swap partition, select Delete Partition, click Yes - required for Logical partitions only.
    • Right-click the Linux partition, select Delete Partition, click Yes - required for Logical partitions only.
    • Right-click the partition to the left of Unallocated, select Extend Volume...,
      and click Next to use the maximum space for Windows, and then Finish.
      Alternatively, create a new partition in the Unallocated space and Format it.

In another a few seconds you will have all the Linux space back in Windows 7.

[top of page]

Related Reading

[top of page]

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 thpc@mail.com