Client Devices‎ > ‎Linux PC‎ > ‎

Dual Boot Ubuntu/Windows7

                                                                    

  • Dual booting a system will allow you to have two operating systems on one machine, oppose to having to run two separate machines if you wish to use a different OS. In this document i will explain how to dual boot Windows 7 and Ubuntu 12.04 on a machine with one 350GB hard drive.
  • Okay let’s get started. A successful dual boot will achieve two operating systems stored on one machine that allows you to boot to either of the two operating systems. In this case the machine that we are using already has Windows 7 installed on it so all that is left to do is install the second OS, Ubuntu 12.10.


Backup
  • Before starting your dual boot install it is highly suggested that you backup everything currently on your drive....better safe than sorry. During the dual boot process you will be making significant changes to your hard drive, making file loss probab. Take the extra time to backup and this can be avoided.

Getting Ubuntu:
  • To install the latest version of Ubuntu onto your machine you will need to create a live CD-DVD of the .iso image at  http://www.ubuntu.com/download.
  • If you need help on creating the disk image please see my .iso how to (.iso)
  • If you are comfortable with creating an .iso image, do so for the latest version of ubuntu.
  • Once the image has been created you are ready to move onto the next step.

Installing Ubuntu:
  • Insert your media with Ubuntu on it (Live-CD).
  • Power on system and boot from the proper device.
  • First Ubuntu will match your computer specifications with the install requirements, if requirements are met click continue.
  • You will then be brought to a screen that will look like the image below
  • This is where you will select which installation type you would like to proceed with.

Partitioning:
  • For a dual boot you may choose between a few methods of installing Ubuntu. The first way is to choose the “Install Ubuntu alongside Windows 7” option, which will run the automatic installer and partition the drive for you appropriately alongside of Windows. The other option, also the more 'advanced/user-control' option, is to select “Something else”. This is the more advanced installer, giving the user more control over partitioning. Which is a HUGE plus for many reasons we will discuss later on. In this document we will go over how to do the install using both methods and go into more detail about manually creating partitions during the install.
    • 'Install Ubuntu alongside Windows 7'(automated installer)
      • This option will walk you through the installation software just as it normally would. The only difference comes down to the partitioning. When you select this option partitioning is much more 'basic'.
      • This route is just as effective for establishing a dual-booting machine for basic everyday use.
      • The installer will ask you to fill out all of the basic user info.
        • Location/time
        • Keyboard Layout
        • Who are you?
      • A few steps in you will be brought to the disk partitioning section.
      • The installer will purpose to free up a certain amount of space on the drive, depending on drive size and amount of free space.
      • It will NOT try and free up any space that is already being used by Windows. Do not worry.
      • At the top of this window you will see a drop-bar field for 'Select drive:' and the default drive will be chosen already. Do not change this.
      • In the middle of the window you will see a diagram representing your drive, your windows partitions, and the new free space you wish to allocate.
      • You can drag the divider between the two to increase or decrease the amount of free space you wish to create.
      • All space freed up will be used for the Ubuntu partitions.
      • Click continue and fill out the remaining information.
      • NOTE: With this install type you can NOT select where you wish to install the bootloader. Therefore the Windows loader WILL be overwritten by GRUB when using this method of installing.


    • 'Something else'(advanced partition manager)
      • This option will still allow you to install Ubuntu without removing Windows 7. The only difference is with this method you are given a more advanced partitioning tool, giving you more control over how you want to implement partitions and specify things such as mount points and file types.
      • Most of these steps are the same as discussed in the method before. The installer will take you through a set of questions to acquire information about the system.
      • When you reach the partitioning section of the installer you will the advanced partition tool, image of the tool below:
      • Your manager will look a little different. The one above is of a fresh drive with nothing on it. You will see a few partitions listed, these are the windows partitions and should be left alone. If the file system is listed as NTFS or FAT the partition is for Windows. Leave it alone!
      • Creating Partitions:
        • First you will need to make free space available. It might already be unused, however you must select this space and delete it.
        • Once you freed up space you can begin to create partitions.
        • Select the proper drive, such as /dev/sda.
        • Do NOT select the drive that has Windows installed on it.
        • Select the free space.
        • Click 'Add'.
        • A small 'Create Partition' window will appear.
          • First decide if you want the partition to be primary of logical.
          • Specify a size for the partition.
          • Select which file system you wish to format the partition to in the 'Use as' drop-box.
          • Lastly specify at what point do you want the partition to mount such as /home, /boot, etc.
          • When creating a swap partition select 'swap area' as the mount point.
          • Click 'OK'.
          • (For more information on partitioning please see File Systems).
  • Once you have created all of your partitions there is one more thing you must do before moving on. You have to tell the installer where you want to put the bootloader for Ubuntu. By default it will be installed onto the first available drive, installing over the Windows 7 bootloader.  Since we have decided to use the Windows bootloader, we do not want this. We want to install it onto the same partition that Ubuntu is being installed on.
    • At the bottom of the window there is a drop down box listing all available device for the bootloader to be installed onto.
    • Select the correct partition.
    • This is where remembering the device names becomes important.
    • However, if you are not sure which device to install the bootloader on just refer to the partition table above in the same window and see which device matches the Ubuntu partitions file system and size.
    • We can now add Ubuntu to the Windows 7 bootloader list using EasyBCD. We will get to this shortly.
  • Click ‘Next’ and all modifications will be finalized.
  • You have now completed the installation process for Ubuntu.

