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 Linux Ubuntu 10.04 (Lucid Lynx) on Windows 7 computer (Win7 installed first and Linux's GRUB2 on Linux partition controlling startup)

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 be installed on the Linux partition and put in control of startup (not Windows' BCD). You can then select either OS from a menu during bootup. No data loss will occur and a third-party boot utility is not used.

If you prefer to overwrite the Windows-created MBR, you should go to this page.
If you just want a simple method to try Ubuntu for a period, you should go to this page

In this procedure you need to create a Primary partition for Linux Ubuntu because that partition must be marked as Active. You will also need a Logical partition for the Linux Swap area. If you already have three Primaries (including a System Reserved) then you should consider writing GRUB2 to the MBR (previous link) or allow Windows to continue controlling the startup (read this page).

In creating this dual-boot you need to shrink the Windows 7 drive to make room for Linux. You must then create a formatted partition for Ubuntu 10.04. This partition will later be deleted during the Ubuntu setup and recreated under Ubuntu. For this reason you are advised 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.



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).
    While in Disk Management, create and Format a new Primary partition using all the Unallocated space.
  3. Start installing from the Ubuntu CD and select "Specify Partitions manually (advanced)" in "Prepare disk space".
    Delete the new partition.
    Create Ubuntu (Primary) partition (use / for Mount Point) - leave enough space for the Swap,
    and then create the Swap (Logical) partition in the rest of Free Space - use Swap Area for Mount Point.
    Click the Advanced button and install GRUB on the Linux partition, like /dev/sda3. Install Ubuntu.
  4. Only Windows boots for now.
  5. Boot from the Ubuntu Live CD and select "Try Ubuntu ...".
    Use GParted to mark the Linux Primary partition Active. Restart computer.

That's it! Linux's GRUB2 boot loader menu will boot either Linux Ubuntu 10.04 or Windows 7 and the original MBR is unchanged. If you ever wish to return to a Windows-controlled startup, just use Disk Management to mark the originally active partition Active again - then, if you wish, you can use the free EasyBCD utility to add Linux to the Windows Boot Loader menu.

[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), New (20 GB, Primary, FAT32).

  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. Still in Disk Management, right-click the new Unallocated disk area, and select New Simple Volume.
    Use all the available space to create a new Primary partition and Format it with FAT32 (for easier identification).
  4. 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, identify and highlight the new FAT32 partition (it should be the bottom one)
    and click the Delete button. This will create free space. Next create a partition for Ubuntu.

    Highlight the newly created free space, and click the Add button.
    The Create partition window will open.
    • In Type for the new partition (if present), select 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 but do not click Install yet.
    • 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. We do not want that. We need to install GRUB to the Ubuntu partition.
      • In the drop-down, select the partition where Ubuntu will be installed, like /dev/sda3 or /dev/hda3
    • 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 will place GRUB2 at the start of the EXT3 partition.
     
  7. Restart computer when installation is complete. Window 7 will boot normally.
    We now need to make the Linux partition Active.

D. Make the Linux partition Active

  1. Bootup from the Linux Ubuntu 10.04 live CD and select Try Ubuntu ....
  2. Run GParted (in System > Administration) when Ubuntu is running from the Live CD.
    • Right-click the Linux EXT3 partition.
    • Select Manage Flags.
    • Tick (to enable) the boot check box
    • Click Close. Exit GParted.
  3. Restart computer. You will be presented with a Linux Boot Loader menu containing both operating systems.

Congratulations! You have created a natural dual-boot of Windows 7 and Linux Ubuntu 10.04 when Windows 7 was installed first, the Linux GRUB2 Boot Loader is now in control, and the original MBR is unchanged.

[top of page]

Remove/Uninstall Linux and reclaim space

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.

  1. Boot to Windows 7
    and open Disk Management (right-click Computer, select Manage, click Disk Management).
  2. To change the location of the Active flag marker.
    • Right-click the partition that was originally marked Active
      • If you have a System Reserved partition then that's it.
      • Otherwise it's probably the partition containing the C:\Windows folders & files.
    • Click Mark Partition as Active and click Yes to the caution.
  3. Now reclaim hard disk space.
    • 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]

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. Windows 7 will boot again if you execute the following procedure.

  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 Language and then Time....
    • Select Repair your computer (bottom left of the Install now screen).
      An automatic check of your system will run.
    • Click Repair and restart
      Windows 7 should boot normally (very likely). If not, continue here.
  2. Bootup from the Windows 7 installation DVD again
    • Select Repair your computer again.
    • In System Recovery Options, highlight Windows 7, and click Next.
    • Click Startup Repair.
    • Click Finish when it's complete, and then Restart.
    • You must let CheckDisk run if requested.
      Windows 7 should boot normally.

If still stuck for a solution, boot again from the installation DVD, select Repair your computer, highlight Windows 7, get to a Command Prompt, use DIR command (DIR C: or DIR D: etc.) to identify drive letter allocations (sizes and Labels will help), and type in:
bootrec /FixMbr
bootrec /FixBoot
bootrec /RebuildBcd
X:\boot\bootsect.exe /nt60 C:
  (where X: is your DVD drive letter, and C: is the installation drive for Windows 7).
EXIT, and click Restart. Remove the DVD.

[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