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.

Related Post:  Robert Kugler and Paypal's bug bounty eligibility requirements

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

Related Post:  Enable AMD SVM to install 64-bit operating systems in Virtualbox 5.1

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:

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn

Hola! Did you notice that LinuxBSDos.com no longer runs network ads?  Yep, no more ads from the usual suspects that track you across the Internet.  But since  I still need to pay to keep the site running, feel free to make a small donation by PayPal.

Subscribe for updates. Trust me, no spam!

Mailchimp Signup Form

Sponsored links

1. Attend Algorithm Conference, a top AI and ML event for 2020.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.

25 Responses

  1. I installed Linux Mint 18.1 Cinnamon to an external hard drive this way. First I took the hdd out of its enclosure. Next I installed it in the desktop and disconnected the windows hdd. I installed Linux Mint. I then removed the external hdd and returned the windows hdd. I then installed the external hdd in the case attached it to the desktop with the USB and set BIOS to boot from the external. Everything is working fine. I would like a boot loader that allows me to select the operation system at start up. Sometimes I just gotta use windows.

    1. Well, with that setup, you only need to run sudo update-grub while logged into the Linux distro on the external drive. That will add any OS it detects, including Windows, to the GRUB menu,

  2. Hello I followed your tutorial and it worked fine… But I changed the default boot settings in the boot launcher of osx. Since then, the system does not recognize the external hard drive like if Grub is not the default boot manger anymore. Is there a way to fix that without reinstalling Ubuntu? I did that because I was not able to boot in windows and Mac anymore. Thanks for this tuto!

    1. That all depends on where the boot loader was installed. If it was installed on the internal hard drive, then Ubuntu will only boot as long as the external hard drive is connecte to that computer. GRUB should be installed in the MBR or EFI Boot Partition of the external hard drive, otherwise you risk problems booting the OS on the internal hard drive if the external drive is not connected.

      Do you know exactly where GRUB was installed?

  3. I followed the tutorial exactly and still messed my internal hdd.
    Booting to black screen with
    “grub>”
    terminal where i can write comamands

    I did that on macbook pro 2011 that had just ubuntu on the internal drive before that.
    The whole partition was encrypted when installing it.

    I installed the second ubuntu on a USB stick and it works just fine there.

    I will have to reinstall now I guess?

      1. I have this problem too having exactly followed the instructions in this article with particular care to ensure “sda” was not selected for the bootloader.

        When I type exit at the “grub>” prompt a big message box, in the ugly PC/BIOS font, appears saying “no bootable device found.”. When I hit enter I get a boot menu from BIOS from which I can select Windows boot manager. However this is a PITA. How can this be fixed so when the external HDD is not plugged in the PC simply boots to Windows?

        BIOS shows the following boot order: 1. “ubuntu”, 2. “Windows boot manager”, 3. “USB HDD” (which changes to include the disk name when the USB disk is connected). If I swap 1 and 2 it always boots into Windows. If I change the order to 3, 2, 1, it won’t boot linux when the external HDD is plugged in.

  4. Seeing as how there’s been no response, allow me to add some specifics. I want to install ONLY Ubuntu Linux onto my external HDD (no other OS, so Swap Space really would not be necessary). I have been able to do this with a USB flash drive, but for some reason with my external hard drive I receive an error on (re)booting into the external drive stating: “error: attempt to read or write ourtside of disk ‘hd0’.
    Entering rescue mode.

    Thus far, nothing online has provided a viable solution. The only two conclusions I can come to is that either some jack*** who made the drive thinks it’s funny; or a 300 GB external hard drive is less capable than an 8 GB flash drive to perform this…making the company that made the hard drive a bunch of overpaid morons.

    Once again, if someone can provide a workable solution, it’d be appreciated.

    1. Did you really install it to a USB stick or you just transferred it to the USB stick? Big difference, there.

      From my experience, the main problem with installing a Linux distro to an external drive connected to a recent PC, that is, one with UEFI firmware, is that you stand a good change of messing up both the internal HDD and the external one. And it comes from how the boot loaders are handled and/or the failure of the installer to install the bootloader in the proper place.

      Try this: Access the computer’s boot menu (I think the F11 or F12 will get you there). You should see a list of attached HDDs and also a list of boot managers for all the OSs that have been installed on that system. you should see one for Ubuntu. Select that and see if it will boot.

      The reason why this is a trial and error thing, is that each PC vendor implements UEFI in a different way. So on some PCs, you can boot an OS by selecting the entry for the HDD on which the OS is installed on, but not on others. This is why moving a Linux external HDD from one PC to another has become a major pain. As far as I’m concerned, UEFI is a curse, for Linux, that is.

      All this is assuming that your PC has UEFI firmware.

      Keep me posted.

      1. I don’t misspeak. I’m very literal. I have a 16GB flash drive which has the Ubuntu Linux OS installed on it and runs just fine. For some reason, the external hard drive I have is just (expletive) stupid and will not install the same way. It comes up “No filesystem found” no matter how it is installed.

        With the flash drive, accessing the boot menu (F9 on an HP Probook) is how I boot into Linux on the flash drive. The 300GB external HDD doesn’t seem to want to do the job though. It’s how I’ve always done it, though. Install just to an external drive (I’ve done Ubuntu and Fedora on flash drives) and after install, use the boot menu options to boot into Linux. (If I don’t go to the boot menu options Linux isn’t even listed. That’s how I set it up in the first place, and how I want it. Too see more clearly what I mean, you can view my video on how to install it to a flash drive at https://www.youtube.com/watch?v=rYWlUNSMJrY&list=UUqlWSPlnC9XmWrrXY_TfdhQ

      2. On a sidenote, I did mention that it’s listed, but it provides the error: “error: attempt to read or write ourtside of disk ‘hd0′.
        Entering rescue mode.

        Though, comparatively, the error should read, “The people who made the hard drive are a bunch of overpaid idiots…but we keep them on staff because…’merica.” The external HDD is made by Maxtor/Western Digital/or Seagate…what ever you choose to call those ****-ups.

          1. Can’t….as I said (and my linked video shows), it works just fine if installed onto a flash drive. For some reason, the Maxtor OneTouch does not feel it should function as well as an 8 or 16 GB flash drive though. If it were the PC’s implementation of UEFI, it wouldn’t work via flash drive neither…but it does.

          2. Hi Xander!

            I come a very similar experience, and guess what, my flash card worked and still works like a charm! Whereas the hard drive (500Gb) all of the sudden would not boot and enter grub rescue mode…..So to make the long story short, you better make sure that the USB cable is very short and of good quality!! That solved the problem for me.

            Cheerio
            Paolo

        1. Honestly, if my cable were any shorter, it’d be an internal drive. For some reason, as I mentioned on a YouTube video about this, the solution seems to be the definition of insanity…doing the same thing repeatedly expecting a different result.

          1. The problem, me thinks, is the installer not installing GRUB on the correct HDD. I should try this using Ubuntu 15.04 and see if it works as expected.

    2. Hey, I was having the same problem. In bios i change my boot to CSM from UEFI. The stupid hard drive wanted to be stupid the first time i tried. so to make sure that it was not my external being dumb. i removed my internal HDD and booted. To my surprise it started up with Ubuntu. I am curious to know how it will react when i put the internal hdd back in.

  5. Nope…didn’t work. When trying to boot the external drive, it goes right to rescue mode. Any insight? Working insight, that is. No just guessing.

  6. My Vaio came with 6 partitions from factory, I don’t even get the “install alongside” option and I’m really scared about installing Ubuntu (I have done it many times) because I’m suspecting I’m about to destroy my installation and I don’t want to spend days repairing my laptop. Do you know if there’s a problem with Ubuntu with multiple partitions (the partitions are from Sony and Windows)?

    For my computer I believe the Device for boot loader should be the hard drive (not a partition), and then I should just use both / and swap normally but again, the gazzilion partitions (recovery, and who knows what) are making me nervous

    Sorry this is slightly off-topic.

    1. I’m guessing that the Vaio uses UEFI firmware and that those 6 partitions are GTP partitions. Is that right?

      When you boot the PC from the Ubuntu install CD, list the device names of the partitions you see from Ubuntu’s advanced partition tool.

  7. Thank You for the great article. I followed your instructions and it (mostly) worked, but
    I have a question, I can not find answer for in the message boards. I installed Ubuntu 13.10 from Live USB flash stick to another USB flash stick(128GB). Since I am new to Linux, I did not want to mess with the Windows 8.1 on my computer, trying to create a dual boot. So as a training facility I thought I can install Ubuntu on a USB drive first.
    I followed exactly the same path as described. Well first I disabled secure boot in my UEFI BIOS, set the external drive to be the prime bootable source, then let the install create /, /home and SWAP area, and made sure the boot loader installation to be on dev/sdc (the USB where I was installing). Everything went well – with the USB plugged in when I reboot grub offers me Ubuntu or Windows and both load up and seem to work. But when I shut down and reboot with no USB plugged, instead of going directly to Windows I get a black screen and grub> prompt. Did I somehow damaged by internal HDD boot, or is this some setting in grub that I have to change? Any lead is greatly appreciated!

    1. When installing a Linux distribution to an external HDD connected to a PC with UEFI firmware, it’s always a good idea to disconnect the SATA cord from the internal HDD.

      But we are past that point in this case, so here’s what you can try, before you hit the mild-panic button: As the PC boots, press the appropriate F-key that will take you to the boot menu. If your computer is anything like my testing unit, you should see an entry for a Windows Boot Manager and Ubuntu on there. Select the former and see if it will boot Windows.

      1. Thank You finid! I did this installation to an USB as a precursor to installing 13.10 to the Internal HDD (creating a dual boot), so did not occur to me to isolate it that much. Later I found the suggestion here and there.
        But I have been reading and people say the fact that grub> shows up, means grub starts, but can not find the correct continuation.
        Actually I managed manually to start Windows by following the commands from grub.cfg that is on the USB. I just do not know where to recreate it on the boot partition on the HDD (if it is possible of course).

Leave a Reply to finid Cancel reply

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

Get the latest

On social media
Via my newsletter
Mailchimp Signup Form

Partner links

1. Attend Algorithm Conference, a top AI and ML event for 2021.
2. Reasons to use control panel for your server.
3. DHgate Computers Electronics, Cell Phones & more.
Hacking, pentesting distributions

Linux Distributions for Hacking

Experts use these Linux distributions for hacking, digital forensics, and pentesting.

Categories
Archives

The authors of these books are confirmed to speak during

Algorithm Conference

T-minus AI

Author was the first chairperson of AI for the U.S. Air Force.

The case for killer robots

Author is the Director of the Center for Natural and Artificial Intelligence.

Why greatness cannot be planned

Author works on AI safety as a Senior Research Scientist at Uber AI Labs.

Anastasia Marchenkova

An invitation from Anastasia Marchenkova

Hya, after stints as a quantum researcher at Georgia Tech Quantum Optics & Quantum Telecom Lab, and the University of Maryland Joint Quantum Institute, I’m now working on superconducting qubit quantum processors at Bleximo. I’ll be speaking during Algorithm Conference in Austin, Texas, July 16 – 18, 2020. Meet me there and let’s chat about progress and hype in quantum computing.