Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: [11.10] Grub can't boot Windows 7 (no MBR) but CAN boot from drive

  1. #1
    Join Date
    May 2012
    Beans
    8

    Cool [11.10] Grub can't boot Windows 7 (no MBR) but CAN boot from drive

    Here is a pastebin link to the boot-repair diagnostic. I have not run boot-repair because it looks like it might be set to overwrite all drives by default and I don't want to lose the ability to avoid using Grub.

    I have tried to dual-boot Ubuntu a few times in the past and it's never worked out. Today I have spent many hours installing and reinstalling for various reasons (including initially installing the 32-bit version, then having a working 64-bit install, then upgrading to 12.04 to have it all bork again).

    The current state of play is as follows...
    sda has two partitions, I can boot into Windows 7 if I choose this drive on startup. To fix this I tried to install lilo on the drive. I thought that didn't work and that I fixed it with Windows tools but the boot-repair diagnostic says that it's running lilo. I'm just happy it's working at all!
    sda1: the Windows 7 system partition
    sda2: the Windows partition itself

    sdb has four partitions, booting this gives me Grub which has a working entry for Ubuntu 11.10 and a non-functioning entry for W7
    sdb1: has music etc. on it that I access from Windows
    sdb2: is a FAT32 partition that I thought I might need to transfer files between OS's
    sdb3: turned up somewhere in installing Ubuntu, not sure what it's doing
    sdb4: this has Ubuntu 11.10 on it
    sdb5: is a swap partition

    Ideally, I would like to be able to boot from sdb by default when I start my computer and be able to choose between Ubuntu or Windows 7 there, whereas at the moment the Windows 7 entry does not work. I've just realised that ideally I ought to have the error message that Grub gives here, but I need to reboot to find it, I will edit this post with it in a moment.

    Edit: Selecting Windows 7 in Grub gives me a black screen with...

    "Error: no such device EXXXXXXXXXXXXXXX" (this advances faster than I could note those letters/numbers, but it started with an E)


    Then:

    "BOOTMGR is missing
    Press ctrl-alt-del to restart"

    I'm now wondering whether the title is misleading, I'm not sure whether MBR and BOOTMGR are the same thing.
    Last edited by AbsurdWalls; May 15th, 2012 at 06:05 PM.

  2. #2
    Join Date
    Nov 2004
    Location
    Maine
    Beans
    1,569
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: [11.10] Grub can't boot Windows 7 (no MBR) but CAN boot from drive

    Gurb should have no problem booting windows and ubuntu in dual boot just install it to the mbr. Boot repair should also do that for you.

    here: a page that will guide you through installing grub.

    https://help.ubuntu.com/community/Re...tallingWindows
    Dave
    Registered Linux User #462608
    Ubuntu 14.04.1 /Xubuntu 14.04.1/Ubuntu-Gnome 14.04/UbuntuMate 14.04

  3. #3
    Join Date
    May 2012
    Beans
    8

    Re: [11.10] Grub can't boot Windows 7 (no MBR) but CAN boot from drive

    Quote Originally Posted by kc1di View Post
    Gurb should have no problem booting windows and ubuntu in dual boot just install it to the mbr. Boot repair should also do that for you.

    here: a page that will guide you through installing grub.

    https://help.ubuntu.com/community/Re...tallingWindows
    Will boot-repair overwrite the working Windows MBR I currently have on the other drive?

    Edit: Doing things "The Terminal way" from your link doesn't appear to have changed anything. Here is an updated pastebin link in case it did.
    Last edited by AbsurdWalls; May 15th, 2012 at 06:12 PM. Reason: Following suggestion

  4. #4
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: [11.10] Grub can't boot Windows 7 (no MBR) but CAN boot from drive

    I think boot-repair uses syslinux instead of lilo. They all boot Windows just like the Windows boot loader in the MBR in that they look for the partition with the boot flag and jump to that partition to continue booting. Windows in the MBR also has checks that it is only a primary partition where lilo will boot a system from a logical partition (but not Windows as Windows boot has to be in a primary partition).

    Your sdb3 is the extended partition which is one of the primary partitions. But it is used as the container to allow many logical partitions. Ubuntu will boot from a logical, Windows will read and if booting from another primary partition can be installed to a logical.

    All grub does is chainload (jump) to the PBR - partition boot sector. That is all the Windows boot loader or lilo or syslinux do from the MBR. They all jump to the PBR and find more Windows code to continue to boot.

    If you can directly boot from sda, I do not understand why you cannot boot sdb from BIOS and use chain load entry in grub to boot your Windows. Boot script looks normal, UUID looks correct. If you could not boot from sda, I would say you had a Windows issue that needed repair as script does not show all the internals, just the main parts required to boot.

    Do both Ubuntu & Windows boot ok when you select each drive directly from BIOS?

    One test we can try is from grub menu at Windows line, press e for editing and delete the search line entirely so it is only using the set root to sda1 line and then control x to boot. Sometimes search line is not correct.
    Last edited by oldfred; May 15th, 2012 at 06:47 PM.
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  5. #5
    Join Date
    May 2012
    Beans
    8

    Re: [11.10] Grub can't boot Windows 7 (no MBR) but CAN boot from drive

    Quote Originally Posted by oldfred View Post
    I think boot-repair uses syslinux instead of lilo. They all boot Windows just like the Windows boot loader in the MBR in that they look for the partition with the boot flag and jump to that partition to continue booting. Windows in the MBR also has checks that it is only a primary partition where lilo will boot a system from a logical partition (but not Windows as Windows boot has to be in a primary partition).

    Your sdb3 is the extended partition which is one of the primary partitions. But it is used as the container to allow many logical partitions. Ubuntu will boot from a logical, Windows will read and if booting from another primary partition can be installed to a logical.

    All grub does is chainload (jump) to the PBR - partition boot sector. That is all the Windows boot loader or lilo or syslinux do from the MBR. They all jump to the PBR and find more Windows code to continue to boot.

    If you can directly boot from sda, I do not understand why you cannot boot sdb from BIOS and use chain load entry in grub to boot your Windows. Boot script looks normal, UUID looks correct. If you could not boot from sda, I would say you had a Windows issue that needed repair as script does not show all the internals, just the main parts required to boot.

    Do both Ubuntu & Windows boot ok when you select each drive directly from BIOS?
    Yes, they do. It's puzzling me as well. I am wondering whether there might be two bootloaders on sda, both pointing to Windows 7, one working and one not working. In that case it might be that Grub is linking to the non-functioning one. I'm not sure how to test that though.

    Quote Originally Posted by oldfred View Post
    One test we can try is from grub menu at Windows line, press e for editing and delete the search line entirely so it is only using the set root to sda1 line and then control x to boot. Sometimes search line is not correct.
    I will give that a shot and report back.

    Edit: Ok, so that (except leaving chainloader +1 in otherwise it wouldn't do anything) just gave me the BOOTMGR is missing message. I did make some progress though:

    Doing as you said and ALSO changing:

    set root='(hd0,msdos1)'

    to

    set root='(hd0,msdos2)'

    Very nearly worked. It DOES boot into Windows 7 now, but it gives me a screen saying "Remove disks or other media. Press any key to restart."

    This message is doubly bizarre. 1) There is no external media in the computer, and 2) Pressing any key does not restart the computer, it starts up Windows 7!

    So, I imagine this could be functional if I work out how to edit my grub.cfg file to replace that msdos1 with msdos2, but I would rather not have that odd message pop up and have to press a key to get past it.
    Last edited by AbsurdWalls; May 15th, 2012 at 07:27 PM.

  6. #6
    Join Date
    Nov 2004
    Location
    Maine
    Beans
    1,569
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: [11.10] Grub can't boot Windows 7 (no MBR) but CAN boot from drive

    Quote Originally Posted by AbsurdWalls View Post
    Will boot-repair overwrite the working Windows MBR I currently have on the other drive?

    Edit: Doing things "The Terminal way" from your link doesn't appear to have changed anything. Here is an updated pastebin link in case it did.
    you'll have to choose if you want grub as the boot loader of lilo they both will work I find grub2 easier but that's just my opinion.

    If your going to use grub install it so it overwrites the MBR on the primary drive. It will find windows 7 and place a line on the grub menu to boot to it. if you want to boot windows as the defualt we can cover that after you get grub working.

    you should not need two MBRs.
    Dave
    Registered Linux User #462608
    Ubuntu 14.04.1 /Xubuntu 14.04.1/Ubuntu-Gnome 14.04/UbuntuMate 14.04

  7. #7
    Join Date
    Sep 2009
    Beans
    8,874
    Distro
    Ubuntu Development Release

    Re: [11.10] Grub can't boot Windows 7 (no MBR) but CAN boot from drive

    Quote Originally Posted by kc1di View Post
    you'll have to choose if you want grub as the boot loader of lilo they both will work I find grub2 easier but that's just my opinion.

    If your going to use grub install it so it overwrites the MBR on the primary drive. It will find windows 7 and place a line on the grub menu to boot to it. if you want to boot windows as the defualt we can cover that after you get grub working.

    you should not need two MBRs.
    Two mbr with two separate HD's is fine, in this case since windows is in sda and ubuntu in sdb this allows a boot of windows no matter what which some users find comforting.

    Grub does not overwrite the primary drive unless you let it, it is pointable in a install using a custom install, and is purgable and able to be reloaded with ease, and easy to put where you want with a chroot if working in a broken setup.

    +1 on the mods comments.

  8. #8
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: [11.10] Grub can't boot Windows 7 (no MBR) but CAN boot from drive

    You only have one MBR, but Windows use PBR - partition boot sector for more code. And you have a PBR for every partition. Grub does not normally use PBR.

    If you want to understand more about Windows booting, this has a lot of detail. (Vista & 7 are same). You can just review pictures for a quick overview.
    Multibooters, Pictures here worth 1000+ words
    http://www.multibooters.co.uk/multiboot.html

    Windows has more boot code in the PBR and that refers to bootmgr. Your sda1 has to the boot partition as it has boot flag which is partition lilo or Windows will jump to and it also has the two boot files bootmgr and BCD. Those are missing from sda2 and that is why you would get errors trying to directly boot sdb. We have repaired main installs, by passing the boot recovery and moving bootmgr & BCD to main install but I do not suggest that yet.

    Bootmgr missing is usually a error in the PBR and fixBoot fixes that. But you should get the same error when booting directly unless it is jumping to the wrong partition where the PBR is not correct. It seems like drive order is changing but UUIDs should never change, so search should always find correct Windows partition to chain to.


    Lets experiment with a chainload to the MBR instead of the PBR.

    gksudo gedit /etc/grub.d/40_custom
    Then do:
    sudo update-grub

    Paste this into 40_custom. Boot drive is always hd0 in grub so I am using hd1, but sometimes flash drive or other devices change drive numbers.

    menuentry "Windows sda (from sdb) Chainboot" {
    set root=(hd1)
    chainloader +1
    }
    Last edited by oldfred; May 15th, 2012 at 07:49 PM.
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  9. #9
    Join Date
    May 2012
    Beans
    8

    Re: [11.10] Grub can't boot Windows 7 (no MBR) but CAN boot from drive

    Quote Originally Posted by wilee-nilee View Post
    Two mbr with two separate HD's is fine, in this case since windows is in sda and ubuntu in sdb this allows a boot of windows no matter what which some users find comforting.
    Quite! Several times over the past decade I have:
    1) Decided it would be cool to dual boot Windows/Linux
    2) Had an "interaction" between the desired booting setup of the two
    3) Ended up with a PC that won't boot into anything

    Having a Windows machine or a Linux machine worked just fine for me. Having something do both has seemed impossible.

    Quote Originally Posted by wilee-nilee View Post
    Grub does not overwrite the primary drive unless you let it, it is pointable in a install using a custom install, and is purgable and able to be reloaded with ease, and easy to put where you want with a chroot if working in a broken setup.
    I was referring the behaviour of boot-repair. That's what I was unsure of.

    Quote Originally Posted by oldfred View Post
    Lets experiment with a chainload to the MBR instead of the PBR.

    gksudo gedit /etc/grub.d/40_custom
    Then do:
    sudo update-grub

    Paste this into 40_custom. Boot drive is always hd0 in grub so I am using hd1, but sometimes flash drive or other devices change drive numbers.

    menuentry "Windows sda (from sdb) Chainboot" {
    set root=(hd1)
    chainloader +1
    }
    The code you suggested gives:

    "Booting a command list
    Cannot get C/H/S values"

    Putting "hd0" in instead gives me the Grub menu again, so I guess that fits with what you say about hd0 always being the boot drive. That doesn't fit with what happened previously when we were booting from the PBR though. There, hd0 was the drive with Windows on it (as '(hd0,msdos2)' booted up into Windows 7).
    Last edited by AbsurdWalls; May 15th, 2012 at 08:28 PM.

  10. #10
    Join Date
    Oct 2006
    Beans
    Hidden!

    Re: [11.10] Grub can't boot Windows 7 (no MBR) but CAN boot from drive

    Quote Originally Posted by AbsurdWalls View Post
    Quite! Several times over the past decade I have:
    1) Decided it would be cool to dual boot Windows/Linux
    2) Had an "interaction" between the desired booting setup of the two
    3) Ended up with a PC that won't boot into anything

    Having a Windows machine or a Linux machine worked just fine for me. Having something do both has seemed impossible.



    I was referring the behaviour of boot-repair. That's what I was unsure of.



    The code you suggested gives:

    "Booting a command list
    Cannot get C/H/S values"

    Putting "hd0" in instead gives me the Grub menu again, so I guess that fits with what you say about hd0 always being the boot drive. That doesn't fit with what happened previously when we were booting from the PBR though. There, hd0 was the drive with Windows on it (as '(hd0,msdos2)' booted up into Windows 7).
    I believe you have to map the drive before booting off of it. I'm not 100% sure how this works in grub2. Maybe someone can correct me if I'm wrong. Try:
    Code:
    menuentry "Windows sda (from sdb) Chainboot" {
    set root=(hd1)
    drivemap -s hd0 hd1
    chainloader +1
    }
    Then run a
    Code:
    sudo update-grub

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •