Came here in search of an answer to a problem, but didn't find it? Visit the forum @ LinuxBSDos.com, pick a category and ask a question.

Dual-boot Ubuntu 12.04 and Windows 7 on a computer with 2 hard drives

I am reading page: 1 2

This is the second article on dual-booting Ubuntu Desktop 12.04 with Windows 7. But while the first one, how to dual-boot Ubuntu 12.04 and Windows 7, showed how to do it on a computer with a single hard drive, this one gives a step-by-step guide on how to do it on a computer with two hard drives.

If you have a computer with two hard drives or if you can afford to add a second drive to your computer, you give yourself the best hardware configuration for dual-booting, as it avoids the single point of failure that dual-booting on a single hard drive presents. And if you have a computer with UEFI firmware, see Dual-boot Windows 7 and Ubuntu 12.04 on a PC with UEFI board, SSD and HDD.

The operating assumption here is that Windows 7 is installed on /dev/sda, the first hard drive recognized by the system, and Ubuntu 12.04 will be installed on /dev/sdb, the second hard drive. And rather than use Ubuntu’s automated installation mode, all its partitions will be created manually. So aside from showing how to dual-boot Ubuntu 12.04 and Windows 7 on a computer with 2 hard drives, this article serves the secondary purpose of showing how to create partitions manually for installing Ubuntu 12.04 on any computer.

By default, the Ubuntu 12.04 is installed on two partitions – the root partition and Swap. For this tutorial, it will be installed on four – the boot partition, root partition, home partition, and Swap. The boot partition is where all boot-related file and folders are located. Root holds all installed programs, while home is the place for all user-generated data, that is, where your home folder and that of other users on the system are located. Swap is disk space that the computer may use as virtual memory. Creating a separate partition for home makes it relatively easy to upgrade the system without messing with your data.

After the installation has completed, the computer will always boot into Windows, since it is installed on the first hard drive. At that stage, you have two options, if you want to be able to boot into Ubuntu: Change the default boot disk to /dev/sdb in the BIOS, or add an entry for Ubuntu in Windows 7’s boot menu. Because Ubuntu’s installer automatically adds an entry for Windows 7 in GRUB’s boot menu, using the first method requires very little effort; no additional software installation is required. The second method involves installing a special program on Windows 7. From experience, the second method is not necessary, so the recommendation is to use the first method.

Ok, enough introduction. On to the task at hand. If you have not done so already, download an installation image of Ubuntu Desktop 12.04 for your platform from here. Transfer it to a suitable media, then boot the computer from it.

If you are new to Linux and are not familiar with disk partitioning in Linux, read guide to disks and disks partitions in Linux before diving into this. Also, reading tips for dual-booting Windows and Linux is highly recommended.

During bootup, you may opt to boot into a Live desktop environment or start the installation process without making a customary stop at the Live environment. If you boot into the Live desktop, start the installer by clicking on the Install Ubuntu 12.04 LTS icon on the desktop.
Ubuntu 12.04 Boot Options

However you start the installer, click through the first steps until you get to the disk detection step. That step is shown in the image below. Since you are going to be creating partitions manually, select Something else, then click Continue. Keep in mind that even if you do not want to create partitions manually, it is better to select the same option as indicated here. That is the easiest way of ensuring that the installer will not overwrite Windows 7, which will destroy your data. The assumption here is that sdb will be used just for Ubuntu 12.04, and that there are no valuable data on it.
Ubuntu 12.04 Install Partition Methods

Selecting Something else and clicking Continue in the previous step should open the Advanced Partitioning Tool. You should see the disks and partitions connected to the computer. At the top of the list is sda, where Windows 7 is installed. You do not want to mess with that one. Any action you take here MUST be on sdb, the target disk for Ubuntu 12.04. If there are existing partitions on it, as in this example, delete them. You do that by selecting each partition and clicking Delete. Again, be sure that you are not messing with any partition under sda.
Ubuntu 12.04 Advanced Partition Tool

After all the partitions (under sdb) have been deleted, select the free space and click Add.
Ubuntu 12.04 Add Partition

0saves
To have articles like this delivered automatically to your Feed Reader or Inbox, subscribe via RSS or email.
I am reading page: 1 2

Digital Ocean SSD VPS Cloud Server droplets

