Ubuntu, Grub, and Windows 7


Recommended Posts

Hello,

So recently I have set up my new computer (craigslist finds many deals for those of you in the US :)). Anyway, I have three hard drives hooked up in this order, My first hard drive has Windows 7 on it (C:, or /dev/sda1), My second hard drive which holds my Ubuntu installation (/dev/sdb1), and then my third drive which is just a backup.

My first drive I have my Windows boot loader on it, with two entries: One for Windows 7 and one for Ubuntu. My second hard drive I installed Grub onto, which has a menu for the various kernels and of course to boot up Windows.

Here is my issue and what I did to try to solve it, but to no avail. Every time I boot into Windows, everything is fine until I restart my computer or shut down. After I exit Windows, and try to boot into Ubuntu, Grub can no longer see my Ubuntu installation (No such device found, no partition found). Of course my second hard drive is fine, I am able to boot into my recovery CD and fix Grub after a few hours, and boot back into my Ubuntu. But the second I launch Windows 7, it screws with my Ubuntu boot partition somehow. Grub is fine, it has the right menu but is Unable to see any hard drive except /dev/sda1 [Windows].

So I want to install Grub to my Windows boot loader, /dev/sda, but to have my boot partition on /dev/sdb3 (I just re-sized my partition for 500 megabytes specifically for /boot). I tried following a tutorial on the internet to install Grub, however I am afraid if I choose to install my Grub onto /dev/sda, that it will somehow corrupt my Windows Partition.

How do I install just the boot loader onto /dev/sda while having the Grub Stage 2 files on my /dev/sdb3 partition? Also, how to I configure Ubuntu to mount /dev/sdb3 as /boot automatically, as that partition was not originally there when I installed it.

Thank you!

Link to comment
https://www.neowin.net/forum/topic/1075093-ubuntu-grub-and-windows-7/
Share on other sites

From what I can remember you need to install grub onto the windows drive, although saying this, it has been a while since I dual booted linux and windows on a machine, but installing it on the windows partition will not screw up the boot sequences and it should fix the problems you are having, Windows will just have to be selected from the grub menu to boot into unless you edit the config file for it to default boot into windows.

Well I ended up switching my Linux drive and Windows drive physically to the opposite slots they were in, and reinstalled Ubuntu. Now I can boot into Ubuntu fine, but for some reason Grub will not boot into Windows now, giving me the error that Ubuntu previously had:

error: no such device

error: no such partition

I recovered the Windows MBR, using bootsect /nt60 all, bootsect /nt60 sys /mbr bootrec /fixmbr, etc, then I reinstalled Grub onto my Linux drive, and reconfigured the menu.lst file. However, I still get the same error when trying to boot into Windows from Grub. Does it sound like a hardware issue, or Grub sucks at seeing the two different hard drives?

Grub needs to be the initial boot sector, then windows, for some reason, the way you have set things up is messing this up.

Computer On --> Grub --> Windows

Computer On --> Grub --> Linux

Either way grub needs to be installed to the 1st device set to boot from.

Going back to your original setup....

sda1 - Windows (Has to be installed 1st)

sdb1 - Linux (Has to be installed last)

Boot partition is to be set on sda1 so as grub manages the boot up and os.

Everything works then as it should.

Other option

Install Windows

Disconnect windows hard drive

Install Linux on other drive

Reconnect Windows drive

Use your computers bios boot device selector to change which os to boot from (Usually F11)

Mostly I use Windows XP on my virtual machine since it's much easier to setup and configure then using it on my host machine. Since i don't use plugins or anything on my host machine that's why.

Same with ubuntu, just use it on a virtual machine since it's much easier to configure and setup without knowing that it will have problems on the host machine.

  • 2 weeks later...
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • WTF? I am not taking a video of myself to access a site or to create an account. What are they thinking? I don’t even have a webcam on my main desktop PC. The powers to be are really looking to normalize the taking of pics or submitting ID for everything. I afraid most people will end up just going along with it.
    • Free eBook: A Comprehensive Guide to the NIST Cybersecurity Framework 2.0 (worth $126.95) by Steven Parker Claim your complimentary copy (worth $126.95) of "A Comprehensive Guide to the NIST Cybersecurity Framework 2.0" for free, before the offer ends on July 8. (link below) Description The National Institute of Standards and Technology (NIST) Cybersecurity Framework, produced in response to a 2014 US Presidential directive, has proven essential in standardizing approaches to cybersecurity risk and producing an efficient, adaptable toolkit for meeting cyber threats. As these threats have multiplied and escalated in recent years, this framework has evolved to meet new needs and reflect new best practices, and now has an international footprint. There has never been a greater need for cybersecurity professionals to understand this framework, its applications, and its potential. A Comprehensive Guide to the NIST Cybersecurity Framework 2.0 offers a vital introduction to this NIST framework and its implementation. Highlighting significant updates from the first version of the NIST framework, it works through each of the framework’s functions in turn, in language both beginners and experienced professionals can grasp. Replete with compliance and implementation strategies, it proves indispensable for the next generation of cybersecurity professionals. A Comprehensive Guide to the NIST Cybersecurity Framework 2.0 readers will also find: Clear, jargon-free language for both beginning and advanced readers Detailed discussion of all NIST framework components, including Govern, Identify, Protect, Detect, Respond, and Recover Hundreds of actionable recommendations for immediate implementation by cybersecurity professionals at all levels A Comprehensive Guide to the NIST Cybersecurity Framework 2.0 is ideal for cybersecurity professionals, business leaders and executives, IT consultants and advisors, and students and academics focused on the study of cybersecurity, information technology, or related fields. How to download for free Please ensure you read the terms and conditions to claim this offer. Complete and verifiable information is required in order to receive this free offer. If you have previously made use of these offers, you will not need to re-register. A Comprehensive Guide to the NIST Cybersecurity Framework 2.0 Was $126.95, but is now FREE | Above link offer expires on July 8. The below offers are also available for free in exchange for your (work) email: View our recent time-limited free eBook offers The Complete Free AI Learning: Master ChatGPT, Claude, Gemini & More ($21 Value) now FREE How to Build an AI Design Workflow with Gamma ($21 Value) now FREE The Ultimate Linux Newbie Guide – Featured free content Python Notes for Professionals – Featured free content Learn Linux in 5 Days – Featured free content Quick Reference Guide for Cybersecurity – Featured free content We post these because we earn commission on each lead so as not to rely solely on advertising, which many of our readers block. It all helps toward paying staff reporters, servers and hosting costs. Other ways to support Neowin The above deal not doing it for you, but still want to help? Check out the links below. Check out our partner software in the Neowin Store Buy a T-shirt at Neowin's Threadsquad Subscribe to Neowin - for $14 a year, or $28 a year for an ad-free experience Disclosure: An account at Neowin Deals is required to participate in any deals powered by our affiliate, StackCommerce. For a full description of StackCommerce's privacy guidelines, go here. Neowin benefits from shared revenue of each sale made through the branded deals site.
    • I'm not unblocking my camera for this crapola. Sorry, Google.
  • Recent Achievements

    • One Year In
      BA the Curmudgeon earned a badge
      One Year In
    • Conversation Starter
      rosiecharles earned a badge
      Conversation Starter
    • First Post
      KMilenkoski1202 earned a badge
      First Post
    • First Post
      carols23 earned a badge
      First Post
    • One Month Later
      Tom Willson earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      518
    2. 2
      +Edouard
      264
    3. 3
      PsYcHoKiLLa
      151
    4. 4
      Steven P.
      95
    5. 5
      macoman
      66
  • Tell a friend

    Love Neowin? Tell a friend!