Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: I accidentally installed grub on my windows partition!

  1. #1
    Join Date
    Mar 2011
    Beans
    13

    Question I accidentally installed grub on my windows partition!

    Ok so I've been through a bunch of the threads here and elsewhere about fixing boot issues and I'm not sure if I just can't find the solution to the specific problem I have, or if I'm just not doing things in the right order or what.

    I just installed ubuntu on a partition on my laptop that already had a windows 7 partition. First I had Kubuntu installed, but I decided to just try Ubuntu instead. I did things the right way when I installed Kubuntu and I could switch between OSes on reboot. Then when I installed Ubuntu I accidentally put grub on /dev/sda1 instead of /dev/sda. I didn't even notice for a while because I never felt like I needed to go back to Windows until I felt like playing starcraft 2. That's when I noticed that when the boot options screen appears and I select Windows, the screen goes black, a cursor flashes in the upper left corner for about a second, then the boot options screen reappears.

    If I boot using my windows 7 cd and go into recovery, get a command prompt and type Bootrec.exe /FixMbr and Bootrec.exe /FixBoot, the options appear to complete successfully, but then when I reboot, I get a permanent flashing cursor.

    If I follow that by inserting my parted magic cd and running testdisk and overwriting the mbr, I get back to the first situation where the boot options screen will appear, but the windows boot loader just returns me to the boot options screen. I can get into ubuntu, at least.

    Whenever I run testdisk I can't replace the boot with the backup boot because I'm pretty sure it's identical to the flawed one.

    So can you folks help me? how can I get grub onto /dev/sda and then restore the windows boot loader to /dev/sda1?
    Last edited by contrafactus; March 8th, 2011 at 06:25 PM.

  2. #2
    Join Date
    Mar 2010
    Beans
    8,248
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: I accidentally installed grub on my windows partition!

    Hi and welcome to the forums

    Please do the following:

    Boot the Ubuntu Live CD/USB. Choose the option "Try Ubuntu without any changes." Once the desktop loads come back here and do the following:

    1. Download the boot info script. There is a link in my signature.
    2. Once downloaded, move the boot info script to the desktop.
    3. Open a terminal and run the command

    Code:
    sudo bash ~/Desktop/boot_info_script*.sh
    This will create a RESULTS.txt file on the desktop. Paste the entire contents of that file back here in a new post. Once pasted highlight all text and click the # sign on the toolbar to place code tags around the text.

  3. #3
    Join Date
    Mar 2011
    Beans
    13

    Re: I accidentally installed grub on my windows partition!

    Code:
                    Boot Info Script 0.55    dated February 15th, 2010                    
    
    ============================= Boot Info Summary: ==============================
    
     => Windows is installed in the MBR of /dev/sda
    
    sda1: _________________________________________________________________________
    
        File system:       ntfs
        Boot sector type:  Grub 2
        Boot sector info:  Grub 2 is installed in the boot sector of sda1 and 
                           looks at sector 839899214 of the same hard drive for 
                           core.img, but core.img can not be found at this 
                           location. No errors found in the Boot Parameter Block.
        Operating System:  Windows 7
        Boot files/dirs:   /bootmgr /boot/bcd /Windows/System32/winload.exe
    
    sda2: _________________________________________________________________________
    
        File system:       Extended Partition
        Boot sector type:  Unknown
        Boot sector info:  
    
    sda5: _________________________________________________________________________
    
        File system:       ext4
        Boot sector type:  -
        Boot sector info:  
        Operating System:  Ubuntu 10.10
        Boot files/dirs:   /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img
    
    sda6: _________________________________________________________________________
    
        File system:       swap
        Boot sector type:  -
        Boot sector info:  
    
    sda3: _________________________________________________________________________
    
        File system:       ntfs
        Boot sector type:  Windows Vista/7
        Boot sector info:  No errors found in the Boot Parameter Block.
        Operating System:  
        Boot files/dirs:   
    
    =========================== Drive/Partition Info: =============================
    
    Drive: sda ___________________ _____________________________________________________
    
    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    
    Partition  Boot         Start           End          Size  Id System
    
    /dev/sda1    *          2,048   717,896,654   717,894,607   7 HPFS/NTFS
    /dev/sda2         717,896,716   950,331,391   232,434,676   f W95 Ext d (LBA)
    /dev/sda5         717,896,718   893,677,967   175,781,250  83 Linux
    /dev/sda6         893,679,616   950,331,391    56,651,776  82 Linux swap / Solaris
    /dev/sda3         950,331,392   976,766,975    26,435,584  82 Linux swap / Solaris
    
    
    blkid -c /dev/null: ____________________________________________________________
    
    Device           UUID                                   TYPE       LABEL                         
    
    /dev/loop0                                              squashfs                                 
    /dev/sda1        01CBD60174406640                       ntfs                                     
    /dev/sda2: PTTYPE="dos" 
    /dev/sda3        D2A6CADDA6CAC0E9                       ntfs       RECOVERY                      
    /dev/sda5        eceee759-e138-4af4-8259-20eb62c604c9   ext4                                     
    /dev/sda6        2e7d68d9-a804-4c36-8e1e-4a5001d9650c   swap                                     
    /dev/sda: PTTYPE="dos" 
    
    ============================ "mount | grep ^/dev  output: ===========================
    
    Device           Mount_Point              Type       Options
    
    aufs             /                        aufs       (rw)
    /dev/sr0         /cdrom                   iso9660    (ro,noatime)
    /dev/loop0       /rofs                    squashfs   (ro,noatime)
    
    
    =========================== sda5/boot/grub/grub.cfg: ===========================
    
    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by 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
      set have_grubenv=true
      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
    }
    
    function load_video {
      insmod vbe
      insmod vga
    }
    
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set eceee759-e138-4af4-8259-20eb62c604c9
    if loadfont /usr/share/grub/unicode.pf2 ; then
      set gfxmode=640x480
      load_video
      insmod gfxterm
    fi
    terminal_output gfxterm
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set eceee759-e138-4af4-8259-20eb62c604c9
    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 ###
    
    ### BEGIN /etc/grub.d/10_linux ###
    menuentry 'Ubuntu, with Linux 2.6.35-27-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos5)'
        search --no-floppy --fs-uuid --set eceee759-e138-4af4-8259-20eb62c604c9
        linux    /boot/vmlinuz-2.6.35-27-generic root=UUID=eceee759-e138-4af4-8259-20eb62c604c9 ro   quiet splash
        initrd    /boot/initrd.img-2.6.35-27-generic
    }
    menuentry 'Ubuntu, with Linux 2.6.35-27-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos5)'
        search --no-floppy --fs-uuid --set eceee759-e138-4af4-8259-20eb62c604c9
        echo    'Loading Linux 2.6.35-27-generic ...'
        linux    /boot/vmlinuz-2.6.35-27-generic root=UUID=eceee759-e138-4af4-8259-20eb62c604c9 ro single 
        echo    'Loading initial ramdisk ...'
        initrd    /boot/initrd.img-2.6.35-27-generic
    }
    ### END /etc/grub.d/10_linux ###
    
    ### BEGIN /etc/grub.d/20_linux_xen ###
    ### END /etc/grub.d/20_linux_xen ###
    
    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos5)'
        search --no-floppy --fs-uuid --set eceee759-e138-4af4-8259-20eb62c604c9
        linux16    /boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos5)'
        search --no-floppy --fs-uuid --set eceee759-e138-4af4-8259-20eb62c604c9
        linux16    /boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Windows 7 (loader) (on /dev/sda1)" {
        insmod part_msdos
        insmod ntfs
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set 01cbd60174406640
        chainloader +1
    }
    ### END /etc/grub.d/30_os-prober ###
    
    ### BEGIN /etc/grub.d/40_custom ###
    # This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    ### END /etc/grub.d/40_custom ###
    
    ### BEGIN /etc/grub.d/41_custom ###
    if [ -f  $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
    fi
    ### END /etc/grub.d/41_custom ###
    
    =============================== sda5/etc/fstab: ===============================
    
    # /etc/fstab: static file system information.
    #
    # Use 'blkid -o value -s UUID' to print the universally unique identifier
    # for a device; this may be used with UUID= as a more robust way to name
    # devices that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    nodev,noexec,nosuid 0       0
    /dev/sda5       /               ext4    errors=remount-ro 0       1
    # swap was on /dev/sda6 during installation
    UUID=2e7d68d9-a804-4c36-8e1e-4a5001d9650c none            swap    sw              0       0
    
    =================== sda5: Location of files loaded by Grub: ===================
    
    
     430.0GB: boot/grub/core.img
     381.0GB: boot/grub/grub.cfg
     370.4GB: boot/initrd.img-2.6.35-27-generic
     430.1GB: boot/vmlinuz-2.6.35-27-generic
     370.4GB: initrd.img
     430.1GB: vmlinuz
    =========================== Unknown MBRs/Boot Sectors/etc =======================
    
    Unknown BootLoader  on sda2
    
    00000000  16 fc 86 00 30 61 b0 c3  3d 08 99 60 43 8d c7 1a  |....0a..=..`C...|
    00000010  92 64 f6 fd 85 59 fa 32  77 ea b3 e6 00 03 da 79  |.d...Y.2w......y|
    00000020  57 f7 a6 16 cf 63 a8 72  4e 4b b8 3e b5 82 cb c0  |W....c.rNK.>....|
    00000030  26 44 a8 64 6d 30 5a e9  88 cf d1 6e c3 ed 81 77  |&D.dm0Z....n...w|
    00000040  6b 1c e7 4e e1 d2 55 ea  27 56 11 9b 06 8b 0f 7c  |k..N..U.'V.....||
    00000050  4f 7e 79 13 58 3c 65 af  a3 16 10 ae 50 f5 d1 f9  |O~y.X<e.....P...|
    00000060  97 0f 6e bc d4 d2 30 e4  52 6f 51 10 dc 4e b7 d8  |..n...0.RoQ..N..|
    00000070  43 d8 02 70 a9 6e 39 e1  ab 24 82 8d c7 32 67 1c  |C..p.n9..$...2g.|
    00000080  c9 6d e2 11 73 08 5e 50  31 6e 43 58 ef 06 0e 42  |.m..s.^P1nCX...B|
    00000090  9c 08 21 4e 29 40 fb c1  83 1e 7c 3f f6 c3 a6 ea  |..!N)@....|?....|
    000000a0  0c cf 3c c3 24 65 eb 81  d2 11 bc cd b1 52 1d df  |..<.$e.......R..|
    000000b0  f6 b3 ff 29 df f7 4d 3e  45 ab 63 87 8b 33 84 56  |...)..M>E.c..3.V|
    000000c0  f7 a6 55 cf 5f 5d d0 ba  3e 67 47 b0 26 f4 5c f4  |..U._]..>gG.&.\.|
    000000d0  29 c0 01 e2 2a 81 26 eb  38 39 b5 d5 dd c3 cf 03  |)...*.&.89......|
    000000e0  c1 6c a1 ea d8 72 12 a9  19 df e4 73 e3 6c 13 f9  |.l...r.....s.l..|
    000000f0  bb b6 7a 5d 2a 6b 4e 4c  f8 8e c6 72 36 75 6c 4b  |..z]*kNL...r6ulK|
    00000100  bd 3d c2 3b 5a 5d a7 0a  9c 86 78 b9 bc df 95 b1  |.=.;Z]....x.....|
    00000110  e0 51 19 3b 71 e9 9c 27  96 f2 70 33 32 7a 77 95  |.Q.;q..'..p32zw.|
    00000120  aa 4f 64 3d 0f 88 80 83  88 74 0a 3c 80 cf 3c f2  |.Od=.....t.<..<.|
    00000130  4c 53 71 b3 4d 40 0d 6c  39 61 15 3f 5f 32 cd 38  |LSq.M@.l9a.?_2.8|
    00000140  1e 1e b2 67 2d d9 ee ce  01 fb 8f 2e 32 1e 25 ef  |...g-.......2.%.|
    00000150  07 6c f4 29 d0 f8 03 9e  1f 6d fc 10 66 f7 da 14  |.l.).....m..f...|
    00000160  8e 9c 41 8f 80 18 10 0b  45 5d ee b7 a7 be 70 8a  |..A.....E]....p.|
    00000170  cc e6 05 92 93 f2 4c 93  2f 6a 63 68 d1 e4 6b de  |......L./jch..k.|
    00000180  b1 c8 6c fd 16 21 9c c3  99 43 92 72 c2 17 ad 5f  |..l..!...C.r..._|
    00000190  3b 1c 06 ad 33 a0 d6 8d  08 ba 4a e9 90 51 67 8a  |;...3.....J..Qg.|
    000001a0  3f 85 24 2b 27 39 64 c7  96 4c 79 67 bc a8 cf 58  |?.$+'9d..Lyg...X|
    000001b0  a9 0d b0 33 c7 3a 98 f8  72 13 16 13 82 87 00 fe  |...3.:..r.......|
    000001c0  ff ff 83 fe ff ff 02 00  00 00 82 35 7a 0a 00 fe  |...........5z...|
    000001d0  ff ff 05 fe ff ff 84 35  7a 0a 70 76 60 03 00 00  |.......5z.pv`...|
    000001e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
    00000200
    TIA for your help!
    Last edited by contrafactus; March 8th, 2011 at 06:29 PM.

  4. #4
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: I accidentally installed grub on my windows partition!

    Have you visited a Windows forum?
    I wouldn't try using linux tools to get your Windows install fixed. Use Windows tools.

    Then start over again with Ubuntu. BTW you can avoid these Grub problems by adding Ubuntu to your Windows bootloader menu. You need to install EasyBCD (free) in Windows and when you install Ubuntu, install Grub in the Ubuntu partition not the MBR.

  5. #5
    Join Date
    Mar 2010
    Beans
    8,248
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: I accidentally installed grub on my windows partition!

    I can only assume whatever happened with sda3 is a result of messing around with various tools?

    As you already knew, GRUB was installed to the boot sector of sda1.

    Here is what you can try and do:

    1. restore the Windows boot sector; fixmbr and fixboot need only be run once. The startup repair may need to be run 3 times before it works.

    First try that and see where it gets you.

    2. if the above does not work, try installing a basic Windows-like bootloader called lilo.
    This can be done from the LiveCD:

    Code:
    sudo apt-get install lilo
    Code:
    sudo lilo -M /dev/sda mbr
    Ignore warnings, we just want lilo in the MBR.

    If this gets you booting Windows again, we can reinstall GRUB properly.

    By the way, I respectfully disagree with the assessment of the situation posted by YesWeCan. There is no need, at this stage, to redo everything. We are not out of options yet. And, since you are booting Ubuntu, I see no reason why we should not offer help with booting Windows.
    Last edited by Rubi1200; March 8th, 2011 at 09:20 PM. Reason: clarification

  6. #6
    Join Date
    Mar 2011
    Beans
    13

    Re: I accidentally installed grub on my windows partition!

    I don't know if this is progress at all or not. At least sda1's boot info looks more accurate. Only problem is now I just get a permanent cursor flashing on boot up and nothing else.

    It looks like all I need to do is get grub back into the MBR of /dev/sda. Am I right? And how do you do that?

    Oh, and I believe sda3 is a windows recovery partition...

    Code:
                    Boot Info Script 0.55    dated February 15th, 2010                    
    
    ============================= Boot Info Summary: ==============================
    
     => Windows is installed in the MBR of /dev/sda
    
    sda1: _________________________________________________________________________
    
        File system:       ntfs
        Boot sector type:  Windows Vista/7
        Boot sector info:  No errors found in the Boot Parameter Block.
        Operating System:  Windows 7
        Boot files/dirs:   /bootmgr /boot/BCD /Windows/System32/winload.exe
    
    sda2: _________________________________________________________________________
    
        File system:       Extended Partition
        Boot sector type:  Unknown
        Boot sector info:  
    
    sda5: _________________________________________________________________________
    
        File system:       ext4
        Boot sector type:  -
        Boot sector info:  
        Operating System:  Ubuntu 10.10
        Boot files/dirs:   /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img
    
    sda6: _________________________________________________________________________
    
        File system:       swap
        Boot sector type:  -
        Boot sector info:  
    
    sda3: _________________________________________________________________________
    
        File system:       ntfs
        Boot sector type:  Windows Vista/7
        Boot sector info:  No errors found in the Boot Parameter Block.
        Operating System:  
        Boot files/dirs:   
    
    =========================== Drive/Partition Info: =============================
    
    Drive: sda ___________________ _____________________________________________________
    
    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    
    Partition  Boot         Start           End          Size  Id System
    
    /dev/sda1    *          2,048   717,896,654   717,894,607   7 HPFS/NTFS
    /dev/sda2         717,896,716   950,331,391   232,434,676   f W95 Ext d (LBA)
    /dev/sda5         717,896,718   893,677,967   175,781,250  83 Linux
    /dev/sda6         893,679,616   950,331,391    56,651,776  82 Linux swap / Solaris
    /dev/sda3         950,331,392   976,766,975    26,435,584  82 Linux swap / Solaris
    
    
    blkid -c /dev/null: ____________________________________________________________
    
    Device           UUID                                   TYPE       LABEL                         
    
    /dev/loop0                                              squashfs                                 
    /dev/sda1        01CBD60174406640                       ntfs                                     
    /dev/sda2: PTTYPE="dos" 
    /dev/sda3        D2A6CADDA6CAC0E9                       ntfs       RECOVERY                      
    /dev/sda5        c41b157b-7782-4117-b7f6-178dd749cbaa   ext4                                     
    /dev/sda6        2e7d68d9-a804-4c36-8e1e-4a5001d9650c   swap                                     
    /dev/sda: PTTYPE="dos" 
    
    ============================ "mount | grep ^/dev  output: ===========================
    
    Device           Mount_Point              Type       Options
    
    aufs             /                        aufs       (rw)
    /dev/sr0         /cdrom                   iso9660    (ro,noatime)
    /dev/loop0       /rofs                    squashfs   (ro,noatime)
    
    
    =========================== sda5/boot/grub/grub.cfg: ===========================
    
    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by 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
      set have_grubenv=true
      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
    }
    
    function load_video {
      insmod vbe
      insmod vga
    }
    
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set c41b157b-7782-4117-b7f6-178dd749cbaa
    if loadfont /usr/share/grub/unicode.pf2 ; then
      set gfxmode=640x480
      load_video
      insmod gfxterm
    fi
    terminal_output gfxterm
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos5)'
    search --no-floppy --fs-uuid --set c41b157b-7782-4117-b7f6-178dd749cbaa
    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 ###
    
    ### BEGIN /etc/grub.d/10_linux ###
    menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos5)'
        search --no-floppy --fs-uuid --set c41b157b-7782-4117-b7f6-178dd749cbaa
        linux    /boot/vmlinuz-2.6.35-22-generic root=UUID=c41b157b-7782-4117-b7f6-178dd749cbaa ro   quiet splash
        initrd    /boot/initrd.img-2.6.35-22-generic
    }
    menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos5)'
        search --no-floppy --fs-uuid --set c41b157b-7782-4117-b7f6-178dd749cbaa
        echo    'Loading Linux 2.6.35-22-generic ...'
        linux    /boot/vmlinuz-2.6.35-22-generic root=UUID=c41b157b-7782-4117-b7f6-178dd749cbaa ro single 
        echo    'Loading initial ramdisk ...'
        initrd    /boot/initrd.img-2.6.35-22-generic
    }
    ### END /etc/grub.d/10_linux ###
    
    ### BEGIN /etc/grub.d/20_linux_xen ###
    ### END /etc/grub.d/20_linux_xen ###
    
    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos5)'
        search --no-floppy --fs-uuid --set c41b157b-7782-4117-b7f6-178dd749cbaa
        linux16    /boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos5)'
        search --no-floppy --fs-uuid --set c41b157b-7782-4117-b7f6-178dd749cbaa
        linux16    /boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Windows 7 (loader) (on /dev/sda1)" {
        insmod part_msdos
        insmod ntfs
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set 01cbd60174406640
        chainloader +1
    }
    ### END /etc/grub.d/30_os-prober ###
    
    ### BEGIN /etc/grub.d/40_custom ###
    # This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    ### END /etc/grub.d/40_custom ###
    
    ### BEGIN /etc/grub.d/41_custom ###
    if [ -f  $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
    fi
    ### END /etc/grub.d/41_custom ###
    
    =============================== sda5/etc/fstab: ===============================
    
    # /etc/fstab: static file system information.
    #
    # Use 'blkid -o value -s UUID' to print the universally unique identifier
    # for a device; this may be used with UUID= as a more robust way to name
    # devices that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    nodev,noexec,nosuid 0       0
    # / was on /dev/sda5 during installation
    UUID=c41b157b-7782-4117-b7f6-178dd749cbaa /               ext4    errors=remount-ro 0       1
    # swap was on /dev/sda6 during installation
    UUID=2e7d68d9-a804-4c36-8e1e-4a5001d9650c none            swap    sw              0       0
    
    =================== sda5: Location of files loaded by Grub: ===================
    
    
     408.5GB: boot/grub/core.img
     384.8GB: boot/grub/grub.cfg
     368.5GB: boot/initrd.img-2.6.35-22-generic
     408.5GB: boot/vmlinuz-2.6.35-22-generic
     368.5GB: initrd.img
     408.5GB: vmlinuz
    =========================== Unknown MBRs/Boot Sectors/etc =======================
    
    Unknown BootLoader  on sda2
    
    00000000  16 fc 86 00 30 61 b0 c3  3d 08 99 60 43 8d c7 1a  |....0a..=..`C...|
    00000010  92 64 f6 fd 85 59 fa 32  77 ea b3 e6 00 03 da 79  |.d...Y.2w......y|
    00000020  57 f7 a6 16 cf 63 a8 72  4e 4b b8 3e b5 82 cb c0  |W....c.rNK.>....|
    00000030  26 44 a8 64 6d 30 5a e9  88 cf d1 6e c3 ed 81 77  |&D.dm0Z....n...w|
    00000040  6b 1c e7 4e e1 d2 55 ea  27 56 11 9b 06 8b 0f 7c  |k..N..U.'V.....||
    00000050  4f 7e 79 13 58 3c 65 af  a3 16 10 ae 50 f5 d1 f9  |O~y.X<e.....P...|
    00000060  97 0f 6e bc d4 d2 30 e4  52 6f 51 10 dc 4e b7 d8  |..n...0.RoQ..N..|
    00000070  43 d8 02 70 a9 6e 39 e1  ab 24 82 8d c7 32 67 1c  |C..p.n9..$...2g.|
    00000080  c9 6d e2 11 73 08 5e 50  31 6e 43 58 ef 06 0e 42  |.m..s.^P1nCX...B|
    00000090  9c 08 21 4e 29 40 fb c1  83 1e 7c 3f f6 c3 a6 ea  |..!N)@....|?....|
    000000a0  0c cf 3c c3 24 65 eb 81  d2 11 bc cd b1 52 1d df  |..<.$e.......R..|
    000000b0  f6 b3 ff 29 df f7 4d 3e  45 ab 63 87 8b 33 84 56  |...)..M>E.c..3.V|
    000000c0  f7 a6 55 cf 5f 5d d0 ba  3e 67 47 b0 26 f4 5c f4  |..U._]..>gG.&.\.|
    000000d0  29 c0 01 e2 2a 81 26 eb  38 39 b5 d5 dd c3 cf 03  |)...*.&.89......|
    000000e0  c1 6c a1 ea d8 72 12 a9  19 df e4 73 e3 6c 13 f9  |.l...r.....s.l..|
    000000f0  bb b6 7a 5d 2a 6b 4e 4c  f8 8e c6 72 36 75 6c 4b  |..z]*kNL...r6ulK|
    00000100  bd 3d c2 3b 5a 5d a7 0a  9c 86 78 b9 bc df 95 b1  |.=.;Z]....x.....|
    00000110  e0 51 19 3b 71 e9 9c 27  96 f2 70 33 32 7a 77 95  |.Q.;q..'..p32zw.|
    00000120  aa 4f 64 3d 0f 88 80 83  88 74 0a 3c 80 cf 3c f2  |.Od=.....t.<..<.|
    00000130  4c 53 71 b3 4d 40 0d 6c  39 61 15 3f 5f 32 cd 38  |LSq.M@.l9a.?_2.8|
    00000140  1e 1e b2 67 2d d9 ee ce  01 fb 8f 2e 32 1e 25 ef  |...g-.......2.%.|
    00000150  07 6c f4 29 d0 f8 03 9e  1f 6d fc 10 66 f7 da 14  |.l.).....m..f...|
    00000160  8e 9c 41 8f 80 18 10 0b  45 5d ee b7 a7 be 70 8a  |..A.....E]....p.|
    00000170  cc e6 05 92 93 f2 4c 93  2f 6a 63 68 d1 e4 6b de  |......L./jch..k.|
    00000180  b1 c8 6c fd 16 21 9c c3  99 43 92 72 c2 17 ad 5f  |..l..!...C.r..._|
    00000190  3b 1c 06 ad 33 a0 d6 8d  08 ba 4a e9 90 51 67 8a  |;...3.....J..Qg.|
    000001a0  3f 85 24 2b 27 39 64 c7  96 4c 79 67 bc a8 cf 58  |?.$+'9d..Lyg...X|
    000001b0  a9 0d b0 33 c7 3a 98 f8  72 13 16 13 82 87 00 fe  |...3.:..r.......|
    000001c0  ff ff 83 fe ff ff 02 00  00 00 82 35 7a 0a 00 fe  |...........5z...|
    000001d0  ff ff 05 fe ff ff 84 35  7a 0a 70 76 60 03 00 00  |.......5z.pv`...|
    000001e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    000001f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 55 aa  |..............U.|
    00000200
    THANKS AGAIN!

    And as for your last post, Startup Repair only ran once then claimed it couldn't find any more problems. And lilo didn't seem to do anything.
    Last edited by contrafactus; March 8th, 2011 at 11:41 PM. Reason: More Info

  7. #7
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: I accidentally installed grub on my windows partition!

    You should be able to restore G2 from the LiveCD. It will be installed in the sda MBR and point to sda5 (Ubuntu):

    From a LiveCD terminal:
    Code:
    sudo mount /dev/sda5 /mnt
    sudo grub-install --root-directory=/mnt /dev/sda
    Do not include the partition number in the second command.

    If Windows is not in the Grub2 menu after you reboot, run "sudo update-grub".
    Back to Xorg...

    Retired.

  8. #8
    Join Date
    Mar 2011
    Beans
    13

    Re: I accidentally installed grub on my windows partition!

    ubuntu@ubuntu:~$ sudo grub-install -v
    grub-install (GRUB) 1.98+20100804-5ubuntu3
    ubuntu@ubuntu:~$ sudo mount /dev/sda5 /mnt
    ubuntu@ubuntu:~$ sudo grub-install --root-directory =/mnt /dev/sda
    /usr/sbin/grub-probe: error: cannot find a device for =/mnt/boot/grub (is /dev mounted?).


    Here's the error I got. any ideas?

    Thanks!

    OH! I added a space. now it looks like:

    ubuntu@ubuntu:~$ sudo grub-install --root-directory=/mnt /dev/sda
    Installation finished. No error reported.

    OK so now I've made a little progress. Windows' boot loader WAS still listed in the grub boot options menu after boot, but it still wouldn't start. When I select the windows option, it just goes to the perma-flashing-cursor. I even went into ubuntu and did the update-grub command. Any suggestions? I was just going to go back and see if the windows 7 cd repair options might work.
    Last edited by contrafactus; March 9th, 2011 at 12:01 AM. Reason: new stuff and more new stuff.

  9. #9
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: I accidentally installed grub on my windows partition!

    Quote Originally Posted by contrafactus View Post
    OK so now I've made a little progress. Windows' boot loader WAS still listed in the grub boot options menu after boot, but it still wouldn't start. When I select the windows option, it just goes to the perma-flashing-cursor. I even went into ubuntu and did the update-grub command. Any suggestions? I was just going to go back and see if the windows 7 cd repair options might work.
    I was under the impression you had Windows working and just wanted to get Grub back so you could boot both OS's.

    I don't know my way around Windows very well. My recommendation would be to get your Windows installation working - even if you have to do the "lilo" routine again to get back to the Windows bootloader. Fix Windows, then reinstall G2 as described. There aren't many Windows problems you can fix directly from within Linux.

    All G2 does with Windows is to transfer control to the Windows loader. If you get it to boot from the Windows loader, it should also work once you change to Grub as long as the boot flag points to your Windows boot partition (Grub doesn't use it but Windows does, and it looks like it is currently correct).
    Back to Xorg...

    Retired.

  10. #10
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: I accidentally installed grub on my windows partition!

    Here's the thing. When you originally accidentally installed Grub to sda1 you corrupted Windows' bootloader.

    Grub is not a replacement bootloader for Windows. So Grub just boots the Windows bootloader (just like the Windows bootloader can boot Grub). If it is corrupted it won't work.

    So you have to repair the Windows bootloader before you will ever be able to boot Windows. AFAIK you cannot do this with linux tools and that is why I suggest you visit a Windows forum for help.


    Once you have restored Windows bootloader you will not be able to boot Ubuntu. This is because you will have removed the Grub-style MBR and replaced it with a standard MBR, which suits Windows bootloader. To be able to boot Ubuntu again you have to reinstall Grub, and you have a choice:

    1) You reinstall Grub to the Ubuntu partition sda5 and then you use EasyBCD to add Ubuntu to your Windows boot menu. The MBR will boot the Windows bootloader on sda1 and this will boot Grub on sda5. This is good because Windows updates won't break anything.

    2) You reinstall Grub to the MBR and then use update-grub to add Windows to the Grub boot menu. The Grub2 MBR will boot Grub2 bootloader on sda5 and this will boot the Windows bootloader on sda1.
    Last edited by YesWeCan; March 9th, 2011 at 01:15 AM.

Page 1 of 3 123 LastLast

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
  •