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

Thread: Grub takes over MBR

  1. #1

    Default Grub takes over MBR

    I did a fresh install of 11.2. When I reboot grub came up to load opensusie instead of Windows 7 MBR. Further looking at the /boot/grub/menu.lst file. I noticed it's point to hd0,2 which is my first drive three partition. I load everything including grub to sdb3 (hd1,2). When I pointed everything back to hd1,2 now I get error code 22 on reboot. How do you restore grub to sdb3 or hd1,2. I also need to repair my Windows 7 Pro MBR. Any help?????

  2. #2
    Join Date
    Jun 2008
    Location
    The English Lake District. UK - GMT/BST
    Posts
    37,180
    Blog Entries
    17

    Default Re: Grub takes over MBR

    You need to open a su terminal and post result of

    Code:
    fdisk -l
    Code:
    cat /boot/grub/menu.lst
    Ideally too if you can tell us which partition is win7
    13.2_Laptop_Spec
    My Articles
    Was I any help? If yes: Click the star below

  3. #3

    Default Re: Grub takes over MBR

    Quote Originally Posted by caf4926 View Post
    You need to open a su terminal and post result of

    Code:
    fdisk -l
    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xc5e4c5e4

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 60801 488384001 7 HPFS/NTFS

    Disk /dev/sdb: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x00013b19

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 2677 21502971 83 Linux
    /dev/sdb2 2678 5354 21503002+ 83 Linux
    /dev/sdb3 5355 8031 21503002+ 83 Linux
    /dev/sdb4 * 8032 60801 423873057+ f W95 Ext'd (LBA)
    /dev/sdb5 8032 52261 355267584 7 HPFS/NTFS
    /dev/sdb6 52261 52515 2048161+ 82 Linux swap / Solaris
    /dev/sdb7 52516 55320 22531131 83 Linux
    /dev/sdb8 55321 58125 22531131 83 Linux
    /dev/sdb9 58126 60801 21494938


    Code:
    cat /boot/grub/menu.lst
    linux-xw1w:/ # cat /boot/grub/menu.lst
    # Modified by YaST2. Last modification on Thu Jun 10 16:51:14 PDT 2010
    # THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
    # Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader

    default 0
    timeout 8
    ##YaST - generic_mbr
    gfxmenu (hd0,2)/boot/message
    ##YaST - activate

    ###Don't change this comment - YaST2 identifier: Original name: linux###
    title Desktop -- openSUSE 11.2 - 2.6.31.5-0.1
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.31.5-0.1-desktop root=/dev/disk/by-id/ata-WDC_WD5000AAKS-00A7B2_WD-WMASY7694276-part3 resume=/dev/disk/by-id/ata-WDC_WD5000AAKS-00A7B2_WD-WMASY7694276-part6 splash=silent quiet showopts vga=0x345
    initrd /boot/initrd-2.6.31.5-0.1-desktop

    ###Don't change this comment - YaST2 identifier: Original name: failsafe###
    title Failsafe -- openSUSE 11.2 - 2.6.31.5-0.1
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.31.5-0.1-desktop root=/dev/disk/by-id/ata-WDC_WD5000AAKS-00A7B2_WD-WMASY7694276-part3 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x345
    initrd /boot/initrd-2.6.31.5-0.1-desktop

    ###Don't change this comment - YaST2 identifier: Original name: Linux other 1 (/dev/sdb1)###
    title Linux other 1 (/dev/sdb1)
    rootnoverify (hd0,0)
    chainloader +1

    ###Don't change this comment - YaST2 identifier: Original name: Linux other 2 (/dev/sdb2)###
    title Linux other 2 (/dev/sdb2)
    rootnoverify (hd0,1)
    chainloader +1

    ###Don't change this comment - YaST2 identifier: Original name: GNU GRUB 2, (1.97.2) (/dev/sdb7)###
    title GNU GRUB 2, (1.97.2) (/dev/sdb7)
    rootnoverify (hd0,6)
    chainloader +1

    ###Don't change this comment - YaST2 identifier: Original name: Linux other 3 (/dev/sdb8)###
    title Linux other 3 (/dev/sdb8)
    rootnoverify (hd0,7)
    chainloader +1

    ###Don't change this comment - YaST2 identifier: Original name: linux (/dev/sdb9)###
    title linux (/dev/sdb9)
    rootnoverify (hd0,8)
    chainloader +1

    ###Don't change this comment - YaST2 identifier: Original name: windows###
    title Windows
    map (hd1) (hd0)
    map (hd0) (hd1)
    rootnoverify (hd1,0)
    makeactive
    chainloader +1
    linux-xw1w:/ #


    Ideally too if you can tell us which partition is win7
    Windows 7 Pro is on first drive partition 1 sda1 (hd0,0)

    Everything else is on second drive sdb1 (hdb1,x)

    Opensusie is loaded sdb3 (hd1,2)

    If you notice everthing is pointing to hd0

    Hope this helps.

  4. #4
    Join Date
    Jun 2008
    Location
    The English Lake District. UK - GMT/BST
    Posts
    37,180
    Blog Entries
    17

    Default Re: Grub takes over MBR

    According to the menu entries for Linux, they are expecting sdb to be the first boot device (hd0)

    Now, you didn't actually say if windows boots from the grub entry for it?! Because it looks like it is correct!

    If it is just that you think grub has broken the MBR of sda, an easy way to check is turn off the PC, pull the power on sdb and try booting.
    (NB)- When you re-connect sdb, sda will usually now be (hd0), so you have to go in to the BIOS to switch sdb back the first boot device (hd0) and have grub in control.
    13.2_Laptop_Spec
    My Articles
    Was I any help? If yes: Click the star below

  5. #5

    Default Re: Grub takes over MBR

    I don't want grub in control the MBR was suppose to be left alone. The way it was loaded everything was suppose to work off the root partition. How do you repair all of this to have grub on the /root partition and restore the MBR. I use easyBCD to boot from in Windows 7. Windows does boot from Grub.

  6. #6
    Join Date
    Nov 2009
    Location
    Australia
    Posts
    1,377

    Default Re: Grub takes over MBR

    It appears to me also that GRUB is simply chain-loading your windows boot loader and has not touched the MBR on that disk.

  7. #7
    Join Date
    Nov 2009
    Location
    Australia
    Posts
    1,377

    Default Re: Grub takes over MBR

    If for some reason you feel a need to see the windows boot loader ( ? ) then swerdna's guide Boot Multiboot openSUSE Windows (2000, XP, Vista - any mix) with Windows bootloader. may help you.

  8. #8
    Join Date
    Jun 2008
    Location
    The English Lake District. UK - GMT/BST
    Posts
    37,180
    Blog Entries
    17

    Default Re: Grub takes over MBR

    But did you try what I said! Pull the power on sdb and try booting with just sda

    I concur with @dvhenry
    Look like grub is working and you are confused.
    13.2_Laptop_Spec
    My Articles
    Was I any help? If yes: Click the star below

  9. #9

    Default Re: Grub takes over MBR

    Maybe I'm am confused.

    OpenSuse 11.2 Grub Taking Over MBR

    Dual Booting Linux Distros With Windows 7 Pro Boot Loader

    I run an Intel DP35DP motherboard with 3.0 gig Intel processor with 4 gig of ram. Two 500 gig Sata hard drives. The first hard drive is for Windows 7 Pro. The second hard drive is for 6 different flavors of Linux, Swap and Data backups. Drive 2 the first three partitions are primary Linux. The next is extended swap, NTFS Extended (labeled data). The last three are extended Linux partitions. I used Parted Magic 4.6 to set these up).

    Install all most any flavor of Linux on the second hard drive and use the automatic partitioning tool but don't put grub on your Master MBR put it on the root partition on your second drive. When you get to the Boot Loader Configuration screen make sure you use the advanced boot loader options. The next screen will give the option where to put Grub Boot Loader. It should say like sda or sdb. Sda is usually your Win 7 Drive. From their finish loading. Put Grub on sdbx (Note: Linux Mint, Ultimate 2.5 or any Distros using Ubuntu 9.10 have to be on a primary partition. Ubuntu 9.10 will not work on an extended partition). This is not true now.

    Now duel booting using Win 7 Pro boot manager.

    Go to neosmart.net and download and install in Win 7 EasyBCD 1.7.2 (It's freeware)

    This is my layout of drives and partitions.
    sda (hd0,0) First Drive = Windows 7 Pro (Note: No other partitions).

    Sdb (hd1,x) Second Drive (Heres the layout) (Note: Problem Areas and of notice areas are Highlighted in red)

    NTFS Extended 2 Partitions Drives Size EasyBCD

    Data sdb5 338.81 3 Hd1,4

    Linux Distros Partitions Drives Size EasyBCD
    Primary
    #1 Ubuntu Desktop / sdb1 20.51 gig 0 Hd1,1
    10.04 Lucid Lynx

    Linux Distros Partitions Drives Size EasyBCD Primary

    #2 Linux Mint 9.0 / sdb2 20.51 gig 1 Hd1,2
    Isadora

    Linux Distros Partitions Drives Size EasyBCD
    Primary

    #3 OpenSuse / sdb3 20.51 gig 2 Hd1,3
    11.2

    Linux Distros Partitions Drives Size EasyBCD
    Extended

    /Swap sdb6 1.95 gig 4 Hd1,5
    #4 Fedora 13.0 / sdb7 20.51 gig 5 Hd1,6
    Goddard

    Linux Distros Partitions Drives Size EasyBCD
    Extended

    #5 Ultimate Edition / sdb8 20.51 gig 6 Hd1,7
    II.VI

    Linux Distros Partitions Drives Size EasyBCD
    Extended

    #6 PCLinuxOS / sdb9 22.46 gig 7 Hd1,8
    KDE 2010

    Here is the fdisk and menu list or grub conf in order of partitions. Please take note of the hd orders of the working Distros.

    Ubuntu 10.04-desktop:~$ sudo fdisk -l

    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0xc5e4c5e4

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 60802 488384512 7 HPFS/NTFS

    Disk /dev/sdb: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00013b19

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 2677 21502971 83 Linux
    /dev/sdb2 2678 5354 21503002+ 83 Linux
    /dev/sdb3 5355 8031 21503002+ 83 Linux
    /dev/sdb4 8032 60801 423873057+ f W95 Ext'd (LBA)
    /dev/sdb5 8032 52261 355267584 7 HPFS/NTFS
    /dev/sdb6 52261 52515 2048161+ 82 Linux swap / Solaris
    /dev/sdb7 52516 55320 22531131 83 Linux
    /dev/sdb8 55321 58125 22531131 83 Linux
    /dev/sdb9 58126 60801 21494938+ 83 Linux

    Unbuntu Grub.cfg

    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by /usr/sbin/grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub

    ### BEGIN /etc/grub.d/00_header ###
    if [ -s $prefix/grubenv ]; then
    load_env
    fi
    set default="0"
    if [ ${prev_saved_entry} ]; then
    set saved_entry=${prev_saved_entry}
    save_env saved_entry
    set prev_saved_entry=
    save_env prev_saved_entry
    set boot_once=true
    fi

    function savedefault {
    if [ -z ${boot_once} ]; then
    saved_entry=${chosen}
    save_env saved_entry
    fi

    function recordfail {
    set recordfail=1
    if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
    }
    insmod ext2
    set root='(hd1,1)'
    search --no-floppy --fs-uuid --set 81f65d4f-866a-40e7-a76e-d3fa955f0a9d
    if loadfont /usr/share/grub/unicode.pf2 ; then
    set gfxmode=640x480
    insmod gfxterm
    insmod vbe
    if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
    fi
    fi
    insmod ext2
    set root='(hd1,1)'
    search --no-floppy --fs-uuid --set 81f65d4f-866a-40e7-a76e-d3fa955f0a9d
    set locale_dir=($root)/boot/grub/locale
    set lang=en
    insmod gettext
    if [ ${recordfail} = 1 ]; then
    set timeout=-1
    else
    set timeout=10
    fi
    ### END /etc/grub.d/00_header ###

    ### BEGIN /etc/grub.d/05_debian_theme ###
    set menu_color_normal=white/black
    "grub.cfg" [readonly] 214 lines, 8724 characters

    Linux Mint 9.0-desktop ~ $ sudo fdisk -l

    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0xc5e4c5e4

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 60802 488384512 7 HPFS/NTFS

    Disk /dev/sdb: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00013b19

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 2677 21502971 83 Linux
    /dev/sdb2 2678 5354 21503002+ 83 Linux
    /dev/sdb3 5355 8031 21503002+ 83 Linux
    /dev/sdb4 8032 60801 423873057+ f W95 Ext'd (LBA)
    /dev/sdb5 8032 52261 355267584 7 HPFS/NTFS
    /dev/sdb6 52261 52515 2048161+ 82 Linux swap / Solaris
    /dev/sdb7 52516 55320 22531131 83 Linux
    /dev/sdb8 55321 58125 22531131 83 Linux
    /dev/sdb9 58126 60801 21494938+ 83 Linux
    Linux Mint 9.0 Grub.cfg

    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by /usr/sbin/grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    #

    ### BEGIN /etc/grub.d/00_header ###
    if [ -s $prefix/grubenv ]; then
    load_env
    fi
    set default="0"
    if [ ${prev_saved_entry} ]; then
    set saved_entry=${prev_saved_entry}
    save_env saved_entry
    set prev_saved_entry=
    save_env prev_saved_entry
    set boot_once=true
    fi

    function savedefault {
    if [ -z ${boot_once} ]; then
    saved_entry=${chosen}
    save_env saved_entry
    fi
    }

    function recordfail {
    set recordfail=1
    if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
    }
    insmod ext2
    set root='(hd1,2)'
    search --no-floppy --fs-uuid --set 86232c48-eb80-40ec-bd5c-92de064539e0
    if loadfont /usr/share/grub/unicode.pf2 ; then
    set gfxmode=640x480
    insmod gfxterm
    insmod vbe
    if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
    fi
    fi
    insmod ext2
    set root='(hd1,2)'
    search --no-floppy --fs-uuid --set 86232c48-eb80-40ec-bd5c-92de064539e0
    set locale_dir=($root)/boot/grub/locale
    set lang=en
    insmod gettext
    if [ ${recordfail} = 1 ]; then
    set timeout=-1
    else
    set timeout=10
    fi
    ### END /etc/grub.d/00_header ###

    ### BEGIN /etc/grub.d/05_debian_theme ###
    set menu_color_normal=white/black
    set menu_color_highlight=black/light-gray
    ### END /etc/grub.d/05_debian_theme ###

    "grub.cfg" [readonly] 241 lines, 9557 characters

    OpenSuse 11.2 fdisk -l

    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xc5e4c5e4

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 60801 488384001 7 HPFS/NTFS

    Disk /dev/sdb: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x00013b19

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 2677 21502971 83 Linux
    /dev/sdb2 2678 5354 21503002+ 83 Linux
    /dev/sdb3 5355 8031 21503002+ 83 Linux
    /dev/sdb4 * 8032 60801 423873057+ f W95 Ext'd (LBA)
    /dev/sdb5 8032 52261 355267584 7 HPFS/NTFS
    /dev/sdb6 52261 52515 2048161+ 82 Linux swap / Solaris
    /dev/sdb7 52516 55320 22531131 83 Linux
    /dev/sdb8 55321 58125 22531131 83 Linux
    /dev/sdb9 58126 60801 21494938

    linux-xw1w:/ # cat /boot/grub/menu.lst
    # Modified by YaST2. Last modification on Thu Jun 10 16:51:14 PDT 2010
    # THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
    # Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloader
    default 0
    timeout 8
    ##YaST - generic_mbr
    gfxmenu (hd0,2)/boot/message
    ##YaST - activate

    ###Don't change this comment - YaST2 identifier: Original name: linux###
    title Desktop -- openSUSE 11.2 - 2.6.31.5-0.1
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.31.5-0.1-desktop root=/dev/disk/by-id/ata-WDC_WD5000AAKS-00A7B2_WD-WMASY7694276-part3 resume=/dev/disk/by-id/ata-WDC_WD5000AAKS-00A7B2_WD-WMASY7694276-part6 splash=silent quiet showopts vga=0x345
    initrd /boot/initrd-2.6.31.5-0.1-desktop

    ###Don't change this comment - YaST2 identifier: Original name: failsafe###
    title Failsafe -- openSUSE 11.2 - 2.6.31.5-0.1
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.31.5-0.1-desktop root=/dev/disk/by-id/ata-WDC_WD5000AAKS-00A7B2_WD-WMASY7694276-part3 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x345
    initrd /boot/initrd-2.6.31.5-0.1-desktop
    ###Don't change this comment - YaST2 identifier: Original name: Linux other 1 (/dev/sdb1)###
    title Linux other 1 (/dev/sdb1)
    rootnoverify (hd0,0)
    chainloader +1
    ###Don't change this comment - YaST2 identifier: Original name: Linux other 2 (/dev/sdb2)###
    title Linux other 2 (/dev/sdb2)
    rootnoverify (hd0,1)
    chainloader +1
    ###Don't change this comment - YaST2 identifier: Original name: GNU GRUB 2, (1.97.2) (/dev/sdb7)###
    title GNU GRUB 2, (1.97.2) (/dev/sdb7)
    rootnoverify (hd0,6)
    chainloader +1
    ###Don't change this comment - YaST2 identifier: Original name: Linux other 3 (/dev/sdb8)###
    title Linux other 3 (/dev/sdb8)
    rootnoverify (hd0,7)
    chainloader +1
    ###Don't change this comment - YaST2 identifier: Original name: linux (/dev/sdb9)###
    title linux (/dev/sdb9)
    rootnoverify (hd0,8)
    chainloader +1
    ###Don't change this comment - YaST2 identifier: Original name: windows###
    title Windows
    map (hd1) (hd0)
    map (hd0) (hd1)
    rootnoverify (hd1,0)
    makeactive
    chainloader +1
    linux-xw1w:/

    In this opensuse 11.2 menu.lst should point to hd1,3 or sdb3) All entries should point to hd1,x Not hd0,x.

    If you need me to post the rest of the Distro partitions I can but this should give a clue what is going on. When I installed OpenSuse 11.2 I installed on sdb3 with Grub loaded on the /root partition. You can see where it ended up. Any Help???

    Caf4926 I will try your suggestion in the morning and post the results. But maybe this is more understandable.

  10. #10
    Join Date
    Jun 2008
    Location
    The English Lake District. UK - GMT/BST
    Posts
    37,180
    Blog Entries
    17

    Default Re: Grub takes over MBR

    Yes, I see the difference in how Ubuntu points to hd1 in it's menu and openSUSE to hd0.

    I have never used easyBCD. So as to repair, I have no idea. I imagine there is a help forum for that. But perhaps the route would be - use the win7 DVD to fix the MBR on sda, to restore win7 to original booting, then re-install easyBCD....

    It maybe does seem like SUSE may have installed grub to sda, but until you check the boot order and try just booting sda and sdb on their own, I can't be sure.
    13.2_Laptop_Spec
    My Articles
    Was I any help? If yes: Click the star below

Page 1 of 2 12 LastLast

Posting Permissions

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