How to dual-boot Ubuntu 12.04 and Windows 7

I am reading page: 1 2

Though you need to create at least three partitions for installing Ubuntu, I will create four just to show how it should be done if you want to have the home directory on a separate partition.

The boot partition is the first partition you want to create. The recommended size for it, is 500 MB. That is way too much for the actual disk space that will be used initially, but if you expect to use the system for a long time, spanning several updates, you need the extra space. The mount point should be /boot. And you want to keep the default file system – ext4. This is important because errors have been reported when using ext2 for the boot partition. OK.
Ubuntu 12.04 Create Boot Partition

The second partition will be the root partition. For this tutorial, I assigned 20 GB to it. Anything that is at least more than 75% above the recommended minimum of 4.4 GB should be good. The mount point should be /. Keep the default file system. OK.
Ubuntu 12.04 Create Root Partition

The third partition is for the home partition. Since this where any file you download or generate is stored, it should be assigned the bulk of the available disk space. Use /home as the mount point, and keep the default file system. OK.
Ubuntu 12.04 Create Home Partition

The fourth and last partition will be for Swap. This is disk space made available for the system to use as virtual memory whenever the need arises. Give it an appropriate size (4 GB or 4000 MB should be more than enough on any system). Select swap area from the Use as dropdown menu. OK.
Ubuntu 12.04 Create Swap Space

Back to the main Advanced disk partitioning tool window, you should see the partitions you just created, besides the existing ntfs (Windows 7) partitions. Because the first Ubuntu partition was created as a logical partition (the installer does that by default), it is listed as sda5. This is the boot partition and it is where the boot files for Ubuntu will be installed, not in the MBR, which is the default. Note that installing GRUB in the MBR is the same as installing it in sda. This is what you see in the Device for boot loader installation dropdown menu. So what you want to do here, is select sda5 (our boot partition) from that menu.
Ubuntu 12.04 Install Bootloader MBR

When you are done selecting it, the window should look like this. click Install Now to continue with the rest of the installation process.
Ubuntu 12.04 Install GRUB sda5 Boot Partition

At the user account setup step, you might want to enable encryption of your home folder by enabling Encrypt my home folder. This does not afford you the same level of physical security as full disk encryption, but it is better than no encryption.
Ubuntu 12.04 Install User Account Setup

And you have the option of importing your settings from the Windows side to Ubuntu.
Ubuntu 12.04 Install Import Windows 7 Settings

After installation has completed successfully, reboot the computer. It should reboot into Windows. This is expected. At this point, Windows does not know that it is now sharing the computer with another operating system. The next step is to tell it, and modify its boot menu to reflect that fact.

The easiest program to use for this task, is EasyBCD, a free program by NeoSmart Technologies. There is a paid version, but for personal and non-commercial use, it is free. You may download it from here. Install it as you would any Windows 7 application. Start it. The main interface is shown in the image below. To begin the process of adding an entry for Ubuntu 12.04 in Windows 7′s boot menu, click on the Add New Entry tab.
Ubuntu 12.04 EasyBCD

Then on the Linux/BSD tab. From the Type dropdown menu, select GRUB 2, the version of GRUB used by Ubuntu 12.04. Click on the Add Entry button. Click on Edit Boot Menu tab to view the new configuration.
Ubuntu 12.04 EasyBCD GRUB 2

These are the two entries you will see every time you (re)boot the computer. The default is Window 7, but you can change it to Ubuntu 12.04 if you like. Exit EasyBCD and reboot.
Windows 7 Boot Menu EasyBCD

That is it. Like I wrote earlier, this was done on real hardware and in a virtual environment on first try, so I do not think that you will encounter any issues if you follow this tutorial step-by-step.

0saves
To have articles like this delivered automatically to your Feed Reader or Inbox, subscribe via RSS or email. For simple comments, use the commenting system, but for more involved assistance, please use the Question & Answer section.
I am reading page: 1 2

