Partner links

How to dual-boot Windows 7 and Ubuntu 11.04

swapwarn

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.

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.

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

Share:

Facebook
Twitter
Pinterest
LinkedIn

Partner links

Newsletter: Subscribe for updates

Subscribe
Notify of
guest
135 Comments
Inline Feedbacks
View all comments
Adnan
Adnan
12 years ago

Hi,
I think I came to this site a little too late. I chose the option “[install Ubuntu alongside Windows 7” and now when my computer boots up, I do not get any option for windows 7. Instead my monitor keeps on complaining that the input is not configured for this monitor and then after few seconds it takes me right into the Ubuntu login screen. Did I loose my Windows? or is it just that I can’t see the dual boot option? Any help is appreciated. Thanks.

Adnan
Adnan
Reply to  finid
12 years ago

Thanks a lot finid. Any suggestions of how to fix that? My apologies I am new at this.

Easton
Easton
12 years ago

Based on the comments and the quality of the tutorial, this seems like the best way I’ve found to set up a dual boot. I’m reluctant to try it though without knowing how to uninstall Ubuntu. If someone could show me how this is done, or point me to another tutorial, I’d be extremely grateful.

Easton
Easton
Reply to  finid
12 years ago

Thanks, I went ahead and made a post:

http://linuxbsdos.com/ask/?ptype=preview

Easton
Easton
Reply to  finid
12 years ago

Wow, I can’t believe I just did that, sorry I just posted it.

http://linuxbsdos.com/ask/?ptype=preview&alook=1&qid=450

Azizul Baharuddin
12 years ago

very informative and easy to follow guide.

Maty1400
Maty1400
12 years ago

There is a windows installer for ubuntu that makes all in one step. Why so complicated?

Lorenzo
12 years ago

I used this guide and installed Ubuntu, went totally smoothly. I might have to reinstall Ubuntu due to a problem and I want to preserve my home partition. How do I do that? I have the same partitions as this guide.

What steps do I have to make?

Marvin
Marvin
12 years ago

very clear instructions, thanks a lot!

Jim Cioccio
Jim Cioccio
12 years ago

Super excellent article. I only wish I had read it first before my first failed attempt. I messed up just expecting “along side windows” would work. Again, thank you very much.

Samuel
Samuel
12 years ago

Aren’t you making this a tad more complicated than necessary? Just select the option to “Install Ubuntu alongside Windows 7” option during the installer and you’re set. The only reason to set your partitions manually is if you have a specific need to do so (e.g., if you want to separate your /home and / partitions). Also, I’m having trouble understanding why anybody needing instructions on how to dual boot Windows and Ubuntu would need to have a separate /boot partition. Just saying, maybe it would be better to give beginners the simpler, yet still functional, approach, which is built right into the very installer with a single option.

Eric
Eric
Reply to  Samuel
12 years ago

As a user who’s had multiple bad experiences with putting GRUB in Windows’ own MBR area in the past, I was extremely reluctant to go there again and was looking for a guide that described how to do it the other way around, in a way that could be applied to a second hard drive too, rather than partitioning a single-HDD system, and one that was written since 11.04 AND with a convenient method of doing this all from a USB stick and not a CD. This post was the first I’ve found that covered all of those points clearly.

You may be right about the separate partitions and your other points, but in regard to the “Install alongside” vs. “Do Something Else” options I was very grateful to see this post describe “Something Else”.

Richie
Richie
Reply to  Eric
12 years ago

Thank you so much. The “simple” [install Ubuntu alongside Windows 7] did not work for me. I had to reformat and reinstall Windows and Ubuntu twice, before I finally came to realize that I needed to do it a different way. Thanks for your post, it has been very useful.

Naman
Naman
12 years ago

Shouldnt we change the file system to ext4 although it works fine with ext2??????

Eric
Eric
Reply to  finid
12 years ago

:^]

Eric
Eric
Reply to  finid
12 years ago

Unfortunately I’m still stuck. EasyBCD doesn’t want to let me make an entry that actually points to my Ubuntu installation on a second hard drive. Since this is getting into more in-depth help I’ve started a questions in the Q&A area instead. Thank you for your help so far.

Eric
Eric
Reply to  finid
12 years ago

I’m quite sure that didn’t work the first and even the second times I tried it. But I kept going back and fiddling with EasyBCD and now everything is working. Perhaps I had made an error the first time or two that I just didn’t see… Thanks again, looks like I’m all set up now.

Eric
Eric
12 years ago