Adding Ubuntu to Windows Bootloader Using EasyBCD
  • Now that both operating systems are on the machine it is time to add Ubuntu as a boot option to the BIOS upon powering on or restarting the system.
  • There are multiple different ways that you could achieve this. However, in this document only one method will be discussed.
  • We will be using EasyBCD, developed by NeoSmart Technologies, to add Ubuntu as a boot entry from Windows.
  • EasyBCD Community Edition screenshot 4EasyBCD is highly trusted and recommended by many for a ‘codeless’ way of adding  boot entries.
  • Assuming that you have just finished installing Ubuntu restart your machine, removing the media device used for the installation.
  • Boot into Windows.
  • Download EasyBCD.
  • Run EasyBCD
  • A small window will open asking to select a language followed by a larger window depicted in the image below.
  • Select the ‘Add New Entry’ tab.
  • EasyBCD supports a wide range of bootloaders including; SysLinux, Wubi, FreeBSD, LILO, GRUB, as well as GRUB2.
  • Select GRUB 2 as ‘Type’.
  • Name the entry.
  • By default the drive will automatically be located and loaded do not change this option.
  • Click ‘Add Entry’
  • The entry will be saved and can now be managed under ‘Edit Boot Menu’ where you can change things such as the default operating system to boot and timeout options
  • ‘Save Settings’ before exiting the program.
  • Restart.
  • You should now be prompted to choose which operating system you would like to boot upon powering on the machine.


Test/Repair
  • Congratulations, you have made it through the dual boot installation process! Now, I am sure that after all that work you are quite eager to dive into the fun but first I recommend making sure that everything went 'OK' during the install.
  • The first step to doing this is making sure that the bootloader is doing its job. In this case we are using the Windows 7 bootloader.
    • Windows 7 loader
      • Upon powering on your machine, BIOS should load first as expected (be sure the proper drive is selected to boot from since we booted from a separate device earlier for the install).
      • You should now be looking at a menu list of operating systems you are able to boot from. You should see Ubuntu 12.04 LTS and Windows 7.
        • If the BIOS does NOT direct you to this screen it means that no bootloader was found on the selected device. This could be because the Windows 7 loader was overwritten during partitioning. Do not panic. Insert your Windows disc and boot from it. When the disc loads you will see a "Repair your computer" option located in the bottom-left of the screen. Select this option. Next, select the proper OS installation (windows 7). Now you will brought to a screen matching the image bellow.
      • This is the System Recovery Options where you will be able to fix boot issues two different ways. Using the command line or using the automated repair tools.
          • For most problems you have with booting, including not being able to find the bootloader, the automated 'Startup Repair' can more than likely resolve the issue. However, if it is for some reason unable to repair the system we have the beauty of being able to open a command prompt.
          • Command Line: Below are the commands used to resolve booting issues.
            •  To restore a master boot record use the following:
                  • >bootrec /fixmbr
            • If in your case restoring the boot record is not enough to resolve the issue then you will need to write an entirely new boot sector into the system partition. You can use the following command to do this:
            • >bootrec /fixboot
          • Thankfully fixing this issues does not get to complicated in the command line and the problem should now be resolved.
          • Remove the repair CD and reboot the system.
      • You should now see the OS menu list in the bootloader.
      • Select Windows 7 and make sure you are booted into your system how you normally would.
      • Restart the system.
      • Next, confirm that Ubuntu can properly boot.
      • Select Ubuntu at the boot menu.
      • Wait for system to boot and log in.
  • Now you should be able to confirm that the install process went accordingly and everything is properly functioning. There is much more that can be done to ensure that your system is properly functioning but that is a whole other document and we wont go there right now.
  • I do suggest doing one more thing however. And that would be to check the partitions to be sure they are all there and are set to the right values. Sounds silly, a partition not being created somehow? The installer would not do that, right? Wrong. The install is not bulletproof, and it sure is not userproof. You never know when you have made a slight mistake until your /boot partition fills up and your systems rolls over, leaving you scratching your head. In other words, better safe than sorry.
  • To check the partitions I recommend booting from a live version of knoppix or something that allows you to use the 'GParted' tool.
  • Load GParted and check all the partitions to be sure they are correct.
    Overview/References
    • That concludes the dual boot installation. You should now have a system that can be booted between Ubuntu 12.04 and Windows 7. Below are a few sources I referred to while writing this document:
      • https://help.ubuntu.com/community/WindowsDualBoot
      • http://neosmart.net/EasyBCD/
   
Brian Brennan 1/21/13
Comments