Announcement

Collapse
No announcement yet.

Recover Windows 7 boot

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [MULTI BOOT] Recover Windows 7 boot

    Hi

    I had Windows 7 Ultimate 64 installed in a disk with two partitions. The other one, with Windows XP

    I have installed Kubuntu 14.10 in the XP partition, but now, Windows 7 does not boot. What could I do to recover the Windows boot and have a dual boot (Windows and Linux)?

    Regards

    #2
    Grub2 should have picked up your windows 7 with no problem. You could try grub-customizer.
    Code:
    sudo add-apt-repository ppa:danielrichter2007/grub-customizer
    sudo apt-get update
    sudo apt-get install grub-customizer

    Comment


      #3
      Or try Boot Repair. More often than not, it seems to work.

      https://help.ubuntu.com/community/Boot-Repair
      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

      Comment


        #4
        I have used boot repair and gives me that info:
        http://paste.ubuntu.com/9940719/

        Also, I used Grub Customizer, but doesn't detect Windows 7 boot. Windows 7 should appear in Grub menu... but it doesn't.

        Comment


          #5
          Originally posted by slamelov View Post
          I have used boot repair and gives me that info:
          http://paste.ubuntu.com/9940719/
          Wow what a great amount of info.

          It looks like the grub is on the mbr of the first drive, windows does not like that.

          You will probably need to
          1) re-install grub to the base of the ubuntu install /dev/sda5 and then when that works you will need to
          2) repair the windows bootloader so it lives back in the mbr ( this is done from the windows side of things) and then
          3) re-run the grub install script so it picks up the new windows boot loader ( this is done from ubuntu)

          Some google search will get you details of each step.
          Last edited by anika200; Feb 05, 2015, 11:35 AM. Reason: exchange "drive" in for "primary partition"

          Comment


            #6
            Anyone have the chainloader code ? If so, it could be used in one of the custom files in /etc/grub.d to update grub.

            Comment


              #7
              Chainloader code? If you need to chainload from grub2, add this to /etc/grub.d/40_custom

              Code:
              menuentry 'WHATEVER' {
              set root='(hdX)'
              chainloader +1
              }
              Put the hard drive number in place of the X (starting with 0 - first drive=0, second=1, etc.

              If you allow Windows to "repair" the MBR - this will leave Kubuntu unbootable, thus there's no way to run grub-install.

              Let's clear a couple of things up:

              If you have only 1 drive, you have only 1 MBR, thus only one bootloader - either windows or grub (there are others...).
              You can install grub to a PBR (partition boot record) but you can't boot directly to a partition - that requires chainloading (not really helpful here).

              The best dual-boot setup IMO is two drives - one that boot winders, one that boots grub.

              The possible single-drive solutions are:
              Figure out how to make grub "see" the windows install (the best solution).
              Manually create a bootable windows entry.
              Restore the windows boot record and let it boot Kubuntu.

              The program at issue is called os-prober. If you run os-prober byitself and it doesn't "see" windows, update-grub won't either. Open a terminal and type:

              sudo os-prober

              If windows isn't listed, try mounting the windows partition first:

              sudo mkdir /mnt/win7
              sudo mount /dev/sda2 /mnt/win7
              sudo os-prober


              If you see windows now, run update-grub. If this works, you'll need to mount windows every time you update grub so you might as well set it up in /etc/fstab so it's always mounted. If this doesn't work, try adding this to /etc/grub.d/40_custom:

              Code:
              menuentry "Windows 7" {
              insmod part_msdos
              insmod ntfs
              set root='(hd0,msdos2)'
              chainloader +1
              }
              and run update-grub. Then see if you can boot to windows. If not, report back and we'll try more.
              Last edited by oshunluvr; Feb 05, 2015, 03:54 PM.

              Please Read Me

              Comment


                #8
                According to your Boot Repair output link, you have Windows in an extended partition, sda2? The extended partiton is sda1? Is this OK with Windows? Just curious, what about sda3 and sda4? This partitioning may be OK, I'm not real sure, it just seems different.
                An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                Comment


                  #9
                  Originally posted by Qqmike View Post
                  According to your Boot Repair output link, you have Windows in an extended partition, sda2? The extended partiton is sda1? Is this OK with Windows? Just curious, what about sda3 and sda4? This partitioning may be OK, I'm not real sure, it just seems different.
                  Hey I think you are right, windows will have to be on the first primary partition.

                  Comment


                    #10
                    Originally posted by Qqmike View Post
                    According to your Boot Repair output link, you have Windows in an extended partition, sda2? The extended partiton is sda1? Is this OK with Windows? Just curious, what about sda3 and sda4? This partitioning may be OK, I'm not real sure, it just seems different.
                    Hmm, I didn't notice the pastebin post: I edited my previous post to reflect the correct partition.

                    I don't know about the partition question but it used to be that windows would boot from any partition that starts in the first 1024 cylinders.

                    Since the drive is formatted MBR style, sda2 is not (and cannot be by its name) in the extended partition. All logical partitions start at number 5. Partitions 1-4 can only be primary partitions or 3 primary partitions and one extended. In this case, his drive is laid out like this:

                    sda1 - extended
                    sda5 - logical
                    sda6 - logical
                    sda2 - primary

                    So although sda2 is not in the extended partition, it is in the second half of the drive. I do know that since Windows 7 you can install it to a logical partition but only if you have a 100MB reserved boot partition.

                    Please Read Me

                    Comment


                      #11
                      And I misread the endpoints of the partitions and thought he had Windows in the extended partition -- which he did not do.
                      An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

                      Comment


                        #12
                        Thanks for your help

                        Not sure what do I have to do, the only thing I'm thinking about is using a Windows 7 DVD and use "repairing tools", or something like that, but then, I'll probably loose Linux boot.
                        I have these partitions:

                        Code:
                        /dev/sda1    *          2,046   411,760,639   411,758,594   5 Extended
                        /dev/sda5               2,048   400,390,143   400,388,096  83 Linux
                        /dev/sda6         400,392,192   411,760,639    11,368,448  82 Linux swap / Solaris
                        /dev/sda2         411,762,688   976,766,975   565,004,288   7 NTFS / exFAT / HPFS
                        As you can see, Windows is at Sda2/

                        KDE Partition capture:

                        Click image for larger version

Name:	instantánea1.png
Views:	1
Size:	31.5 KB
ID:	642742
                        Last edited by slamelov; Feb 10, 2015, 10:05 AM.

                        Comment

                        Working...
                        X