I followed these instructions and was a happy new Ubuntu 11.04 user for a couple of days. But then I started having boot problems, where the system told me my /boot partition could not be mounted. I searched the net and found mainly results that indicated I should update my /etc/fstab to identify the /boot partition by UUID rather than device id. Unfortunately the device wasn’t showing up in /dev/disk/by-UUID either so I couldn’t do that. The other significant search results were several answers that indicate exactly this problem can occur if a /boot partition of less than 500MB is used.

Perhaps you should investigate that and consider altering the advice to use between 22 and 258 MB? Although I can’t say this for sure until I’ve finished the reinstall I’m currently proceeding with.

There are several Ubuntu bugs on file circa April 2011 regarding an issue where ubi-partman fails with exit code 141, another problem that happened to me with your method, and I wonder if these two problems share a common cause. Could it be related to the fact that I’m installing Ubuntu to a different physical drive from my Windows drive and therefore was able to use primary partitions or a mix of primary and logical partitions? You didn’t say much about whether to prefer primary or logical, etc.

Eric
Eric
Reply to  finid
12 years ago

Oh good, so should I be able to just remove GRUB from /boot and install it to the MBR and save my current installation and not have to reinstall? I didn’t actually start the reinstallation that i mentioned above, while I went to make more coffee and research more 😀

I don’t know anything about removing and reinstalling GRUB, but I’ll go search for that info. Any further pointers welcome. I will comment later on whether moving GRUB solves my issue. By the way, any comment on the “ubi-partman failed with exit code 141” issue during the install from USB stick?

Eric
Eric
Reply to  finid
12 years ago

I’m very hesitant to install GRUB to the MBR on hd0 for exactly the reasons given on page 2 of your tutorial above… Other times I have tried that resulted in inability to boot Windows and I had to go through all of the manual fix-it tools on the Windows recovery console: diskpart, bcdedit, bootsect, bcdboot, bootrec. Actually ended up completely reinstalling Windows after a similar fiasco one time.

In fact I was completely turned off to the idea of dual-booting Windows and Linux after those previous experiences and was so glad to find your tutorial which was the first one I ever saw whose method for installing GRUB on my Linux drive instead of in the MBR worked for me.

So why is it that installing Ubuntu to a second HDD means that GRUB should be installed to the system’s MBR instead of to /boot? I’m confused when you say that yet you also say installing it to /boot has never been an issue for you. Do you mean you have always done this on systems with a single HDD only?

In short, I haven’t had a 1-HDD system for many years, and I very much want to keep GRUB and Windows’s boot loader separate using your original method. I hope there is some other way around this. I still don’t understand why I had a working system at first and then a couple of days later the /boot partition was unable to be loaded. I’ve checked the HDD with various tools and it doesn’t seem to have any physical problem.

Maybe I’ll just wipe it and attempt a fresh install.

Eric
Eric
Reply to  finid
12 years ago

Oh, NOW I get it. Sorry for all the length of comments here. I wasn’t realizing that it could go in the MBR of the Ubuntu HDD, not in the MBR of the Windows HDD. I missed that simple distinction and I think understanding this will make my next attempt work out fine. Thanks again.

b_woodroaster
b_woodroaster
12 years ago

I would just like to say thank you. Your detailed explanations and screen shots are perfect.

Just for the record, this worked on a Dell Mini 1012 flawlessly using Windows 7 and Lubuntu 11.04. I am having zero issues and the battery life on each OS is pretty close to being the same.

My next goal is to triple boot this machine.

Thank you again!

panda
12 years ago

Thanks this article was really helpful and it works well too.. will u plz tell me da way if i want to uninstall ubuntu and get dat space to use with windows again.
Thanks

MinDokan
MinDokan
Reply to  panda
12 years ago

Just log into your windows account and delete the 4 partitions you created before.

Sp
Sp
12 years ago

Thank you so much. I am just trying Ubuntu for the first time and you saved me a whole bunch of headache and research for understanding just what in the heck I am doing.

ratnakar
ratnakar
12 years ago

Hey hi. Lot of thanks for making it so simple with graphic and lucid illustratious explanation. Would in debt forever for this info. IT helped me a lot

1 2 3 4

Get the latest

On social media

Security distros

Hacker
Linux distros for hacking and pentesting

Crypto mining OS

Bitcoin
Distros for mining bitcoin and other cryptocurrencies

Crypto hardware

MSI GeForce GTX 1070
Installing Nvidia GTX 1070 GPU drivers on Ubuntu

Disk guide

LVM
Beginner's guide to disks & disk partitions in Linux

Bash guide

Bash shell terminal
How to set the PATH variable in Bash
Categories
Archives
135
0
Hya, what do you think? Please comment.x
()
x