How to dual-boot Windows 7 and Ubuntu 11.04

For those Windows users who have discovered what Linux has to offer, but for one reason or another are not ready to completely abandon Windows, dual-booting between the two operating systems is one method of keeping a foot in both worlds. And to help those users, this article presents a step-by-step guide on how to configure dual-booting between Windows 7 and Ubuntu 11.04 on a computer with one hard drive. The same steps may be used to dual-boot both between both systems on a computer with two hard drives.

In attempting to dual-boot between Windows 7 and Ubuntu 11.04, you will either install Windows anew, then install Ubuntu 11.04 alongside it, or install Ubuntu 11.04 alongside an existing installation of Windows. This tutorial uses as example, a case of installing Ubuntu 11.04 on an existing installation of Windows 7.

As shown in the image below, the existing installation of Windows 7 used for this tutorial has three primary partitions. And because of the limitations of the MBR partitioning scheme, only one primary partition is available for installing Ubuntu 11.04. By using an extended partition, we can configure as many partitions as we need for Ubuntu.
dualBoot3

To begin, boot the computer using a Ubuntu 11.04 CD or DVD. At the disk partitioning step, the installer will present several options. Because the installer will not automatically partition and configure the free space, using the installer’s advanced partitioning tool is the only method of creating the necessary partitions. To launch the advanced tool, select the “Something else” option, the click Forward.
dualBoot4

This is Ubuntu’s advanced partitioning tool and the detected partitions. The first three partitions are obviously the ntfs partitions that we saw in the first image. Because there are three existing primary partition, the last partition will have to be an extended partition, under which logical partitions for installation of Ubuntu will be configured.

Related Post  How to access Microsoft Windows files and folders from Linux

By default, Ubuntu’s installer configures two partitions – the first for /, the root directory, and the second for Swap. When creating partitions for installing any desktop Linux distribution, my recommendation is to create the following four partitions:
  • /boot, the boot partition. This is where programs critical for booting the system will reside.
  • /, the root directory. The bulk of the programs used for running the system will be installed here.
  • Swap, unformatted disk space for use as virtual memory.
  • /home, the partition where your home directory will be located. In the course of using the system, files and folders you create will reside in various folders here.

So, to start setting up these partitions, select the free space and click on Add. Note that this step will have to be repeated for all the partitions.
dualBoot5

The first partition will be for /boot. When setting up an LVM-based system using an Alternate Installer ISO image, the default disk space allocated to /boot is 258 MB. However, only about 22 MB of that is used, so anything thing between that size range will do. For this tutorial, the default will be used. The mount point will, of course, be /boot. The default file system is ext2. OK.
dualBoot6

The second partition will be for Swap. It is possible to install Ubuntu without Swap. However, if you attempt to do that, the installer will try to discourage you with the following warning:
swapwarn

For the record, I have been able to install Ubuntu 11.04 successfully without Swap. The sky has not fallen yet, but I have not tried to put the system in Suspend or Hibernate mode. In any case, save yourself a load of trouble and configure Swap. The suggested size for Swap is 2000 MB. Select “swap area” from the “Use as” dropdown menu. OK.
dualBoot7

The third partition will be for /, the root directory. The default journaling file system on Ubuntu 11.04 is ext4. You may stick with it or choose another journaling file system available. Btrfs is supported, but this partitioning scheme is not for btrfs. If you are interested, how to install Ubuntu 11.04 on a btrfs file system is a good place to start.

Related Post  How to configure encrypted LVM on Mandriva 2010 Spring

The installer recommends a minimum of 4.4 GB for Ubuntu 11.04, but on a new installation, less than 3 GB of disk space allocated to / is used. Note that as you install additional applications after installation, disk space used will grow, so be generous here. I think 10 GB should be more than enough. OK.
dualBoot8

The last partition will be for /home. The file system is ext4, and you may allocate all available disk space to it. OK.
dualBoot9

Related Posts

