Partner links

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

Zemanta Related Posts Thumbnail

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

Share:

Facebook
Twitter
Pinterest
LinkedIn

Partner links

Newsletter: Subscribe for updates

132 Comments
Inline Feedbacks
View all comments
jetdriver
jetdriver
11 years ago

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?

Germain67
Germain67
11 years ago

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
Mike K
Reply to  Germain67
11 years ago

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.

Paoer
Paoer
11 years ago

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

yara e o vento
11 years ago

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

Jrodmanlive
Jrodmanlive
11 years ago

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

Jrodmanlive
Jrodmanlive
Reply to  finid
11 years ago

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.

Pat
Pat
11 years ago

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.

toycrawler
toycrawler
11 years ago

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

alex
alex
11 years ago

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

alex
alex
Reply to  finid
11 years ago

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

alex
alex
Reply to  alex
11 years ago

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

alex
alex
Reply to  alex
11 years ago

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?

alex
alex
Reply to  finid
11 years ago

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?

Michael
Michael
11 years ago

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

raghav
raghav
11 years ago

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..?????

raghav
raghav
Reply to  finid
11 years ago

i had installed it in my partioned hard drive…
lable of hard drive was i:

raghav
raghav
Reply to  raghav
11 years ago

no more info is with me…
size of ubuntu drive was arond 60 gb

Andy Chow
Andy Chow
Reply to  raghav
11 years ago

When starting your computer, press F12 or equivalent to choose the boot order. Choose the hard drive that has the Windows 7 installation and boot from that one.

If you dual boot from a single hard drive system, you need a windows rescue disk to restore the mbr.

raghav
raghav
Reply to  Andy Chow
11 years ago

thanks …
i have restored my windows using my windows recovery disk and it is working perfectly fine…
thanks all of u for your advises…

wallep
wallep
11 years ago

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

wallep
wallep
11 years ago

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
wallep
Reply to  wallep
11 years ago

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

wallep
wallep
Reply to  finid
11 years ago

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

wallep
wallep
Reply to  finid
11 years ago

> 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
wallep
Reply to  finid
11 years ago

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
wallep
Reply to  finid
11 years ago

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

junayd
junayd
11 years ago

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

ECOsvaldo
ECOsvaldo
11 years ago

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)?

ECOsvaldo
ECOsvaldo
Reply to  finid
11 years ago

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
Bill
Reply to  ECOsvaldo
11 years ago

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

Oli
Oli
Reply to  Bill
11 years ago

I think the same happened to me too! HELP!

Oli
Oli
Reply to  finid
11 years ago

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!)?

Oli
Oli
Reply to  finid
11 years ago

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!

Wally
Wally
11 years ago

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
wallep
Reply to  Wally
11 years ago

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.

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