Digital Ocean is a VPS/Cloud hosting provider. For just $5 per month, you can get yourself a Cloud server with 512 MB of RAM, 20 GB super-fast SSD, free snapshots, plus backups for a minimal fee. All via a simple graphical interface.

And by signing up with this referral link, you can help support this website.

If you are reading this, your ad could also be occupying this space. Contact us to make it happen.

If commenting on this article is closed, please post your comments at forum.linuxbsdos.com.

132 Comments

  1. jetdriver says:

    What a great tutorial. I have some free space on my Windows drive and was wondering if putting swap on sda instead of sdb would result in a faster ubuntu?

  2. Germain67 says:

    I do not often leave any commentary , but I was looking for help to install Ubuntu on my second Hard Disk , without having problem with grub on boot , your tutorial was just perfect !
    (Posting from live CD , waiting for the end of the installation !)

    • Mike K says:

      I connected up one drive and installed Ubuntu. Then disconnected the drive. Then connected another drive and installed Windows 7. Then I connected up both drives and in the Bios set the computer to boot from CD as 1 then the Windows 7 as 2 and lastly the Ubuntu drive. Now when I start up it boots into Windows 7 without any menu. When I want Ubuntu as it is booting up I press F11 and choose the hard drive Ubuntu is on.

  3. Paoer says:

    Do you have to create all those partitions? ex: /home,/boot, etc.

  4. Thank you SO MUCH for this tutorial!!! I would not have been able to do this install without your help. THANK YOU!!!

  5. Jrodmanlive says:

    Do you have to delete partitions already on the second drive?

    • finid says:

      You do not have to, but if the 2nd drive is for Ubuntu and you have no need for existing partitions, then, yes, deleting them is an option.

      If you have a data partition that you’ll rather not delete, then you can install Ubuntu along side it.

      • Jrodmanlive says:

        So I could do the same steps in the guide and not have to worry about losing the data already on that drive? Thanks for the help.

  6. Pat says:

    Thank you – I followed your instructions exactly as given and I now have a Dual boot Windows 7 (x64 bit) and Ubuntu 12.04 (64 bit) running on an ASUS motherboard, I5 processor, with a 3TB drive for Windows and 1TB drive for Ubuntu, both SATA. The system boots up into a menu that offers Ubuntu and Windows and I did not need to do any messing about with GRUB or GRUB2, the UEFI or the MBR. This was so much easier than I feared! Thanks again.

  7. toycrawler says:

    The one change I had to make is to the first portion and make it /boot/EFI boot portion. Or grub wouldn’t install

  8. alex says:

    What if I don’t wan’t to loose my data on sdb?
    I mean can I install Ubuntu on sdb without deleting all the partitions on it as you did?
    Thanks for any anwser

    • finid says:

      Yes, you can. What are the partitions you have on sdb? Knowing that will help us tell you how best to partition it.

      • alex says:

        I have only a partition which is sdb1 and it’s about 370GB on 500GB(total hard disk space)

        • alex says:

          Oh i was wrong it’s a 500GB partition on a 500GB hard disk and 370GB of this partition are used

          • finid says:

            Is that a data partition or is there another OS on it?

            If it’s just a data partition, free up enough space to install Ubuntu, making sure to install GRUB, the boot loader, in the MBR of sdb. Just to be on the safe side, disconnect the SATA cable from sda, so that the installer does not try to install the boot loader on it.

          • alex says:

            It’s a data partition in a secondary hard disk (2 hard disks on the same laptop non external).
            Is 100 GB enough space for total ubuntu partition (swap+boot+home+/)?
            And what is the suggested amount of space for any of these sections?

          • finid says:

            100 GB is more than enough.

            / – 6-7 GB

            /boot – 200-500 MB

            Swap – 2 GB

            The rest for /home.

      • alex says:

        This Guide was very good I finally did it!
        But i have a problem windows doesn’t see sdb anymore (i mean the free space on sdb, I know windows can’t see linux partition by default)
        anyway i would like to use that free space partition i left, how can i do that?

  9. Michael says:

    hello-this tutorial is for two HHD.Two questions:

    1. Is it good without modification for a two SSD machine?

    2. Specifically is swap partition necessary with SSD hardrives?

    Thanks

  10. raghav says:

    i have deleted ubuntu from hard drive without uninstalling it.
    now when i start my computer it is showing me that no such partition
    i have windows 7 original but it is not allowing me to open it..
    its shows me like following command…
    error: no such partition.
    grub rescue>

    what should i do..?????

  11. wallep says:

    Hi finid,

    I’m at the final stages of installing NOT Ubuntu but Debian ‘Squeeze’ on my dual-boot system. Windows is installed on the 1st hard drive (/dev/sda) and Debian will be installed on the 2nd hard drive (/dev/sdb).

    The installer is asking me where I want Grub installed. It says:

    -begin-

    The following other operating systems have been detected on this computer: Microsoft Windows 2000 Professional

    *****begin*****
    If all of your operating systems are listed above, then it should be safe to install the boot loader to the master boot record of your first hard drive. When your computer boots, you will be able to choose to load one of these operating systems or your new system. Install the GRUB boot loader to the master boot record? No or Yes ?
    *****end*****

    This is the make it or break it point! Debian is installed on my 2nd drive (/dev/sdb) NOT the 1st drive (/dev/sda). I also created a partition on the Debian drive (/dev/sdb) called “/boot”. GRUB was to be installed at this /boot location and then I would go into BIOS after install and switch the boot order to boot the Debian drive (/dev/sdb). This would then present the menu for which OS I would like to boot (Windows or Debian).

    If I choose NO to the installer’s question as to placing GRUB in the MBR of the 1st drive. What are my choices as to where to install it? I don’t want to answer “NO” to the question only to advance the installer to a dead end. I have no idea what may happen next if I answer NO. Any ideas or suggestions please?

    Thank you

    • finid says:

      Install GRUB in the MBR of the Debian HDD, that is the second HDD. The point of dual-booting on 2 HDD is to keep both OSs completely separate.

  12. wallep says:

    Hi finid,

    I tried asking my question at the forum but it went unanswered. So here I am at this comment page. I did read this excellent dual boot tutorial and kindly thank you.

    However I am installing Debian Squeeze and understand the dual-boot procedure is the same as Ubuntu. However I am using LVM for the partitioning scheme.

    I did read the excellent tutorial titled, ‘Manual LVM Configuration Guide for Debian 6″.

    http://www.linuxbsdos.com/2011/02/16/manual-lvm-configuration-guide-for-debian-6/

    However this only covers one hard drive. I am utilizing two hard drives for a dual-boot (windows and Debian)and I won’t be installing any additional partitions on the windows drive. The 2nd drive is devoted to 100% debian.

    In regards to LVM on the 2nd (debian) disk..

    Question #1
    in your ‘Debian LVM tutorial’, you said that /boot NOT be LVM. Why please?

    Question #2
    Also in your ‘Debian LVM tutorial’, the /boot partition is labeled as “Primary” and the “free space” partition is also labeled as “Primary”. Do you recommend the same est-up on the 2nd drive for dual-boot? Will having two partitions labeled as “Primary” confuse this 2nd drive when it comes to boot up? Or is the set-up different when utilizing “two” hard drives in a dual boot such as in my situation?

    Question #3
    Also, is there going to be a tutorial titled, “Partitioning using LVM on a Dual Boot Using Two Hard Drives”?

    Here is my original detailed question on the forum please.
    http://linuxbsdos.com/qa/129/debian-squeeze-netinst-partition-drive-dual-boot-using-lvm

    Thank you very much
    Wallep

    • wallep says:

      To clarify question #2, it should read:

      Question #2
      Also in your ‘Debian LVM tutorial’, the /boot partition is labeled as “Primary” and the “free space” partition is also labeled as “Primary”. Do you recommend the same set-up on the 2nd drive for dual-boot?

      Will having two partitions labeled as “Primary” confuse this 2nd drive when it comes to boot up? Or is the set-up different when utilizing “two” hard drives in a dual boot such as in my situation?

      Thank you
      wallep

      • finid says:

        See the answer to your main comment. Note that until a free space is allocated or partitioned, it is neither primary nor logical. It is just free, unallocated space.

    • finid says:

      Sorry about the forum. It’s being replaced, so I’ve not been paying any attention to it.

      Question #1: The boot loader cannot handle an LVM partition. And there are other reasons why /boot on certain configurations should not be part of a specialized partitioning scheme.

      Question #2: On an MBR partitioning scheme, there can be a max of 4 primary partitions on a disk, and multiple primary partitions does not confuse a drive. I recommend that you read guide to disks and disk partitions in Linux.

      Question #3: There will be more advanced LVM-based tutorials soon. If you are going to dual-boot, between, say, Windows and a Linux distribution using 2 HDDs, and you want to devote the 2nd HDD to the Linux distribution, the LVM configuration will be no different than if you were setting it up on a PC with one HDD, but with just the Linux distribution installed.

      In a 2-HDD dual-boot system, what you do on one HDD does not affect the contents of the other.

      • wallep says:

        On Oct. 11, 2012 @ 11:46 AM, finid wrote:
        > Question #1: The boot loader cannot handle an
        > LVM partition. And there are other reasons why
        > /boot on certain configurations should not be
        > part of a specialized partitioning scheme.

        Hi finid,

        Thank you for replying. ok, I understand. Thank you.

        > Question #2: On an MBR partitioning scheme, there
        > can be a max of 4 primary partitions on a disk, and
        > multiple primary partitions does not confuse a
        > drive. I recommend that you read guide to disks and
        > disk partitions in Linux.

        Yes I have been reading a lot. Especially your suggested reading titled, “Guide to disks and
        disk partitions in Linux”. Still studying.

        I was just curious because in the tutorial above you configured /boot on a ‘primary’ partition and the remaining directories on ‘logical’ partitions.

        For some reason, I thought GRUB looked at /boot first because it was a ‘Primary’ partition. Thus it doesn’t matter if /boot is primary and / is primary and /home is primary?

        Also, in an MBR partition scheme, I thought in order to create logical partitions, you had to first create an ‘extended’ partition? If so, where is the extended partition in the above tutorial please?

        > Question #3: There will be more advanced LVM-based
        > tutorials soon. If you are going to dual-boot,
        > between, say, Windows and a Linux distribution using
        > 2 HDDs, and you want to devote the 2nd HDD to the
        > Linux distribution, the LVM configuration will be no
        > different than if you were setting it up on a PC
        > with one HDD, but with just the Linux distribution
        > installed.

        > In a 2-HDD dual-boot system, what you do on one HDD > does not affect the contents of the other.

        Ok, I now understand. Thank you

        • finid says:

          Also, in an MBR partition scheme, I thought in order to create logical partitions, you had to first create an ‘extended’ partition? If so, where is the extended partition in the above tutorial please?

          Yes, to create a logical partition, you must create an extended partition first, because a logical partition falls under an extended partition. However, some installer make the process of creating an extended partition invisible to the user. That is why you do not see it in that tutorial. The installer creates it in the background.

          If you were using Anaconda, the installer for Fedora, you will see an extended partition listed.

          • wallep says:

            > Yes, to create a logical partition,
            > you must create an extended partition first,
            > because a logical partition falls under an
            > extended partition. However, some installer
            > make the process of creating an extended
            > partition invisible to the user.
            > That is why you do not see it in that tutorial.
            > The installer creates it in the background.
            >
            > If you were using Anaconda, the installer for
            > Fedora, you will see an extended partition listed.

            Very interesting. Now I understand. Thank you kindly

          • wallep says:

            finid wrote:
            > Yes, to create a logical partition,
            > you must create an extended partition first,
            > because a logical partition falls under an
            > extended partition. However, some installer
            > make the process of creating an extended
            > partition invisible to the user.
            > That is why you do not see it in that tutorial.
            > The installer creates it in the background.
            >
            > If you were using Anaconda, the installer for
            > Fedora, you will see an extended partition listed.

            Very interesting. Now I understand. Thank you kindly

      • wallep says:

        In regards to my question #2

        I meant to ask:

        Question #2
        Also in your ‘Debian LVM tutorial’, the /boot partition is labeled as “Primary” and the “free space” partition is also labeled as “Primary”. Do you recommend the same set-up on the 2nd drive for dual-boot (more than one primary partition)?

        In other words will having two partitions labeled as “Primary” confuse GRUB the boot loader when it comes to boot up?

        I thought the only reason GRUB worked is because it was placed in a ‘Primary’ partition as the rest of the directories (/, /home) were placed in logical partitions.

        Thank you

  13. junayd says:

    i downloaded the “ubuntu 12.04 i386.iso” and tried to install it in two ways
    1) i burned the iso file in usb flash drive using “iso to usb” appication then i rebooted the system and i also arranged my boot sequence according to scenario but it gave error “remove disk or other media: press any key to restart”.
    2) i mounted the image file on my virtual drive using “ultra iso” then from virtual drive i opened “wubi.exe” it said “demo and full installation” i clicked it over, it prompted me for reboot. i rebooted my pc but it did not prompted the system for a new installation of ubuntu and pc started in normal way as it does having windows 7. nothing happened there and i was on my welcome screen of windows 7. please help. thanx

  14. ECOsvaldo says:

    Excellent tutorial! I have another hard drive coming in the mail and will definitely use this tutorial to set up a dual boot on my home computer. One thing I want to ask though – will this work the same way if I decide to use Linux Mint (since the distribution is based on Ubuntu)?

    • finid says:

      Yes, the steps will be exactly the same if you use Mint or any other Ubuntu-derived distro.

      • ECOsvaldo says:

        I’ve followed this tutorial several times to do a dual boot with both Linux Mint 13 and Ubuntu 12.04, and every time after it finishes installing, my computer hangs during the boot up process (my main OS is Windows 7); I believe Mint/Ubuntu overwrote the boot manager on the Windows disk during the installation process. I have a Core i5 3570K with an ASRock Z77 Extreme4 and uses UEFI. Can you help me?

        • Bill says:

          I believe the same thing happen to me. I hope someone replies and helps me fix this situation! Im so worried I lost my Windows 7 installation.

          Please help me.
          Bill

        • finid says:

          I think this has something to do with UEFI. The tutorial was written using a unit with a BIOS firmware, not UEFI, so I did not have the type of issues you guys are running into.

          I just built a new unit with UEFI, and will be testing it on both Mint and Ubuntu, so you can check back late tomorrow for an update.

          The mobo I bought is an ASRock Z77 Pro4, so we use the same UEFI Setup utility.

          • Oli says:

            I think my problem was windows was on sdb not sda! Seems I’ve lost everything! Oh well! Can someone tell me, is it difficult to now install windows 7 on the other hard drive? Would I have to install windows and wipe Ubuntu then install ubuntu again (on the right hd this time!)?

          • finid says:

            You can verify if Windows is still installed and if you can still recover your data. Boot he system from the Ubuntu installation CD. Let it boot into the Live desktop. Once there, open the file manager and view the partitions that will be listed on its left panel. You should see all the partitions from both drives, including your Windows partitions, if they are still there.

            If you need to reinstall Windows, you do not have to wipe Ubuntu. To make thinks easier, just disconnect the SATA cable from the Ubuntu drive, then install Windows on the other one. After installation, make the Ubuntu drive the primary boot disk in the firmware (BIOS or UEFI). That should do it for you.

          • Oli says:

            It was as I had suspected, and by formatting the sdb I had overwritten all windows files, so have now reinstalled Windows on sda and that boots fine, but only when that is the only hard drive connected. When sdb is also connected, it is the primary boot disk but only boots Ubuntu, and doesnt give me a choice to boot Windows. How can I fix this? It’s a bit of a pain having to unplug the SATA cable every time I want to boot Windows! Thanks for all the help up to now by the way!

  15. Wally says:

    Hi finid,

    You said on page “2”,

    “Rather than going through the process of installing another application to use for adding an entry for Ubuntu 12.04 in the Windows 7 boot menu, it is better and easier to change the default boot device to sdb. Then on each reboot, you will have the option to choose either Windows 7 or Ubuntu 12.04 from GRUB’s boot menu.” -end-

    Are you assuming that both hard drives are each installed on their own separate 40 pin ribbon cables – a total of two cables (windows installed on one cable and Ubuntu installed on another cable) or are you assuming that both hard drives are connected as “master” and “slave” on “ONE” 40 pin ribbon cable?

    I say this because is it even possible to set a “slave” drive as 1st boot device when that “slave” drive (containing Ubuntu) is installed on the same 40 pin ribbon cable as the windows drive (that is set to “master”) ?

    Thank you kindly
    wally

    • wallep says:

      Wally said:
      > I say this because is it even possible to set a
      > “slave” drive as 1st boot device when that “slave”
      > drive (containing Ubuntu) is installed on the same
      > 40 pin ribbon cable as the windows drive
      > (that is set to >“master”) ?

      I tested this using two hard drives on the same cable (1st disk set to ‘Master’ and 2nd disk set to ‘Slave’)and changed the boot order in BIOS to have the 2nd disk (Slave) boot. The 2nd disk (Slave) disk booted successfully.