139 Comments

  1. Hi. In the step where you recommended installing GRUB in the /boot partition of Linux, I forgot to set it there and ended up installing it in the MBR. Is there any way to restore the windows bootloader and reinstall GRUB into the /boot partition? Thanks.

  2. Mote pandurang says:

    how to get back ubuntu after installing win7 in case of dual boot

  3. Pingback: Dual boot and partitions - Project Reality Forums

  4. Pingback: Grub installation fatal error in Ubuntu 11.10 installation | MoVn - Linux Ubuntu Center

  5. So I followed your partitioning steps (I unallocated about 20 gb from windows 7). But after completing installation and attempting to boot back into windows it crashed due to hardware changes. I’m fairly certain I didn’t overwrite any existing windows drives. How can I fix this so that I can run windows again?

  6. I had installed ubuntu 11.10 as main OS in partition, other than windows. But now i m not finding any option to boot windows. It just starts ubuntu, when i power on my laptop..
    Please suggest any solution. Thankyou..

    • Provide more details about the partitioning scheme you used and we just might be able to help you.

      How did you set up partitions for Ubuntu relative to Windows?

  7. If Windows 7 has two primary partitions , could I create /boot as primary partition?Is there any difference if I follow the tutorial and use logical partition ?
    Thank you very much.

    • You could create an extended partition for Ubuntu, and under it create logical partitions for /boot and any other partition you want to use for Ubuntu. That will leave you with 1 primary partition free.

      Or you could create /boot as a primary partition, and create the last partition as an extended partition, with the other Ubuntu partitions under it as logical partitions. This option will exhaust the number of primary partitions – 4 – that the system can support.

      either option will work.

  8. Hi
    Thank you for this great article,
    I have got a problem during the installation process. In the partitioning step my “free space” is inactive and it appears as “not usable space”
    any ideas please?
    Thank you

    • If it is not usable, it most likely means that you have 4 primary partitions configured already.

      If that is the case, you need to delete one primary partition and create an extended partition. That will allow you to create logical partitions for the installation.

      Note: Using an MBR partition table, the system cannot support more than 4 primary partitions.

  9. I followed the exact steps in this article by staring with a new Windows 7 installation. Then I installed Ubuntu 11.10 (not 11.04) with the same 4 logical partitions. I chose the bootloader to /boot but i was given a fatal error giving me the option to choose another location. Has anybody found a solution to this?

    • What is the exact error message? What is the size of your HDD?

    • Same here. What is the fix?

      Error: “It was not possible to install the bootloader at the specified location: /dev/sda5. This is a fatal error.” It then asks to choose a different location.

      • What is the size of the HDD, and how far from the start of the drive is the boot partition?

        • Hi,
          Tried to do the same operation, and got the same error message !. Tried also to create the boot partition as a primary partition, but no success !!

      • I had the “fatal error” on sda5 as well (on two separate installs). There was another thread elsewhere about this for Ubuntu 11.10. Changing the filesystem to ext4 fixed the problem. I’m too much of a linux newb to state whether or not there will be side effects from choosing ext4 over ext4.

  10. Hi mate,

    Does this setting lets you view your ntfs partition? lets say i have C(Windows Files System) and D(NTFS partition). Will I be able to see those 2 partition when im on ubuntu?

    Will it still work on 11.10?

    regards,

    Jake

    • Yes. When you open the file manager, both partitions will be listed on the (left) pane or panel. click on them and browse away. You can also copy files to and fro.

  11. Is there anyway to boot to Ubuntu without installing EasyBCD? I have a problem with windows so I can’t even get it to start up, much less install any programs on it.

    Thanks

    • I don’t want to assume anything. If you provide a little bit more info about your setup, it would make it a bit easier to help.

      • I followed all the instructions you provided, so I assume Ubuntu is installed correctly. I just do not know how to boot to it, as you instruct to install EasyBCD through Windows to be able to boot to Ubuntu, but I cannot install much less use Windows.

        In other words, is there any other way to boot to Ubuntu other than using EasyBCD?

        • How can I get the option to select Ubuntu or Windows when the computer is starting up? I only have the option to start Windows, nothing in the BIOS has Ubuntu visible to me.

          Is there a tutorial or simple solution to this (perhaps modifying GRUB)?

          • If you do not have access to Windows before you completed the installation of Ubuntu, then there is no easy method to get to Ubuntu.

            It is possible to boot the system with a Live CD and reinstall GRUB in a different location, but the easiest way to solve this problem, since you are not able to boot into Windows, is to reinstall Ubuntu and then install GRUB in the MBR of the hard drive. By letting the installer put GRUB in the MBR (Master Boot Record), you wipe Windows’ boot manager, but the installer will auto-add an entry for Windows 7 in GRUB’s menu, so that anytime you boot the computer, you will be presented a choice of which OS to boot – Ubuntu or Windows 7.

            Aside from that, it will also give you the opportunity to access your files in Windows when you boot into Ubuntu.

            I’m proposing this solution on the assumption that you are unable to boot int Windows.

          • If you installed Ubuntu on the same drive that Windows is on (as laid out in this tutorial), then you will only have the option to start Windows when the computer first boots. There is not setting in the BIOS that will enable you to boot Ubuntu. You will first have to modify Windows’ boot menu by adding an entry for Ubuntu on it.

            And the easiest program to get that done is EasyBCD. However, if you cannot boot into Windows (as you wrote in a previous comment), then the easiest method around that is to reinstall Ubuntu and install GRUB in the MBR.

    • If you used the same partitioning scheme as this tutorial, then you will need to have access to Windows to complete the dual-boot setup successfully.

      Without that, there is nothing you can do, short of reinstalling Ubuntu and installing GRUB in the MBR of the hard drive.

      • Thanks for the ideas. That’s what I was asking for, do you know any tutorials/sites that I can read/research that will show me how to install the GRUB to the MBR?

        As you said, that seems to be the best way.

        • Any way you can help me on this?

          • Sorry. WP ate my last comment. Here it is:

            There are 2 methods to try and solve this problem. The easiest might be to reinstall Ubuntu and install GRUB in the MBR (Master Boot Record) of the disk, rather than in the boot partition. You do that by skipping the step where the tutorial says to change the boot loader location from /dev/sda to /dev/sda5 or whatever the partition number of the boot partition is.

            The other method, which I am yet to try, is to boot the computer with the Ubuntu installation CD. Once in the Live Desktop, start a shell terminal and run sudo grub-install /dev/hda or sudo grub-install /dev/hd0. This link has more info on this and other GRUB commands.

            Keep us posted on the results – good or bad.

  12. Thanks for this great work.
    I have followed your steps, but at the end of ubuntu installation I got a message that says can’t install boot loader to the specified location. I then tried many other locations but every time I got the same message.

    Can you help me in this?
    Thanks

    • Are you attempting to dual-boot on a single hard drive, and are you using the same partitioning scheme as the article?

      • Yes, I have windows 7 already installed and I have a single hard drive.

        I followed the same partitioning scheme you had explained.

        Thanks

        • I had the same issue. Went with install boot loader on MBR. Tried to load ubuntu after configuring EasyBCD and it went to a screen with the following:

          grub>

          any ideas?

          • Anthony Zhang says:

            I got the same error. When Ubuntu asked me to choose a different place to install grub, I chose sda5 (my /boot) again and it worked.

            However, I have the same problem as kp. After using BCD as per the tutorial, I was met with the grub> screen.

          • https://help.ubuntu.com/community/Boot-Repair

            Boot repair was able to solve this problem for me!

          • Same issue as above. My scenario is Windows 7 on primary and I installed Ubuntu on the slave. Followed the steps as above and in the end got GRUB error. After this I chose the slave /sdb5 I think and the installation finished. Booted into Windows and installed EasyBCD. But as shown on the first screen of EasyBCD above, I don’t see the option of GRUB2 under ‘Type’. I can understand that GRUB ever got installed maybe or is not on the primary partition, but what should I do from here? I wonder if I should just have taken the ‘Install alongside windows option and let Ubuntu handle all this!. Any help is appreciated.

          • Damn, still using master/slave drives? Get dat dere SATA! joking aside:

            My windows installation was first as well, however, I installed ubuntu on a separate partition on the same drive.

            Are you using the most current version EasyBCD? My grub didn’t install properly either and still I had to GRUB2 option in EasyBCD.

            Once again, try using boot repair. Boot repair allows you to install grub wherever you want.

  13. Thank youuu! this tutorial is just what I was looking for.
    Now I’m able to pick from Ubuntu or Windows at booting.
    You’re awesome! =D

  14. GREAT JOB!
    You don’t know how this article was helpful to me! easy to read and understand for non English speaking readers.
    Thank you very much.

  15. I have a problem with GRUB, slightly different from awillwa’s problem. What happens is that after I have the installation run, all goes well until it gets to the part where GRUB should be installed. Here, it says that it cannot install GRUB in the boot partition of Ubuntu 11.10. It is a fatal error, according to the installer. I can still use Windows 7, but I really want to dual-boot the two OS’s.

    • What is the size of your HDD and how much of that is used for Windows?

      Note that this type of error could be due to corrupted CD/DVD

      • Hi, I don’t have a solution, but I am having the same issue. I am running [or attempting to, anyway] Ubuntu on a portable external hard drive connected to a MacBook Pro–I’m using rEFIt to boot, just FYI.

        The thing is, though, I’ve tried to install Ubuntu and Kubuntu, on separate occasions, so I’m not convinced that it’s an issue with the installation CD.

        Furthermore, it’s not anything I’m doing, at least I don’t think: I’ve already had Ubuntu 11.04 installed on this hard drive, but I had to format it one day. But I can’t get it back on there.

        What is going on here?

    • Hi Pacmaz, just wondering what is the size of the /boot partition? I got my dual boot with Win 7 and Ubuntu 11.04 to work with grub installed in /boot but made the partition bigger than 500mb. Good luck

    • I was having the same issue when I tried to install (several times each) either Kubuntu 11.10 or Fedora 16 in a dual-boot setup with 7 – a fatal error when I tried to load GRUB2 in an extended partition (/boot – using 200MB for the partition size). I had been formatting the /boot partition as EXT2. Finally tried formatting the partition as EXT4 and I was able to install GRUB2 to it without any problem. Can’t tell you WHY – I don’t know enough about GRUB2 to say, only that it worked for me. Perhaps there’s some incompatibility with GRUB2 and EXT2 when the /boot partition is not a primary? I didn’t run into this issue in older distributions running the old version of GRUB.

      I had formatted the /boot partition as EXT2 because it seems that every tutorial tells you to do that. However, I just read an article somewhere online (sorry, don’t remember where) where the author stated that with today’s super-large HDs and fast CPUs, using EXT2 for /boot really isn’t necessary any longer.

      Anyway, using EXT4 for /boot is what worked for me. :) Good luck!

      • Thank you!This solved my problem.

      • I haven’t had the chance to follow up on this at all, but I will definitely try it this weekend.

      • Update: nope.

        Ubuntu did manage to get through the full install, no fatal error messages or anything, I was pretty excited. But! when I restarted by MBP and try to boot Ubuntu through rEFIt, I’m given this ‘no such device’ sort of warning on the grub64.efi load screen.

        At this point, I think that unless there is a fix for this, I’m done with trying Ubuntu until I can get a machine dedicated only to one OS. This is enormously frustrating.

        • hey u might have used an 64 bit iso of ubuntu so might have not supported that if u want to just try ubuntu u can just get it in a pendrive
          or getting it double boot

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">