483 Comments

  1. rohsjalhez says:

    Help. i can’t “change” the sda2( C: ). there is no option of new partition .

  2. jinx says:

    Thanks for your detailed information. I could install Ubuntu 12.04 LTS with Windows 7 dual boot by myself without any problems.

  3. shridhar says:

    dear sir,
    i installed ubuntu 12.04 along with my windows 7 , initialy by dvd_RAM and there i gave install it ,,, i partitioned as per the website ,, and after all of that i boot and got windows there i installed EasyBCD and gave linuxUbuntu and GRUB2 options for boot and made ubuntu as my default boot loader.. then i restarted and selected ubuntu in that ….
    then i got BLACK SCREEN WITH SOME COMMANDS AND AT LAST
    “grub>”

    what i have to do??? please help me :)

    • LastDawnofMan says:

      I ran into very similar problems. I have two hdds and the easybcd INSISTS on setting my second hard drive as the location of the Ubuntu installation, even though it is not. I tell it to use the partition I created and it sees it, but once I save it it changes the Linux boot to point to that other hard drive. Apparently if I didn’t have the second hard drive, it would give me the empty prompt like you got. The author has either very luckily got some sort of configuration that just happens to work, or he did some other work that he didn’t mention, despite his claim to the contrary. I’m scouring the easyBCD forums for an answer to all this, apparently it’s a pretty common problem.

      • finid says:

        If you are dual-booting using 2 HDDS, you do not need to use EasyBCD. Just make the Ubuntu HDD the default boot disk from the BIOS.

        • LastDawnofMan says:

          I’m not using the other HDD as the “Linux” drive. I’m using it as a hot backup drive. Anyway, after much research, I’ve concluded that easyBCD is a buggy, unfinished mess and therefore completely pointless at this time.

    • finid says:

      Try using Boot Repair. See this link for details.

      • LastDawnofMan says:

        My problem, so far, is not that any part of my boot partitions are broken, it is that easyBCD recognizes EXT4 partitions, lets you select them when setting up a new boot point, then ignores the fact you did so and stupidly substitutes your selection to the next windows drive letter when you hit Save.

  4. John says:

    Really great guide, thanks! Before I start, I am a little hazy on the subject of the partitions mentioned:

    I have win7 as the primary OS today, and on the same disk I have an empty primary partition that I intend to use for Ubuntu 12x.

    Is the root partition a requirement if I intend to use Windows boot manager? Or could I just stick with two partitions for Ubuntu (boot = 20GB and swap = 8GB (double my RAM)), and still get the intended effect?

    • finid says:

      The root partition is required, so you can create just root and Swap, though it is highly recommended that you also create a separate boot partition. It makes it easier to troubleshoot stuff.

      You don’t need to double your RAM. 2 GB for a 32-bit system is enough, and 4 GB for a 64-bit system.

  5. ChochiWpg says:

    This guide worked perfectly for me on my Windows Vista system. I can now dual boot without issue and I am using the Windows Bootloader to control the dual boot process as opposed to GRUB.

    However, after running clamTK within Ubuntu on my Windows C:/ drive it found numerous threats which I then quarantined. Now when I boot into Windows none of my apps/programs function. I can boot up but almost all the apps won’t open and I can’t get a network connection.

    Prior to installing Ubuntu I created a full system image of Windows to an external drive. Can this image be restore without affecting the Ubuntu partition?

    If not, what is the easiest way to remove Ubuntu and resize the Ubuntu partition to give the space back to my C:/ drive. What I am looking to do is remove the Ubuntu partition, restore the system image and then reinstall Ubuntu again. Thanks.

    • finid says:

      From ClamTK’s home page, it is a “light-weight, on-demand scanner for Linux systems.” What’s the point of using it to scan a Windows drive?

      In any case, nothing you do on the Windows side will impact Ubuntu, unless you mess with the Ubuntu partitions. So go ahead and try to restore Windows from the backup image you created.

      • ChochiWpg says:

        ClamTK can be used to scan a Windows drive to verify if it is infected. It has been recommended by many websites when I was doing research, even in the Ubuntu forums. Examples below.

        http://lifehacker.com/5492593/use-linux-to-scan-unusable-windows-drives-for-viruses

        http://dwmallisk.blogspot.ca/2012/07/using-linux-to-rescue-windows.html

        Thanks I am glad that the Ubuntu partition won’t be affected. However, I made the system image prior to installing Ubuntu and partitioning my drives as per this guide. If I was to restore my image will the windows bootloader still recognize that I have 2 OS’s occupying the system? Or will I have to run EasyBCD again?

        • finid says:

          It should, but if not, you can always rerun EasyBCD.

          • ChochiWpg says:

            Thank you for your prompt responses. I will give it a try and report back. Much appreciated.

          • ChochiWpg says:

            So I ended up having to restore my Windows system image that I created prior to installing Ubuntu with this guide. It worked and got Windows back to how it was prior to the install, but it also completely deleted my Linux partitions in the process as well.

            So, I am going to have to follow this guide again, which worked great the first time around.

            I have a question though, I have an HP desktop computer with a primary C:/ Drive but also a Factory Image D:/ Drive. Would you recommend or is it safe to remove the D:/ Drive? I am using Vista. It’s 13GB in size and I could add it to the C:/ first before creating the Linux partitions. I just don’t know if this is recommended. Thanks.

          • finid says:

            Depends on what’s on D and if you’ve ever used it or will ever use it. Those factory-image drives tend to be recovery partitions, which tend to be rarely used. So determine what it’s for and if it’s worth keeping. If it’s not, you can just delete this and use the space for other stuff.

          • ChochiWpg says:

            I believe you are correct, the drive is used as the recovery partition for the system in case something goes wrong. I have never used the drive before or touched any of it’s contents.

            I was just wondering if it is safe to do so or recommended to remove? Can I backup this drive to an external hard drive or just create backup disks instead?

          • finid says:

            If you have an installation disk, I don’t see a real need for that partition. If you do, might as well delete it and reinstall if you ever need to.

          • Chochiwpg says:

            Thanks, I will create install disks and delete the partition. Appreciate all the help thanks.

  6. Samuel says:

    I noticed that for the Linux boot partition, you keep it as “logical”, whereas in the similar tutorial “How to dual-boot Linux Mint 13 and Windows 7″, you make it “primary”. What’s the best choice? Does it matter?

  7. Cliff Sutherland says:

    I have a Windows 7 machine and am trying to install Ubuntu 12.10 as a dual-boot. I can install Ubuntu within Windows 7 where it works fine, but I want to do real work with it (run Python and Sphinx primarily) so I need to partition it.

    My problem is that I cannot get my machine to recognize that I want to boot from my DVD (I have also tried a USB thumb drive, also no luck). When I go to boot options (F12), I try to put my DVD in the default position, but I can’t even find it in the list. When I run EasyBCD, it says that it knows exactly where the Ubuntu ISO resides, but it does not.

  8. Asutosh says:

    I have installed Ubuntu in my win 7 as per the instruction. However when I am booting by opting Ubuntu 12.04.Its directly going to grub. And Now what ??

  9. Vallabh Hendre says:

    I have made dual boot of Ubuntu 12.04 and Windows 7..!! And now my windows has got corrupted and I want to reinstall my windows 7. But i have my important project work on Ubuntu 12.04 OS, so are there chances of Ubuntu getting affected due to Windows installation? I have seperate partion for both Windows and Ubuntu, and i want my boot loader to load from Ubuntu and not from Windows.

    give me proper solution please its too important and urgent.

    • finid says:

      Not if it’s done right. But the first thing you do, is backup your data. Then proceed with the reinstallation of Windows, making sure to leave Ubuntu’s partitions untouched during the process.

      Note that after installation of Windows,, its boot loader will be installed in the MBR. So if you want Ubuntu’s boot loader to be the master boot loader, you will first have to be able to boot into Ubuntu, which means adding an entry for it in the Windows boot menu.

      After that, boot into Ubuntu and type sudo grub-install /dev/sda, followed by update-grub.

      You should then be able to have GRUB as your boot loader.

      • Vallabh Hendre says:

        Thanx for ur advice.. but didn’t got your point upto the mark.. if possible elaborate a bit easier.. m new for ubuntu..

      • gary knott says:

        I guess this means:

        1. reinstall win7, somehow restricting it to
        use its 2 partitions? (But these days win7 uses
        3 partitions! 1 system, 1 c-drive, 1 recovery.
        This is a big problem with the suggestions here
        about dual booting – win7 and hp or whoever uses
        up 4 primary partitions, probably with malice
        aforethought.)

        And you need a windows DVD; no-one
        has such a thing anymore. It would be helpful to tell how to create one at a time of one’s choosing.

        How to protect the Linux partitions?

        2. use easybcd in win7 to add linux as a bootable
        option.

        3. Boot into linux and replace the win7 boot program
        in the MBR with grub2. (But why, if we can now run Linux?)

        2.

  10. yash says:

    i have a dual boot windows 7 and xp machine (4 partition – 1st for 7, 2nd for xp , 3rd n 4th for my data) . Now i want to make a Dual boot win 7 and ubuntu 12.10, just want to ask what if i dont create four different partition as u told and install ubuntu directly into the 2nd paptition ??

    • finid says:

      You can install Ubuntu in partition 2 only after you delete it, which means deleting XP. Is that your aim? Are you willing to lose XP?

      If “yes,” you can then use the recovered space from the XP partition and use it to create logical partitions for Ubuntu.

      And note that in a dual-boot setup, it’s better to have three partitions for Ubuntu – /boot, /, and Swap. You can get away with just / and Swap, but those three work best.

  11. Emi says:

    Hi! I’ve made a stupid mistake: I thought this could work for Windows XP too. And it certanly did, except when you must tell windows that another operating system is installed using EasyBCD. The problem is that EasyBCD doesn’t work with XP only!

    How can I do now?! I’ve already installed my Ubuntu 12.04 but I can’t boot!

    =(

    • finid says:

      well, can you boot into Windows?

    • Emi says:

      Well, I’ve found the solution finally.

      You need to add a copy of the boot partition’s 1st sector to your C:\ folder and then add a line to boot.ini to tell Windows to execute the file. This is fairly easy.

      First, boot your linux CD and open a terminal.
      If your boot partition is sda5 type:

      sudo dd if=/dev/sda5 bs=512 count=1 > ubuntuMBR.bin

      Then copy the ubuntuMBR.bin file to your C:\ directory.

      Next, boot into XP and add a reference to ubuntuMBR.bin to the end of boot.ini. See: http://support.microsoft.com/kb/289022
      You need to add something like:

      C:\ubuntuMBR.bin=”Ubuntu”

      to the end of boot.ini.

  12. Razin says:

    i have send the screen shots to contact@. Check your mail.

    • finid says:

      I’ve replied. Check your email. Be going to bed in the next 15 minutes, so If you don’t reply within that time, expect an answer when I wake up.

  13. Razin says:

    I m having windows 7 n in that i have 4 partition.one for windows7,one for system(default),one for my data storage and one is totally blank in which i wan to install ubuntu.
    but when partition wizar came while installing ubuntu i was not able to see my partition.it only show system(deafault) and two other that i dont know.so i want to install ubuntu on that free partition so what can i do please help me.
    and sorry for my poor english.

    • Razin says:

      it shows
      sda
      sda1-1mb
      sda2-ntfs-208mb
      sda3-ntfs-157286mb
      sda4-ntfs342610mb
      i have 20gb partiton free on windows which doesnt appear here.

      • finid says:

        With that 1 MB sda1, it looks like the partitioning scheme that Windows 7 used is GPT-based. That’s likely why the Ubuntu installer cannot see the partitions.

        What edition of Ubuntu are you trying to install?

        • Razin says:

          Ubuntu 12.10 amd64 as i have 64 bit laptop.

          • finid says:

            Could you send me screen shots of the Advanced Partitioning Tool step of the Ubuntu installer and the Windows partition manager, so I can see the partitions fro both ends?

            If you can , see them to the email on my contact page.

        • francisco says:

          I ran into the same issue last night. What I found on another post helped me sort it out.

          what you want to do is backup your win7 isntallation and everything on it as you will need to install win7 again. I had no problems doing this as it was a clean install for me.

          then with ubuntu’s gparted application layout the partition scheme, make 2 nfts partitions for windows and any aditional partitions including one for ubuntu, mark your first partition as the boot partition (boot flag it), then install win7 to that partition, once that is completed you can pop the ubuntu disk in and ubuntu will recognized the partions you created with gparted (giving you the 3 options) and will allow you to then follow the rest of guide here. I spent hours trying to get to work out the gpt bug but I couldn’t so a full clean install with partition in gparted terms is what you need to get this to work. if there’s a simpler solution that can correct the gpt issue avoding having do to a repartitioning-reinstall for win7 I’d be happy to know.

Leave a Comment