Dual Boot Win7 and Ubuntu 9.10 From Separate Hard Drives

Written by Chris (MSF Admin) on February 17, 2010 – 12:42 am | 386 views

We here at MSF don’t normally do tutorials, but due to my recent excursion into the awesome world of Ubuntu, one of the most popular flavors of Linux, and my love for Windows games, I wanted to share some of the knowledge I have gained in trying to get both Ubuntu 9.10 and Windows 7 to live in complete harmony on two different hard drives inside my computer.

This article is aimed at people who already have Ubuntu installed and want to run a stand alone version of Windows 7, or any version of Windows for that matter, to play games, etc., that don’t run well or at all under the various Windows emulators available to Linux users. If you’re starting with two fresh hard drives, just install Ubuntu on the master hard drive (or SATA drive 1) as usual and pick this tutorial up from there. Windows users wishing to install Linux can just use Wubi, Ubuntu’s built in installer, from within your operating system. As a side note, I will be using the words Ubuntu and Linux interchangeably.

Let’s get started.

Assuming that you have Ubuntu on your main hard drive, open up your computer and disconnect it. You have to do this to sort of trick Windows into thinking that it’s getting installed on a primary hard drive, otherwise Windows will tell you that it can’t install it’s bootloader on a secondary drive, in so many words anyway as I forgot what the exact error message is. If you are running IDE drives, set the Windows HD to master and connect the IDE cable to the primary IDE socket. If you are running SATA drives, you should be fine as long as there aren’t any other hard drives connected before it. For example, your Windows HD is on SATA 3, but you have a storage HD on SATA 2, this is bad because Windows will still see it’s designated hard drive as secondary. Your best bet would be to place the Ubuntu HD at SATA 1, Windows at SATA 2 and any other HDs to the remaining SATA positions.

After you get the hard drive situation taken care of, you can install Windows as normal and then reconnect your Ubuntu hard drive.

You’d think you’d be done after that, but you’re not. When Windows gets installed after Linux, it overwrites the Grand Unified Bootloader (GRUB) with it’s own, NT Loader (NTLDR), in the Master Boot Record (MBR) on the C: drive the next time the computer boots and wipes any trace of another operating system from the boot record. When that happens, you can’t boot into Linux even though you installed it on your primary hard drive. What we need to do now is a little GRUB repair.

The next step is to grab an .iso of Ubuntu 9.10 from here, if you don’t already have it, and burn it to a CD/DVD. Insert the disc and restart your computer.

The BIOS in my computer is always set to check my disc drive for something bootable first, so if yours isn’t make sure you set that so you can boot into the Ubuntu Live CD instead of Windows.

Once that’s squared away, select the first option you are presented with once the Ubuntu CD has booted up. The option should be labeled “Try Ubuntu without any change to your computer”.

After you get Ubuntu up and running, mount the hard drive that the actual Ubuntu is installed on and go to the terminal, found in Applications->Accesories.

You’ll need to verify which partition Ubuntu is booting from by typing this command:

mount | tail -1

The output for that command should be something like:

/dev/sda1 on /media/dc2b02cb-bf3b-486a-a405-8de01677
ac55 type ext4 (rw,nosuid,nodev,uhelper=devkit)

The output will actually be joined at the last “7″ of the first line and the first “a” of the second line with no spaces. I formatted it like this so that it wouldn’t run out into the side bar.

This is the very next command you’ll need:

ls /media/dc2b02cb-bf3b-486a-a405-8de01677ac55/boot

Note that there is a lowercase L at the beginning, not the number one. Executing that command should output your GRUB information. If it doesn’t, you’ve messed up and need to start over.

To reinsert the GRUB into the MBR, you’ll need to specify the directory and drive info you got from the first command a-like-so:

sudo grub-install --root-directory=/media/dc2b02cb-bf
3b-486a-a405-8de01677ac55 /dev/sda1

Same situation as above. All of this will be one line in the terminal with no space between the “f” and the “3″.

If you get some sort of error complaining about the status of the BIOS, simply add *space*–recheck to the end of the install command where *space* is an actual pressing of the space bar.

If you did everything right you’ll get a message reporting as such, if not, try your luck again.

The final step in this process involves one last command to make doubly sure Windows will show up in the GRUB the next time you boot. The below command should do the trick:

sudo update-grub2

Feel free to restart your computer at this point (don’t forget to take the Live CD out!), basking in your triumphant glory over the Microsoft NTLDR. You have successfully overpowered and out-manoeuvred a worthy opponent in your struggle against the evil that is the NT Loader. Pat yourself on the back you big ball of nerd…Linux GRUB FTW!

Share this post:
  • email
  • Print
  • PDF
  • Facebook
  • MySpace
  • Twitter
  • Google Bookmarks
  • Yahoo! Bookmarks
  • Live
  • Digg
  • StumbleUpon
  • RSS
  1. 3 Responses to “Dual Boot Win7 and Ubuntu 9.10 From Separate Hard Drives”

  2. By brodie on Feb 20, 2010 | Reply

    so i don’t recognize a few of the commands you used, chris, but i like the howto. i’ve never tried dual-booting from an external (i just split my internal into pieces for the root OS install and save everything to the external) but it sounds like something i could try in the future

  3. By brodie on Feb 20, 2010 | Reply

    and i’m glad you’re attempting to kick WINBLOZE to the curb. good for you!

  4. By Chris (MSF Admin) on Feb 20, 2010 | Reply

    It’s not about installing on an external…this is for two internals because I wanted to keep them separate. I’m not entirely certain if it would work with an external…not Windows anyway, but maybe I could try it and amend the tutorial in the future, or you could…lol

You must be logged in to post a comment.

About MSF.com

Steve and Chris started thingsthatpissusoff.com several years ago and was unfortunately shut down after only one year. MSF.com is an ongoing attempt to sort of "re-live" those days, but, at the same time, bring better writing and solid articles to the table. Feel free to comment on anything posted here because that's essentially what the site is here for. If you'd like to post your own articles to MSF.com, all you have to do is ask. Also, the ads shown on this site don't necessarily reflect MSF views or beliefs. They are semi-random and based on key words I think.

Find entries :